|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IPentahoObjectFactory
The way the BI platform creates and manages system objects.
Here is an example of how the API might be used:
1. IPentahoObjectFactory fac = new MyPentahoObjectFactory();
//configure the factory with an object specification file and/or a runtime context object
2. fac.init(objectSpecFile, contextObject) init(String, Object)
3. ISolutionEngine eng = fac.get(ISolutionEngine.class, session) get(Class, IPentahoSession)
You will notice that the this way of serving up objects does not expose an API for scoping of objects.
This behavior is delegated to the particular IPentahoObjectFactory
implementation, which means a factory
implementation has total freedom to be as simple or sophisticated at it wants without being required to handle object
scoping. Any kind of object binding/scoping or any other rules for the creation and management of objects is totally
up the implementation. Typically, a factory implementation would be made aware of it's rules for object creation by
way of a well-known object specification file, see init(String, Object)
Method Summary | ||
---|---|---|
|
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. |
|
Object |
getObject(String key,
IPentahoSession session)
Deprecated. |
|
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. |
Method Detail |
---|
<T> T get(Class<T> interfaceClass, IPentahoSession session) throws ObjectFactoryException
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 retrieved<T> T get(Class<T> interfaceClass, String key, IPentahoSession session) throws ObjectFactoryException
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 retrievedObject getObject(String key, IPentahoSession session) throws ObjectFactoryException
get(Class, IPentahoSession)
or get(Class, String, IPentahoSession)
ObjectFactoryException
boolean objectDefined(String key)
key
- the object identifier, typically the interface name
Class getImplementingClass(String key)
key
- the object identifier, typically the interface name
void init(String configFile, Object context)
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |