|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@Generated(value="org.jomc.tools.JavaSources", comments="See http://jomc.sourceforge.net/jomc/1.0-alpha-11/jomc-tools") public interface ObjectManager
Manages objects.
This specification declares a multiplicity of One
.
An application assembler is required to provide no more than one implementation of this specification (including none).
Use of class ObjectManager
is supported for getting that implementation.
ObjectManager object = (ObjectManager) ObjectManagerFactory.getObjectManager( getClassLoader() ).getObject( ObjectManager.class );
This specification applies to Singleton
scope. The same singleton object is returned whenever requested.
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. |
|
Object |
getObject(Class specification)
Gets an instance of an implementation of a specification. |
|
|
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 |
---|
Object getObject(Class specification) throws NullPointerException, ObjectManagementException
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.
specification
- The specification class to return an implementation instance of.
specification
or null
if
no such instance is available.
NullPointerException
- if specification
is null
.
ObjectManagementException
- if getting the object fails.<T> T getObject(Class<T> specification, String implementationName) throws NullPointerException, ObjectManagementException
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.
T
- The type of the instance.specification
- The specification class to return an implementation instance of.implementationName
- The name of the implementation to return an instance of.
implementationName
of the specification class
specification
or null
if no such instance is available.
NullPointerException
- if specification
or implementationName
is null
.
ObjectManagementException
- if getting the object fails.Object getDependency(Object object, String dependencyName) throws NullPointerException, ObjectManagementException
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.
object
- The object to return a dependency instance of.dependencyName
- The name of the dependency of object
to return an instance of.
dependencyName
of object
or null
if no such
instance is available.
NullPointerException
- if object
or dependencyName
is null
.
ObjectManagementException
- if getting the dependency instance fails.Object getProperty(Object object, String propertyName) throws NullPointerException, ObjectManagementException
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.
object
- The object to return a property instance of.propertyName
- The name of the property of object
to return an instance of.
propertyName
of object
or null
if no such
instance is available.
NullPointerException
- if object
or propertyName
is null
.
ObjectManagementException
- if getting the property instance fails.String getMessage(Object object, String messageName, Locale locale, Object arguments) throws NullPointerException, ObjectManagementException
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.
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 or null
.
messageName
of object
formatted with arguments
for locale
or null
if no such instance is available.
NullPointerException
- if object
, messageName
or locale
is null
.
ObjectManagementException
- if getting the message instance fails.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |