public abstract class AbstractSpringPentahoObjectFactory extends Object implements org.pentaho.platform.api.engine.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 |
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,
org.pentaho.platform.api.engine.IPentahoSession session) |
<T> T |
get(Class<T> interfaceClass,
org.pentaho.platform.api.engine.IPentahoSession session,
Map<String,String> props) |
<T> T |
get(Class<T> interfaceClass,
String key,
org.pentaho.platform.api.engine.IPentahoSession session) |
<T> List<T> |
getAll(Class<T> interfaceClass,
org.pentaho.platform.api.engine.IPentahoSession curSession) |
<T> List<T> |
getAll(Class<T> interfaceClass,
org.pentaho.platform.api.engine.IPentahoSession curSession,
Map<String,String> properties) |
Class |
getImplementingClass(String key) |
String |
getName() |
<T> org.pentaho.platform.api.engine.IPentahoObjectReference<T> |
getObjectReference(Class<T> clazz,
org.pentaho.platform.api.engine.IPentahoSession curSession) |
<T> org.pentaho.platform.api.engine.IPentahoObjectReference<T> |
getObjectReference(Class<T> clazz,
org.pentaho.platform.api.engine.IPentahoSession curSession,
Map<String,String> properties) |
<T> List<org.pentaho.platform.api.engine.IPentahoObjectReference<T>> |
getObjectReferences(Class<T> interfaceClass,
org.pentaho.platform.api.engine.IPentahoSession curSession) |
<T> List<org.pentaho.platform.api.engine.IPentahoObjectReference<T>> |
getObjectReferences(Class<T> interfaceClass,
org.pentaho.platform.api.engine.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,
org.pentaho.platform.api.engine.IPentahoSession session,
Map<String,String> properties) |
protected Object |
retrieveViaSpring(String beanId) |
protected void |
setBeanFactory(org.springframework.context.ConfigurableApplicationContext context) |
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, org.pentaho.platform.api.engine.IPentahoSession session) throws org.pentaho.platform.api.engine.ObjectFactoryException
get
in interface org.pentaho.platform.api.engine.IPentahoObjectFactory
org.pentaho.platform.api.engine.ObjectFactoryException
IPentahoObjectFactory.get(Class, IPentahoSession)
public <T> T get(Class<T> interfaceClass, String key, org.pentaho.platform.api.engine.IPentahoSession session) throws org.pentaho.platform.api.engine.ObjectFactoryException
get
in interface org.pentaho.platform.api.engine.IPentahoObjectFactory
org.pentaho.platform.api.engine.ObjectFactoryException
IPentahoObjectFactory.get(Class, String, IPentahoSession)
public <T> T get(Class<T> interfaceClass, org.pentaho.platform.api.engine.IPentahoSession session, Map<String,String> props) throws org.pentaho.platform.api.engine.ObjectFactoryException
get
in interface org.pentaho.platform.api.engine.IPentahoObjectFactory
org.pentaho.platform.api.engine.ObjectFactoryException
public <T> List<T> getAll(Class<T> interfaceClass, org.pentaho.platform.api.engine.IPentahoSession curSession, Map<String,String> properties) throws org.pentaho.platform.api.engine.ObjectFactoryException
getAll
in interface org.pentaho.platform.api.engine.IPentahoObjectFactory
org.pentaho.platform.api.engine.ObjectFactoryException
public <T> List<T> getAll(Class<T> interfaceClass, org.pentaho.platform.api.engine.IPentahoSession curSession) throws org.pentaho.platform.api.engine.ObjectFactoryException
getAll
in interface org.pentaho.platform.api.engine.IPentahoObjectFactory
org.pentaho.platform.api.engine.ObjectFactoryException
protected Object instanceClass(String simpleName) throws org.pentaho.platform.api.engine.ObjectFactoryException
org.pentaho.platform.api.engine.ObjectFactoryException
protected Object instanceClass(String simpleName, String key) throws org.pentaho.platform.api.engine.ObjectFactoryException
org.pentaho.platform.api.engine.ObjectFactoryException
protected Object instanceClass(Class<?> interfaceClass, String key) throws org.pentaho.platform.api.engine.ObjectFactoryException
org.pentaho.platform.api.engine.ObjectFactoryException
protected Object retrieveViaSpring(String beanId) throws org.pentaho.platform.api.engine.ObjectFactoryException
org.pentaho.platform.api.engine.ObjectFactoryException
protected <T> List<T> retreiveObjects(Class<T> type, org.pentaho.platform.api.engine.IPentahoSession session, Map<String,String> properties) throws org.pentaho.platform.api.engine.ObjectFactoryException
org.pentaho.platform.api.engine.ObjectFactoryException
public boolean objectDefined(String key)
objectDefined
in interface org.pentaho.platform.api.engine.IPentahoObjectFactory
IPentahoObjectFactory.objectDefined(String)
public boolean objectDefined(Class<?> clazz)
objectDefined
in interface org.pentaho.platform.api.engine.IPentahoObjectFactory
clazz
- Interface or class literal to search forpublic Class getImplementingClass(String key)
getImplementingClass
in interface org.pentaho.platform.api.engine.IPentahoObjectFactory
IPentahoObjectFactory.getImplementingClass(String)
protected void setBeanFactory(org.springframework.context.ConfigurableApplicationContext context)
public <T> org.pentaho.platform.api.engine.IPentahoObjectReference<T> getObjectReference(Class<T> clazz, org.pentaho.platform.api.engine.IPentahoSession curSession) throws org.pentaho.platform.api.engine.ObjectFactoryException
getObjectReference
in interface org.pentaho.platform.api.engine.IPentahoObjectFactory
org.pentaho.platform.api.engine.ObjectFactoryException
public <T> org.pentaho.platform.api.engine.IPentahoObjectReference<T> getObjectReference(Class<T> clazz, org.pentaho.platform.api.engine.IPentahoSession curSession, Map<String,String> properties) throws org.pentaho.platform.api.engine.ObjectFactoryException
getObjectReference
in interface org.pentaho.platform.api.engine.IPentahoObjectFactory
org.pentaho.platform.api.engine.ObjectFactoryException
public <T> List<org.pentaho.platform.api.engine.IPentahoObjectReference<T>> getObjectReferences(Class<T> interfaceClass, org.pentaho.platform.api.engine.IPentahoSession curSession) throws org.pentaho.platform.api.engine.ObjectFactoryException
getObjectReferences
in interface org.pentaho.platform.api.engine.IPentahoObjectFactory
org.pentaho.platform.api.engine.ObjectFactoryException
public <T> List<org.pentaho.platform.api.engine.IPentahoObjectReference<T>> getObjectReferences(Class<T> interfaceClass, org.pentaho.platform.api.engine.IPentahoSession curSession, Map<String,String> properties) throws org.pentaho.platform.api.engine.ObjectFactoryException
getObjectReferences
in interface org.pentaho.platform.api.engine.IPentahoObjectFactory
org.pentaho.platform.api.engine.ObjectFactoryException
public String getName()
getName
in interface org.pentaho.platform.api.engine.IPentahoObjectFactory
Copyright © 2019 Hitachi Vantara. All rights reserved.