Top Description Fields Constructors Methods
com.sun.org.apache.xml.internal.security

public Class Init

extends Object
Class Inheritance
Imports
java.io.IOException, .InputStream, java.net.URL, java.security.AccessController, .PrivilegedAction, .PrivilegedActionException, .PrivilegedExceptionAction, java.util.ArrayList, .Enumeration, .List, com.sun.org.apache.xml.internal.security.algorithms.JCEMapper, .SignatureAlgorithm, com.sun.org.apache.xml.internal.security.c14n.Canonicalizer, com.sun.org.apache.xml.internal.security.exceptions.XMLSecurityException, com.sun.org.apache.xml.internal.security.keys.keyresolver.KeyResolver, com.sun.org.apache.xml.internal.security.transforms.Transform, com.sun.org.apache.xml.internal.security.utils.ElementProxy, .I18n, .XMLUtils, com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolver, org.w3c.dom.Attr, .Document, .Element, .Node

This class does the configuration of the library. This includes creating the mapping of Canonicalization and Transform algorithms. Initialization is done by calling Init#init which should be done in any static block of the files of this library. We ensure that this call is only executed once.

Field Summary

Modifier and TypeField and Description
private static boolean
alreadyInitialized

Field alreadyInitialized

public static final String
CONF_NS

The namespace for CONF file

private static final Logger

Constructor Summary

AccessConstructor and Description
public
Init()

Method Summary

Modifier and TypeMethod and Description
private static void
dynamicInit()

Dynamically initialise the library by registering the default algorithms/implementations

private static void
fileInit(InputStream is)

Initialise the library from a configuration file

public static URL
getResource(String
The name of the resource to load
resourceName
,
Class<?>
The Class object of the calling object
callingClass
)

Load a given resource.

private static InputStream
getResourceAsStream(String
The name of the resource to load
resourceName
,
Class<?>
The Class object of the calling object
callingClass
)

This is a convenience method to load a resource as a stream.

private static List<URL>
getResources(String
The name of the resource to load
resourceName
,
Class<?>
The Class object of the calling object
callingClass
)

Load a given resources.

public static synchronized void
init()

Method init

public static final synchronized boolean

Returns:

true if the library is already initialized.
isInitialized
()

Method isInitialized

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

alreadyInitializedback to summary
private static boolean alreadyInitialized

Field alreadyInitialized

CONF_NSback to summary
public static final String CONF_NS

The namespace for CONF file

LOGback to summary
private static final Logger LOG

Constructor Detail

Initback to summary
public Init()

Method Detail

dynamicInitback to summary
private static void dynamicInit()

Dynamically initialise the library by registering the default algorithms/implementations

Annotations
@SuppressWarnings:removal
fileInitback to summary
private static void fileInit(InputStream is)

Initialise the library from a configuration file

getResourceback to summary
public static URL getResource(String resourceName, Class<?> callingClass)

Load a given resource.

This method will try to load the resource using the following methods (in order):
  • From Thread.currentThread().getContextClassLoader()
  • From ClassLoaderUtil.class.getClassLoader()
  • callingClass.getClassLoader()
Parameters
resourceName:String

The name of the resource to load

callingClass:Class<?>

The Class object of the calling object

getResourceAsStreamback to summary
private static InputStream getResourceAsStream(String resourceName, Class<?> callingClass)

This is a convenience method to load a resource as a stream.

The algorithm used to find the resource is given in getResource()
Parameters
resourceName:String

The name of the resource to load

callingClass:Class<?>

The Class object of the calling object

getResourcesback to summary
private static List<URL> getResources(String resourceName, Class<?> callingClass)

Load a given resources.

This method will try to load the resources using the following methods (in order):
  • From Thread.currentThread().getContextClassLoader()
  • From ClassLoaderUtil.class.getClassLoader()
  • callingClass.getClassLoader()
Parameters
resourceName:String

The name of the resource to load

callingClass:Class<?>

The Class object of the calling object

initback to summary
public static synchronized void init()

Method init

isInitializedback to summary
public static final synchronized boolean isInitialized()

Method isInitialized

Returns:boolean

true if the library is already initialized.