org.jomc.ri
Class DefaultObjectManager

Package class diagram package DefaultObjectManager
java.lang.Object
  extended by org.jomc.ri.DefaultObjectManager
All Implemented Interfaces:
ObjectManager

@Generated(value="org.jomc.tools.SourceFileProcessor 1.2.2",
           comments="See http://jomc.sourceforge.net/jomc/1.2/jomc-tools-1.2.2")
public class DefaultObjectManager
extends Object
implements ObjectManager

Default ObjectManager implementation.

Identifier:
org.jomc.ri.DefaultObjectManager
Name:
JOMC RI
Specifications:
org.jomc.ObjectManager @ 1.0
Abstract:
No
Final:
No
Stateless:
No

Version:
1.2
Author:
Christian Schulte 1.0

Field Summary
protected static String SINGLETON_SCOPE_IDENTIFIER
          Constant for the Singleton scope identifier.
 
Constructor Summary
DefaultObjectManager()
          Creates a new DefaultObjectManager instance.
 
Method Summary
static String getBootstrapClassLoaderClassName()
          Gets the name of the platform's bootstrap class loader class.
static ClassLoader getClassLoader(Class<?> clazz)
          Deprecated. As of JOMC 1.1, please use method getDefaultClassLoader(java.lang.Class). This method will be removed in version 2.0.
static ClassLoader getClassLoader(ClassLoader classLoader)
          Deprecated. As of JOMC 1.1, please use method getDefaultClassLoader(java.lang.ClassLoader). This method will be removed in version 2.0.
 ClassLoader getDefaultClassLoader(Class<?> clazz)
          Gets the class loader of a given class.
 ClassLoader getDefaultClassLoader(ClassLoader classLoader)
          Gets the parent class loader of a given class loader recursively.
 Invocation getDefaultInvocation()
          Deprecated. As of JOMC 1.2, replaced by method getDefaultInvocation(org.jomc.model.Modules). This method will be removed in version 2.0.
 Invocation getDefaultInvocation(Modules model)
          Gets a new default invocation implementation instance.
 Invoker getDefaultInvoker()
          Deprecated. As of JOMC 1.2, replaced by method getDefaultInvoker(org.jomc.model.Modules). This method will be removed in version 2.0.
 Invoker getDefaultInvoker(Modules model)
          Gets a new default invoker implementation instance.
 Listener getDefaultListener()
          Deprecated. As of JOMC 1.2, replaced by method getDefaultListener(org.jomc.model.Modules). This method will be removed in version 2.0.
 Listener getDefaultListener(Modules model)
          Gets a new default listener implementation instance.
 Locator getDefaultLocator(Modules model, URI location)
          Gets a new default locator implementation instance for a given location URI.
 Locator getDefaultLocator(URI location)
          Deprecated. As of JOMC 1.2, replaced by method getDefaultLocator(org.jomc.model.Modules, java.net.URI). This method will be removed in version 2.0.
static Level getDefaultLogLevel()
          Gets the default log level events are logged at.
static String getDefaultModelIdentifier()
          Gets the identifier of the model to search for modules by default.
 Modules getDefaultModules()
          Gets a new default modules instance.
 Scope getDefaultScope(Modules model, String identifier)
          Gets a new default scope implementation instance for a given identifier.
 Scope getDefaultScope(String identifier)
          Deprecated. As of JOMC 1.2, replaced by method getDefaultScope(org.jomc.model.Modules,java.lang.String). This method will be removed in version 2.0.
 Object getDependency(Object object, String dependencyName)
           
 Invocation getInvocation(ClassLoader classLoader, Object object, Instance instance, Method method, Object[] arguments)
          Gets an invocation for a given class loader, object, instance, method and arguments.
 Invocation getInvocation(Object object, Instance instance, Method method, Object[] arguments)
          Deprecated. As of JOMC 1.1, please use method getInvocation(java.lang.ClassLoader, java.lang.Object, org.jomc.model.Instance, java.lang.reflect.Method, java.lang.Object[]). This method will be removed in version 2.0.
 Invoker getInvoker(ClassLoader classLoader)
          Gets the invoker registered with a given class loader.
 List<Listener> getListeners()
          Gets the list of listeners registered with the class loader of the instance.
 List<Listener> getListeners(ClassLoader classLoader)
          Gets the list of listeners registered with a given class loader.
 Locator getLocator(URI location, ClassLoader classLoader)
          Gets a locator to use with a given location URI registered with a given class loader.
 Level getLogLevel()
          Gets the log level of the instance.
 String getMessage(Object object, String messageName, Locale locale, Object... arguments)
           
 String getModelIdentifier()
          Gets the identifier of the model to search for modules.
 Modules getModules(ClassLoader classLoader)
          Gets the modules registered with a given class loader.
<T> T
getObject(Class<T> specification)
           
<T> T
getObject(Class<T> specification, String implementationName)
           
<T> T
getObject(Class<T> specification, URI location, ClassLoader classLoader)
          Gets an object for a given location URI.
 Object getObject(Scope scope, Instance instance, ClassLoader classLoader)
          Gets an object of a given instance from a given scope.
static ObjectManager getObjectManager(ClassLoader classLoader)
          Default ObjectManagerFactory.getObjectManager(ClassLoader) implementation.
 Object getProperty(Object object, String propertyName)
           
 Modules getRuntimeModules(Modules modules, Map<Object,Instance> objectMap)
          Gets a new Modules instance to register with a class loader.
 Scope getScope(String identifier, ClassLoader classLoader)
          Gets the scope implementation for a given scope identifier registered with a given class loader.
 void initialize()
          Initializes the instance.
static boolean isDefaultModelObjectClasspathResolutionEnabled()
          Gets a flag indicating model object class path resolution is enabled by default.
static boolean isDefaultModelProcessingEnabled()
          Gets a flag indicating model processing is enabled by default.
 boolean isLoggable(Level level)
          Checks if a message at a given level is provided to the listeners of the instance.
 boolean isModelObjectClasspathResolutionEnabled()
          Gets a flag indicating model object class path resolution is enabled.
 boolean isModelProcessingEnabled()
          Gets a flag indicating model processing is enabled.
 void log(ClassLoader classLoader, Level level, String message, Throwable throwable)
          Notifies listeners registered with a given class loader.
 void log(Level level, String message, Throwable throwable)
          Notifies listeners registered with the class loader of the instance.
static void setBootstrapClassLoaderClassName(String value)
          Sets the name of the platform's bootstrap class loader class.
static void setDefaultLogLevel(Level value)
          Sets the default log level events are logged at.
static void setDefaultModelIdentifier(String value)
          Sets the identifier of the model to search for modules by default.
static void setDefaultModelObjectClasspathResolutionEnabled(Boolean value)
          Sets the flag indicating model object class path resolution is enabled by default.
static void setDefaultModelProcessingEnabled(Boolean value)
          Sets the flag indicating model processing is enabled by default.
 void setLogLevel(Level value)
          Sets the log level of the instance.
 void setModelIdentifier(String value)
          Sets the identifier of the model to search for modules.
 void setModelObjectClasspathResolutionEnabled(Boolean value)
          Sets the flag indicating model object class path resolution is enabled.
 void setModelProcessingEnabled(Boolean value)
          Sets the flag indicating model processing is enabled.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SINGLETON_SCOPE_IDENTIFIER

protected static final String SINGLETON_SCOPE_IDENTIFIER
Constant for the Singleton scope identifier.

See Also:
Constant Field Values
Constructor Detail

DefaultObjectManager

@Generated(value="org.jomc.tools.SourceFileProcessor 1.2.2",
           comments="See http://jomc.sourceforge.net/jomc/1.2/jomc-tools-1.2.2")
public DefaultObjectManager()
Creates a new DefaultObjectManager instance.

Method Detail

getObject

public <T> T getObject(Class<T> specification)
Specified by:
getObject in interface ObjectManager

getObject

public <T> T getObject(Class<T> specification,
                       String implementationName)
Specified by:
getObject in interface ObjectManager

getDependency

public Object getDependency(Object object,
                            String dependencyName)
Specified by:
getDependency in interface ObjectManager

getProperty

public Object getProperty(Object object,
                          String propertyName)
Specified by:
getProperty in interface ObjectManager

getMessage

public String getMessage(Object object,
                         String messageName,
                         Locale locale,
                         Object... arguments)
Specified by:
getMessage in interface ObjectManager

getObjectManager

public static ObjectManager getObjectManager(ClassLoader classLoader)
Default ObjectManagerFactory.getObjectManager(ClassLoader) implementation.

Parameters:
classLoader - The class loader to use for getting the singleton instance; null to use the platform's bootstrap class loader.
Returns:
The default ObjectManager singleton instance.
See Also:
ObjectManagerFactory.getObjectManager(ClassLoader)

getListeners

public List<Listener> getListeners()
Gets the list of listeners registered with the class loader of the instance.

Calling this method is the same as calling

 getListeners( getClassLoader( getClass() ) );

Returns:
The list of registered listeners.
See Also:
getListeners(java.lang.ClassLoader)

getListeners

public List<Listener> getListeners(ClassLoader classLoader)
Gets the list of listeners registered with a given class loader.

Parameters:
classLoader - The class loader to get registered listeners of.
Returns:
The list of listeners registered with classLoader.
Throws:
NullPointerException - if classLoader is null.
Since:
1.1
See Also:
getDefaultListener()

getDefaultListener

@Deprecated
public Listener getDefaultListener()
Deprecated. As of JOMC 1.2, replaced by method getDefaultListener(org.jomc.model.Modules). This method will be removed in version 2.0.

Gets a new default listener implementation instance.

Returns:
A new default listener implementation instance.
Since:
1.1
See Also:
getListeners(), getListeners(java.lang.ClassLoader)

getDefaultListener

public Listener getDefaultListener(Modules model)
Gets a new default listener implementation instance.

Parameters:
model - The model to get a new default listener implementation instance of.
Returns:
A new default listener implementation instance.
Throws:
NullPointerException - if model is null.
Since:
1.2
See Also:
getListeners(), getListeners(java.lang.ClassLoader)

getDefaultLogLevel

public static Level getDefaultLogLevel()
Gets the default log level events are logged at.

The default log level is controlled by system property org.jomc.ri.DefaultObjectManager.defaultLogLevel holding the log level to log events at by default. If that property is not set, the WARNING default is returned.

Returns:
The log level events are logged at by default.
See Also:
getLogLevel(), Level.parse(java.lang.String)

setDefaultLogLevel

public static void setDefaultLogLevel(Level value)
Sets the default log level events are logged at.

Parameters:
value - The new default level events are logged at or null.
See Also:
getDefaultLogLevel()

getLogLevel

public final Level getLogLevel()
Gets the log level of the instance.

Returns:
The log level of the instance.
See Also:
getDefaultLogLevel(), setLogLevel(java.util.logging.Level), isLoggable(java.util.logging.Level)

setLogLevel

public final void setLogLevel(Level value)
Sets the log level of the instance.

Parameters:
value - The new log level of the instance or null.
See Also:
getLogLevel(), isLoggable(java.util.logging.Level)

isLoggable

public boolean isLoggable(Level level)
Checks if a message at a given level is provided to the listeners of the instance.

Parameters:
level - The level to test.
Returns:
true, if messages at level are provided to the listeners of the instance; false, if messages at level are not provided to the listeners of the instance.
Throws:
NullPointerException - if level is null.
See Also:
getLogLevel(), setLogLevel(java.util.logging.Level), log(java.util.logging.Level, java.lang.String, java.lang.Throwable), log(java.lang.ClassLoader, java.util.logging.Level, java.lang.String, java.lang.Throwable)

log

public void log(Level level,
                String message,
                Throwable throwable)
Notifies listeners registered with the class loader of the instance.

Calling this method is the same as calling

 log( getClassLoader( getClass() ), level, message, throwable );

Parameters:
level - The level of the event.
message - The message of the event or null.
throwable - The throwable of the event or null.
Throws:
NullPointerException - if level is null.
See Also:
log(java.lang.ClassLoader, java.util.logging.Level, java.lang.String, java.lang.Throwable)

log

public void log(ClassLoader classLoader,
                Level level,
                String message,
                Throwable throwable)
Notifies listeners registered with a given class loader.

Parameters:
classLoader - The class loader to notify listeners of.
level - The level of the event.
message - The message of the event or null.
throwable - The throwable of the event or null.
Throws:
NullPointerException - if classLoader or level is null.
Since:
1.1

getDefaultModelIdentifier

public static String getDefaultModelIdentifier()
Gets the identifier of the model to search for modules by default.

The identifier of the model to search for modules by default is controlled by system property org.jomc.ri.DefaultObjectManager.defaultModelIdentifier holding the identifier of the model to search for modules by default. If that property is not set, the http://jomc.org/model default is returned.

Returns:
The identifier of the model to search for modules by default.
Since:
1.1
See Also:
getModelIdentifier(), setDefaultModelIdentifier(java.lang.String), ModelObject.MODEL_PUBLIC_ID

setDefaultModelIdentifier

public static void setDefaultModelIdentifier(String value)
Sets the identifier of the model to search for modules by default.

Parameters:
value - The new identifier of the model to search for modules by default or null.
Since:
1.1
See Also:
getDefaultModelIdentifier()

getModelIdentifier

public final String getModelIdentifier()
Gets the identifier of the model to search for modules.

Returns:
The identifier of the model to search for modules.
Since:
1.1
See Also:
getDefaultModelIdentifier(), setModelIdentifier(java.lang.String)

setModelIdentifier

public final void setModelIdentifier(String value)
Sets the identifier of the model to search for modules.

Parameters:
value - The new identifier of the model to search for modules or null.
Since:
1.1

isDefaultModelObjectClasspathResolutionEnabled

public static boolean isDefaultModelObjectClasspathResolutionEnabled()
Gets a flag indicating model object class path resolution is enabled by default.

The default model object class path resolution enabled flag is controlled by system property org.jomc.ri.DefaultObjectManager.defaultModelObjectClasspathResolutionEnabled holding a boolean indicating model object class path resolution is enabled by default. If that property is not set, the true default is returned.

Returns:
true, if model object class path resolution is enabled by default; false, if model object class path resolution is disabled by default.
Since:
1.1
See Also:
isModelObjectClasspathResolutionEnabled(), setDefaultModelObjectClasspathResolutionEnabled(java.lang.Boolean)

setDefaultModelObjectClasspathResolutionEnabled

public static void setDefaultModelObjectClasspathResolutionEnabled(Boolean value)
Sets the flag indicating model object class path resolution is enabled by default.

Parameters:
value - The new value of the flag indicating model object class path resolution is enabled by default or null.
Since:
1.1
See Also:
isDefaultModelObjectClasspathResolutionEnabled()

isModelObjectClasspathResolutionEnabled

public final boolean isModelObjectClasspathResolutionEnabled()
Gets a flag indicating model object class path resolution is enabled.

Returns:
true, if model object class path resolution is enabled; false, if model object class path resolution is disabled.
Since:
1.1
See Also:
isDefaultModelObjectClasspathResolutionEnabled(), setModelObjectClasspathResolutionEnabled(java.lang.Boolean)

setModelObjectClasspathResolutionEnabled

public final void setModelObjectClasspathResolutionEnabled(Boolean value)
Sets the flag indicating model object class path resolution is enabled.

Parameters:
value - The new value of the flag indicating model object class path resolution is enabled or null.
Since:
1.1
See Also:
isModelObjectClasspathResolutionEnabled()

isDefaultModelProcessingEnabled

public static boolean isDefaultModelProcessingEnabled()
Gets a flag indicating model processing is enabled by default.

The default model processing enabled flag is controlled by system property org.jomc.ri.DefaultObjectManager.defaultModelProcessingEnabled holding a boolean indicating model processing is enabled by default. If that property is not set, the true default is returned.

Returns:
true, if model processing is enabled by default; false, if model processing is disabled by default.
Since:
1.1
See Also:
isModelProcessingEnabled(), setDefaultModelProcessingEnabled(java.lang.Boolean)

setDefaultModelProcessingEnabled

public static void setDefaultModelProcessingEnabled(Boolean value)
Sets the flag indicating model processing is enabled by default.

Parameters:
value - The new value of the flag indicating model processing is enabled by default or null.
Since:
1.1
See Also:
isDefaultModelProcessingEnabled()

isModelProcessingEnabled

public final boolean isModelProcessingEnabled()
Gets a flag indicating model processing is enabled.

Returns:
true, if model processing is enabled; false, if model processing is disabled .
Since:
1.1
See Also:
isDefaultModelProcessingEnabled(), setModelProcessingEnabled(java.lang.Boolean)

setModelProcessingEnabled

public final void setModelProcessingEnabled(Boolean value)
Sets the flag indicating model processing is enabled.

Parameters:
value - The new value of the flag indicating model processing is enabled or null.
Since:
1.1
See Also:
isModelProcessingEnabled()

getBootstrapClassLoaderClassName

public static String getBootstrapClassLoaderClassName()
Gets the name of the platform's bootstrap class loader class.

The name of the platform's bootstrap class loader class is controlled by system property org.jomc.ri.DefaultObjectManager.bootstrapClassLoaderClassName holding the name of the platform's bootstrap class loader class. If that property is not set, the bootstrap class loader is assumed to be represented by a null parent class loader.

Returns:
The name of the platform's bootstrap class loader class or null.
See Also:
getClassLoader(java.lang.ClassLoader)

setBootstrapClassLoaderClassName

public static void setBootstrapClassLoaderClassName(String value)
Sets the name of the platform's bootstrap class loader class.

Parameters:
value - The new name of the platform's bootstrap class loader class or null.
See Also:
getBootstrapClassLoaderClassName()

getModules

public Modules getModules(ClassLoader classLoader)
Gets the modules registered with a given class loader.

Parameters:
classLoader - The class loader to get the modules of.
Returns:
The modules of the given class loader.
Throws:
NullPointerException - if classLoader is null.
See Also:
getDefaultModules(), getModelIdentifier(), isModelObjectClasspathResolutionEnabled(), isModelProcessingEnabled(), getRuntimeModules(org.jomc.model.Modules, java.util.Map)

getDefaultModules

public Modules getDefaultModules()
Gets a new default modules instance.

Returns:
A new default modules instance.
Since:
1.1
See Also:
getModules(java.lang.ClassLoader)

getRuntimeModules

public Modules getRuntimeModules(Modules modules,
                                 Map<Object,Instance> objectMap)
Gets a new Modules instance to register with a class loader.

Parameters:
modules - The modules prepared for registration with a class loader.
objectMap - The object map to associate with the given modules.
Returns:
The instance to register with a class loader.
Throws:
NullPointerException - if modules or objectMap is null.
Since:
1.2
See Also:
getModules(java.lang.ClassLoader), RuntimeModules

getDefaultClassLoader

public ClassLoader getDefaultClassLoader(Class<?> clazz)
Gets the class loader of a given class.

Parameters:
clazz - The class whose class loader to get.
Returns:
The class loader of clazz.
Throws:
NullPointerException - if clazz is null.
Since:
1.1

getDefaultClassLoader

public ClassLoader getDefaultClassLoader(ClassLoader classLoader)
Gets the parent class loader of a given class loader recursively.

This method recursively finds the parent class loader of the given class loader. Recursion stops at the platform's bootstrap class loader. That class loader is detected when either the current class loader has no parent (a call to the getParent() method returns null) or when the class name of the current class loader's parent class loader is equal to the name returned by method getBootstrapClassLoaderClassName(). Configuration of the name of the platform's bootstrap class loader class is needed when the platform's getParent() method of the ClassLoader class does not return null to indicate the bootstrap class loader but instead returns an instance of ClassLoader.

Parameters:
classLoader - The class loader whose parent class loader to return or null to return a ClassLoader instance representing the platform's bootstrap class loader.
Returns:
The parent class loader of classLoader.
Throws:
NullPointerException - if classLoader is null.
Since:
1.1
See Also:
getBootstrapClassLoaderClassName(), ClassLoader.getParent()

getClassLoader

@Deprecated
public static ClassLoader getClassLoader(Class<?> clazz)
Deprecated. As of JOMC 1.1, please use method getDefaultClassLoader(java.lang.Class). This method will be removed in version 2.0.

Gets the class loader of a given class.

Parameters:
clazz - The class whose class loader to return.
Returns:
The class loader of clazz.
Throws:
NullPointerException - if clazz is null.

getClassLoader

@Deprecated
public static ClassLoader getClassLoader(ClassLoader classLoader)
Deprecated. As of JOMC 1.1, please use method getDefaultClassLoader(java.lang.ClassLoader). This method will be removed in version 2.0.

Gets the parent class loader of a given class loader recursively.

This method recursively finds the parent class loader of the given class loader. Recursion stops at the platform's bootstrap class loader. That class loader is detected when either the current class loader has no parent (a call to the getParent() method returns null) or when the class name of the current class loader's parent class loader is equal to the name returned by method getBootstrapClassLoaderClassName(). Configuration of the name of the platform's bootstrap class loader class is needed when the platform's getParent() method of the ClassLoader class does not return null to indicate the bootstrap class loader but instead returns an instance of ClassLoader.

Parameters:
classLoader - The class loader whose parent class loader to return or null to return a ClassLoader instance representing the platform's bootstrap class loader.
Returns:
The parent class loader of classLoader.
Throws:
NullPointerException - if classLoader is null.
See Also:
getBootstrapClassLoaderClassName(), ClassLoader.getParent()

getObject

public Object getObject(Scope scope,
                        Instance instance,
                        ClassLoader classLoader)
                 throws InstantiationException
Gets an object of a given instance from a given scope.

Parameters:
scope - The scope to get the object from or null.
instance - The instance of the object to get.
classLoader - The class loader to use for creating the object.
Returns:
An object of instance from scope or null, if no such object is found.
Throws:
NullPointerException - if instance or classLoader is null.
InstantiationException - if creating an object fails.

getObject

public <T> T getObject(Class<T> specification,
                       URI location,
                       ClassLoader classLoader)
            throws InstantiationException,
                   ClassNotFoundException,
                   IOException
Gets an object for a given location URI.

Type Parameters:
T - The type of the object.
Parameters:
specification - The specification class of the object to locate.
location - The location URI of the object to locate.
classLoader - The class loader to use for loading locator classes.
Returns:
An object located at location or null, if no such object is found.
Throws:
NullPointerException - if specification, location or classLoader is null.
InstantiationException - if instantiating a locator fails.
ClassNotFoundException - if the class of specification is not found.
IOException - if locating the object fails.

getScope

public Scope getScope(String identifier,
                      ClassLoader classLoader)
               throws InstantiationException
Gets the scope implementation for a given scope identifier registered with a given class loader.

Parameters:
identifier - The identifier of the scope to get an implementation of.
classLoader - The class loader to use for loading scope implementations.
Returns:
The implementation of the scope identified by identifier or null, if no such scope implementation is found.
Throws:
NullPointerException - if classLoader or identifier is null.
InstantiationException - if instantiating a scope fails.
See Also:
getDefaultScope(java.lang.String)

getDefaultScope

@Deprecated
public Scope getDefaultScope(String identifier)
Deprecated. As of JOMC 1.2, replaced by method getDefaultScope(org.jomc.model.Modules,java.lang.String). This method will be removed in version 2.0.

Gets a new default scope implementation instance for a given identifier.

Parameters:
identifier - The identifier to get a new default scope implementation instance for.
Returns:
A new default scope implementation instance for identifier or null, if no such instance is available.
Throws:
NullPointerException - if identifier is null.
See Also:
getScope(java.lang.String, java.lang.ClassLoader)

getDefaultScope

public Scope getDefaultScope(Modules model,
                             String identifier)
Gets a new default scope implementation instance for a given identifier.

Parameters:
model - The model to get a new default scope implementation instance of.
identifier - The identifier to get a new default scope implementation instance for.
Returns:
A new default scope implementation instance for identifier or null, if no such instance is available.
Throws:
NullPointerException - if model or identifier is null.
See Also:
getScope(java.lang.String, java.lang.ClassLoader)

getLocator

public Locator getLocator(URI location,
                          ClassLoader classLoader)
                   throws InstantiationException
Gets a locator to use with a given location URI registered with a given class loader.

Parameters:
location - The location URI to get a locator for.
classLoader - The class loader to use for loading locator implementations.
Returns:
The locator to use for locating objects at location or null, if no such locator is available.
Throws:
NullPointerException - if classLoader or location is null.
InstantiationException - if instantiating a locator fails.
See Also:
getDefaultLocator(java.net.URI)

getDefaultLocator

@Deprecated
public Locator getDefaultLocator(URI location)
Deprecated. As of JOMC 1.2, replaced by method getDefaultLocator(org.jomc.model.Modules, java.net.URI). This method will be removed in version 2.0.

Gets a new default locator implementation instance for a given location URI.

Parameters:
location - The location URI to get a new default locator implementation instance for.
Returns:
A new default locator implementation instance for location or null, if no such instance is available.
Throws:
NullPointerException - if location is null.
See Also:
getLocator(java.net.URI, java.lang.ClassLoader)

getDefaultLocator

public Locator getDefaultLocator(Modules model,
                                 URI location)
Gets a new default locator implementation instance for a given location URI.

Parameters:
model - The model to get a new default location implementation instance of.
location - The location URI to get a new default locator implementation instance for.
Returns:
A new default locator implementation instance for location or null, if no such instance is available.
Throws:
NullPointerException - if model or location is null.
Since:
1.2
See Also:
getLocator(java.net.URI, java.lang.ClassLoader)

getInvoker

public Invoker getInvoker(ClassLoader classLoader)
                   throws InstantiationException
Gets the invoker registered with a given class loader.

Parameters:
classLoader - The class loader to use for loading invoker implementations.
Returns:
The invoker of the given class loader.
Throws:
NullPointerException - if classLoader is null.
InstantiationException - if instantiating a new invoker fails.
See Also:
getDefaultInvoker()

getDefaultInvoker

@Deprecated
public Invoker getDefaultInvoker()
Deprecated. As of JOMC 1.2, replaced by method getDefaultInvoker(org.jomc.model.Modules). This method will be removed in version 2.0.

Gets a new default invoker implementation instance.

Returns:
A new default invoker implementation instance.
Since:
1.1
See Also:
getInvoker(java.lang.ClassLoader)

getDefaultInvoker

public Invoker getDefaultInvoker(Modules model)
Gets a new default invoker implementation instance.

Parameters:
model - The model to get a new default invoker implementation instance of.
Returns:
A new default invoker implementation instance.
Throws:
NullPointerException - if model is null.
Since:
1.2
See Also:
getInvoker(java.lang.ClassLoader)

getInvocation

@Deprecated
public Invocation getInvocation(Object object,
                                           Instance instance,
                                           Method method,
                                           Object[] arguments)
                         throws InstantiationException
Deprecated. As of JOMC 1.1, please use method getInvocation(java.lang.ClassLoader, java.lang.Object, org.jomc.model.Instance, java.lang.reflect.Method, java.lang.Object[]). This method will be removed in version 2.0.

Gets an invocation for a given object, instance, method and arguments.

Parameters:
object - The object to invoke.
instance - The instance of the object to invoke.
method - The method to invoke on object.
arguments - The arguments of the invocation or null.
Returns:
An invocation with object, instance, method and arguments.
Throws:
NullPointerException - if object, instance or method is null.
InstantiationException - if instantiating a new invocation fails.

getInvocation

public Invocation getInvocation(ClassLoader classLoader,
                                Object object,
                                Instance instance,
                                Method method,
                                Object[] arguments)
                         throws InstantiationException
Gets an invocation for a given class loader, object, instance, method and arguments.

Parameters:
classLoader - The class loader of the invocation.
object - The object to invoke.
instance - The instance of the object to invoke.
method - The method to invoke on object.
arguments - The arguments of the invocation or null.
Returns:
An invocation with classLoader, object, instance, method and arguments.
Throws:
NullPointerException - if classLoader object, instance or method is null.
InstantiationException - if instantiating a new invocation fails.
Since:
1.1
See Also:
getDefaultInvocation()

getDefaultInvocation

@Deprecated
public Invocation getDefaultInvocation()
Deprecated. As of JOMC 1.2, replaced by method getDefaultInvocation(org.jomc.model.Modules). This method will be removed in version 2.0.

Gets a new default invocation implementation instance.

Returns:
A new default invocation implementation instance.
Since:
1.1
See Also:
getInvocation(java.lang.Object, org.jomc.model.Instance, java.lang.reflect.Method, java.lang.Object[])

getDefaultInvocation

public Invocation getDefaultInvocation(Modules model)
Gets a new default invocation implementation instance.

Parameters:
model - The model to get a new default invocation implementation instance of.
Returns:
A new default invocation implementation instance.
Throws:
NullPointerException - if model is null.
Since:
1.2
See Also:
getInvocation(java.lang.Object, org.jomc.model.Instance, java.lang.reflect.Method, java.lang.Object[])

initialize

public void initialize()
                throws InstantiationException
Initializes the instance.

This method is called once on first usage of a new instance.

Throws:
InstantiationException - if initialization fails.


Copyright © 2005-2012 The JOMC Project. All Rights Reserved.Get JOMC at SourceForge.net. Fast, secure and Free Open Source software downloads
Please note that this documentation is maintained by non-native english speaking authors. As such, you may encounter phrases or wordings which seem imprecise or may even have a totally different meaning to native english speaking readers than what the individual author was trying to express. If you are a native english speaking reader and find any such phrases or wordings we kindly ask you to send an email to the corresponding author and help us improve this documentation in order to avoid misunderstandings. You will find the authors' email addresses at the top of each class. Please accept our apologies for any inconvenience caused.