org.jomc
Interface ObjectManager

Package class diagram package ObjectManager

@Generated(value="org.jomc.tools.SourceFileProcessor 1.2",
           comments="See http://jomc.sourceforge.net/jomc/1.2/jomc-tools-1.2")
public interface ObjectManager

Manages objects.

Identifier:
org.jomc.ObjectManager
Multiplicity:
One
Scope:
Singleton

Version:
1.0
Author:
Christian Schulte 1.0
See Also:
getObject(ObjectManager.class), getObject(ObjectManager.class, "implementation name"), ObjectManagerFactory

Method Summary
 Object getDependency(Object object, String dependencyName)
          Gets an instance of a dependency of an object.
 String getMessage(Object object, String messageName, Locale locale, Object... arguments)
          Gets an instance of a message of an object.
<T> T
getObject(Class<T> specification)
          Gets an instance of an implementation of a specification.
<T> T
getObject(Class<T> specification, String implementationName)
          Gets an instance of an implementation of a specification.
 Object getProperty(Object object, String propertyName)
          Gets an instance of a property of an object.
 

Method Detail

getObject

<T> T getObject(Class<T> specification)
            throws NullPointerException,
                   ObjectManagementException
Gets an instance of an implementation of a specification.

Note:
Implementations must use the class loader associated with the given class as returned by method specification.getClassLoader() for loading classes. Only if that method returns null, indicating the class has been loaded by the bootstrap class loader, use of the bootstrap class loader is recommended.

Type Parameters:
T - The type of the instance.
Parameters:
specification - The specification class to return an implementation instance of.
Returns:
An instance of an implementation of the specification class specification or null, if no such instance is available.
Throws:
NullPointerException - if specification is null.
ObjectManagementException - if getting the object fails.

getObject

<T> T getObject(Class<T> specification,
                String implementationName)
            throws NullPointerException,
                   ObjectManagementException
Gets an instance of an implementation of a specification.

Note:
Implementations must use the class loader associated with the given class as returned by method specification.getClassLoader() for loading classes. Only if that method returns null, indicating the class has been loaded by the bootstrap class loader, use of the bootstrap class loader is recommended.

Type Parameters:
T - The type of the instance.
Parameters:
specification - The specification class to return an implementation instance of.
implementationName - The name of the implementation to return an instance of.
Returns:
An instance of the implementation named implementationName of the specification class specification or null, if no such instance is available.
Throws:
NullPointerException - if specification or implementationName is null.
ObjectManagementException - if getting the object fails.

getDependency

Object getDependency(Object object,
                     String dependencyName)
                     throws NullPointerException,
                            ObjectManagementException
Gets an instance of a dependency of an object.

Note:
Implementations must use the class loader associated with the class of the given object as returned by method object.getClass().getClassLoader() for loading classes. Only if that method returns null, indicating the class has been loaded by the bootstrap class loader, use of the bootstrap class loader is recommended.

Parameters:
object - The object to return a dependency instance of.
dependencyName - The name of the dependency of object to return an instance of.
Returns:
An instance of the dependency named dependencyName of object or null, if no such instance is available.
Throws:
NullPointerException - if object or dependencyName is null.
ObjectManagementException - if getting the dependency instance fails.

getProperty

Object getProperty(Object object,
                   String propertyName)
                   throws NullPointerException,
                          ObjectManagementException
Gets an instance of a property of an object.

Note:
Implementations must use the class loader associated with the class of the given object as returned by method object.getClass().getClassLoader() for loading classes. Only if that method returns null, indicating the class has been loaded by the bootstrap class loader, use of the bootstrap class loader is recommended.

Parameters:
object - The object to return a property instance of.
propertyName - The name of the property of object to return an instance of.
Returns:
An instance of the property named propertyName of object or null, if no such instance is available.
Throws:
NullPointerException - if object or propertyName is null.
ObjectManagementException - if getting the property instance fails.

getMessage

String getMessage(Object object,
                  String messageName,
                  Locale locale,
                  Object... arguments)
                  throws NullPointerException,
                         ObjectManagementException
Gets an instance of a message of an object.

Note:
Implementations must use the class loader associated with the class of the given object as returned by method object.getClass().getClassLoader() for loading classes. Only if that method returns null, indicating the class has been loaded by the bootstrap class loader, use of the bootstrap class loader is recommended.

Parameters:
object - The object to return a message instance of.
messageName - The name of the message of object to return an instance of.
locale - The locale of the message instance to return.
arguments - Arguments to format the message instance with.
Returns:
An instance of the message named messageName of object formatted with arguments for locale or null, if no such instance is available.
Throws:
NullPointerException - if object, messageName or locale is null.
ObjectManagementException - if getting the message instance 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.