public abstract class AbstractSpringPentahoObjectFactory extends Object implements IPentahoObjectFactory
ApplicationContext
.
A note on creation and management of objects: Object creation and scoping is handled by Spring with one exception: in
the case of a StandaloneSession
. Spring's session scope relates a bean to an javax.servlet.http.HttpSession,
and as such it does not know about custom sessions. The correct approach to solve this problem is to write a custom
Spring scope (called something like "pentahosession"). Unfortunately, we cannot implement a custom scope to handle
the StandaloneSession
because the custom scope would not be able to access it. There is currently no way to
statically obtain a reference to a pentaho session. So we are left with using custom logic in this factory to execute
a different non-Spring logic path when the IPentahoSession is of type StandaloneSession.
IPentahoObjectFactory
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractSpringPentahoObjectFactory.BeanDefinitionNamePair
Struct class used internally to maintain a mapping between bean name and definition
|
protected class |
AbstractSpringPentahoObjectFactory.BeanDefinitionPriorityComparitor
Used to order the lists of implementations based on their priority
|
Modifier and Type | Field and Description |
---|---|
protected org.springframework.context.ConfigurableApplicationContext |
beanFactory |
protected static org.apache.commons.logging.Log |
logger |
protected static String |
PRIORITY |
DEFAULT_PRIORTIY
Modifier | Constructor and Description |
---|---|
protected |
AbstractSpringPentahoObjectFactory() |
protected |
AbstractSpringPentahoObjectFactory(String name) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
<T> T |
get(Class<T> interfaceClass,
IPentahoSession session) |
<T> T |
get(Class<T> interfaceClass,
IPentahoSession session,
Map<String,String> props) |
<T> T |
get(Class<T> interfaceClass,
String key,
IPentahoSession session) |
<T> List<T> |
getAll(Class<T> interfaceClass,
IPentahoSession curSession) |
<T> List<T> |
getAll(Class<T> interfaceClass,
IPentahoSession curSession,
Map<String,String> properties) |
Class |
getImplementingClass(String key) |
String |
getName() |
<T> IPentahoObjectReference<T> |
getObjectReference(Class<T> clazz,
IPentahoSession curSession) |
<T> IPentahoObjectReference<T> |
getObjectReference(Class<T> clazz,
IPentahoSession curSession,
Map<String,String> properties) |
<T> List<IPentahoObjectReference<T>> |
getObjectReferences(Class<T> interfaceClass,
IPentahoSession curSession) |
<T> List<IPentahoObjectReference<T>> |
getObjectReferences(Class<T> interfaceClass,
IPentahoSession curSession,
Map<String,String> properties) |
int |
hashCode() |
protected Object |
instanceClass(Class<?> interfaceClass,
String key) |
protected Object |
instanceClass(String simpleName) |
protected Object |
instanceClass(String simpleName,
String key) |
boolean |
objectDefined(Class<?> clazz) |
boolean |
objectDefined(String key) |
protected <T> List<T> |
retreiveObjects(Class<T> type,
IPentahoSession session,
Map<String,String> properties) |
protected Object |
retrieveViaSpring(String beanId) |
protected void |
setBeanFactory(org.springframework.context.ConfigurableApplicationContext context) |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
init
protected org.springframework.context.ConfigurableApplicationContext beanFactory
protected static final org.apache.commons.logging.Log logger
protected static final String PRIORITY
protected AbstractSpringPentahoObjectFactory()
protected AbstractSpringPentahoObjectFactory(String name)
public <T> T get(Class<T> interfaceClass, IPentahoSession session) throws ObjectFactoryException
get
in interface IPentahoObjectFactory
ObjectFactoryException
IPentahoObjectFactory.get(Class, IPentahoSession)
public <T> T get(Class<T> interfaceClass, String key, IPentahoSession session) throws ObjectFactoryException
get
in interface IPentahoObjectFactory
ObjectFactoryException
IPentahoObjectFactory.get(Class, String, IPentahoSession)
public <T> T get(Class<T> interfaceClass, IPentahoSession session, Map<String,String> props) throws ObjectFactoryException
get
in interface IPentahoObjectFactory
ObjectFactoryException
public <T> List<T> getAll(Class<T> interfaceClass, IPentahoSession curSession, Map<String,String> properties) throws ObjectFactoryException
getAll
in interface IPentahoObjectFactory
ObjectFactoryException
public <T> List<T> getAll(Class<T> interfaceClass, IPentahoSession curSession) throws ObjectFactoryException
getAll
in interface IPentahoObjectFactory
ObjectFactoryException
protected Object instanceClass(String simpleName) throws ObjectFactoryException
ObjectFactoryException
protected Object instanceClass(String simpleName, String key) throws ObjectFactoryException
ObjectFactoryException
protected Object instanceClass(Class<?> interfaceClass, String key) throws ObjectFactoryException
ObjectFactoryException
protected Object retrieveViaSpring(String beanId) throws ObjectFactoryException
ObjectFactoryException
protected <T> List<T> retreiveObjects(Class<T> type, IPentahoSession session, Map<String,String> properties) throws ObjectFactoryException
ObjectFactoryException
public boolean objectDefined(String key)
objectDefined
in interface IPentahoObjectFactory
IPentahoObjectFactory.objectDefined(String)
public boolean objectDefined(Class<?> clazz)
objectDefined
in interface IPentahoObjectFactory
clazz
- Interface or class literal to search forpublic Class getImplementingClass(String key)
getImplementingClass
in interface IPentahoObjectFactory
IPentahoObjectFactory.getImplementingClass(String)
protected void setBeanFactory(org.springframework.context.ConfigurableApplicationContext context)
public <T> IPentahoObjectReference<T> getObjectReference(Class<T> clazz, IPentahoSession curSession) throws ObjectFactoryException
getObjectReference
in interface IPentahoObjectFactory
ObjectFactoryException
public <T> IPentahoObjectReference<T> getObjectReference(Class<T> clazz, IPentahoSession curSession, Map<String,String> properties) throws ObjectFactoryException
getObjectReference
in interface IPentahoObjectFactory
ObjectFactoryException
public <T> List<IPentahoObjectReference<T>> getObjectReferences(Class<T> interfaceClass, IPentahoSession curSession) throws ObjectFactoryException
getObjectReferences
in interface IPentahoObjectFactory
ObjectFactoryException
public <T> List<IPentahoObjectReference<T>> getObjectReferences(Class<T> interfaceClass, IPentahoSession curSession, Map<String,String> properties) throws ObjectFactoryException
getObjectReferences
in interface IPentahoObjectFactory
ObjectFactoryException
public String getName()
getName
in interface IPentahoObjectFactory
Copyright © 2017 Hitachi Vantara. All rights reserved.