|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.pentaho.platform.engine.core.system.objfac.StandaloneObjectFactory
public class StandaloneObjectFactory
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.pentaho.platform.api.engine.IPentahoDefinableObjectFactory |
---|
IPentahoDefinableObjectFactory.Scope |
Constructor Summary | |
---|---|
StandaloneObjectFactory()
|
Method Summary | ||
---|---|---|
void |
defineObject(String key,
String className,
IPentahoDefinableObjectFactory.Scope scope)
Defines a new object. |
|
void |
defineObject(String key,
String className,
IPentahoDefinableObjectFactory.Scope scope,
ClassLoader loader)
Defines a new object that must be loaded with a specific classloader |
|
|
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 arg0,
Object arg1)
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 StandaloneObjectFactory()
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 arg0, Object arg1)
IPentahoObjectFactory
init
in interface IPentahoObjectFactory
arg0
- an object configuration definition file understandable by the
factory implementationarg1
- 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, IPentahoDefinableObjectFactory.Scope scope)
IPentahoDefinableObjectFactory
defineObject
in interface IPentahoDefinableObjectFactory
key
- - typically the interface nameclassName
- - the name of the class to instatiatescope
- - the scope of the objectpublic void defineObject(String key, String className, IPentahoDefinableObjectFactory.Scope scope, ClassLoader loader)
IPentahoDefinableObjectFactory
defineObject
in interface IPentahoDefinableObjectFactory
key
- - typically the interface nameclassName
- - the name of the class to instatiatescope
- - the scope of the objectloader
- - the loader to be used to create the class
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |