|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object mondrian.util.ObjectFactory<T> mondrian.util.ObjectFactory.Singleton<T>
public abstract static class ObjectFactory.Singleton<T>
Implementation of ObjectFactory that returns only a single instance of the Object.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class mondrian.util.ObjectFactory |
---|
ObjectFactory.Context, ObjectFactory.Singleton<T> |
Field Summary | |
---|---|
protected T |
singleInstance
The single instance of the object created by the factory. |
protected T |
testSingleInstance
The test single instance of the object created by the factory. |
Constructor Summary | |
---|---|
protected |
ObjectFactory.Singleton(Class<T> interfaceClass)
Creates a new singleton factory object. |
Method Summary | |
---|---|
protected T |
getObject(Properties props,
Class[] parameterTypes,
Object[] parameterValues)
Returns the singleton Object. |
protected T |
getTestObject(String className,
Class[] parameterTypes,
Object[] parameterValues)
Create an instance for test purposes. |
Methods inherited from class mondrian.util.ObjectFactory |
---|
defaultCreationException, getClassName, getClassName, getDefault, getObject, getObject, getObject, getObject, getStringProperty, removeContext, restoreContext |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected T singleInstance
protected T testSingleInstance
testSingleInstance
does not change the
current value of the singleInstance
variable.
Constructor Detail |
---|
protected ObjectFactory.Singleton(Class<T> interfaceClass)
interfaceClass
parameter
is used to cast the object generated to type right type.
interfaceClass
- the class object for the interface implemented
by the objects returned by this factoryMethod Detail |
---|
protected T getObject(Properties props, Class[] parameterTypes, Object[] parameterValues) throws CreationException
parameterTypes
and
parameterValues
are constructor parameters and
Properties parameter is used to look up a class name.
This returns a same instance of the Object each time its
called except if the getClassName
method
returns a non-null class name which should only
happen as needed for unit testing.
getObject
in class ObjectFactory<T>
CreationException
- if unable to create the objectprops
- the property definitions to use to determine theparameterTypes
- the class parameters that define the signature
of the constructor to useparameterValues
- the values to use to construct the current
instance of the object
protected T getTestObject(String className, Class[] parameterTypes, Object[] parameterValues) throws CreationException
CreationException
- if unable to create the objectclassName
- the class name used to create Object instanceparameterTypes
- the class parameters that define the signature
of the constructor to useparameterValues
- the values to use to construct the current
instance of the object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |