|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.pentaho.test.platform.engine.core.SimpleObjectFactory
public class SimpleObjectFactory
Constructor Summary | |
---|---|
SimpleObjectFactory()
|
Method Summary | ||
---|---|---|
void |
defineObject(String key,
String classname)
Register an object for creation. |
|
|
get(Class<T> interfaceClass,
IPentahoSession session)
Retrieves an instance of a Pentaho BI Server API interface using the simple interface name (interfaceClass name without the package) as the object key. |
|
|
get(Class<T> interfaceClass,
String key,
IPentahoSession session)
Retrieves an instance of a Pentaho BI Server API interface by the given object key. |
|
Class<?> |
getImplementingClass(String key)
Provides the concrete Class defined for the given object key. |
|
void |
init(String configFile,
Object context)
Initialize the factory with optional configuration file and runtime context. |
|
boolean |
objectDefined(String key)
Checks if the implementation for the given interface is defined. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleObjectFactory()
Method Detail |
---|
public <T> T get(Class<T> interfaceClass, IPentahoSession session) throws ObjectFactoryException
IPentahoObjectFactory
get
in interface IPentahoObjectFactory
interfaceClass
- the type of object to retrieve (retrieved object will be
returned as this type)session
- the Pentaho session object. Can be used to associate an object
instance to a Pentaho session. Value will be null if request to getObject
does not originate in a session context.
ObjectFactoryException
- if the object cannot be retrievedpublic <T> T get(Class<T> interfaceClass, String key, IPentahoSession session) throws ObjectFactoryException
IPentahoObjectFactory
get
in interface IPentahoObjectFactory
interfaceClass
- the type of object to retrieve (retrieved object will be
returned as this type)key
- the object identifier, typically the interface namesession
- the Pentaho session object. Can be used to associate an object
instance to a Pentaho session. Value will be null if request to getObject
does not originate in a session context.
ObjectFactoryException
- if the object cannot be retrievedpublic Class<?> getImplementingClass(String key)
IPentahoObjectFactory
getImplementingClass
in interface IPentahoObjectFactory
key
- the object identifier, typically the interface name
public void init(String configFile, Object context)
IPentahoObjectFactory
init
in interface IPentahoObjectFactory
configFile
- an object configuration definition file understandable by the
factory implementationcontext
- a context object whereby the factory implementation can access
runtime information, type of object varies depending on the framework
used by the factory and the environment in which the application is running.public boolean objectDefined(String key)
IPentahoObjectFactory
objectDefined
in interface IPentahoObjectFactory
key
- the object identifier, typically the interface name
public void defineObject(String key, String classname)
key
- identifying stringclassname
- must be a fully qualified class name for a top-level or nested top-level (static inner) class
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |