use of org.pentaho.platform.api.engine.ObjectFactoryException in project pentaho-platform by pentaho.
the class AggregateObjectFactory method get.
@Override
public <T> T get(Class<T> clazz, IPentahoSession session, Map<String, String> properties) throws ObjectFactoryException {
IPentahoObjectReference<T> highestRef = this.getObjectReference(clazz, session, properties);
if (highestRef != null) {
return highestRef.getObject();
}
readLock.lock();
try {
for (IPentahoObjectFactory fact : factories) {
if (fact.objectDefined(clazz.getSimpleName())) {
T object = fact.get(clazz, clazz.getSimpleName(), session);
return object;
}
}
} finally {
readLock.unlock();
}
String msg = Messages.getInstance().getString("AbstractSpringPentahoObjectFactory.WARN_FAILED_TO_RETRIEVE_OBJECT", clazz.getSimpleName());
throw new ObjectFactoryException(msg);
}
use of org.pentaho.platform.api.engine.ObjectFactoryException in project data-access by pentaho.
the class DebugModelerService method getSession.
private IPentahoSession getSession() {
IPentahoSession session = null;
IPentahoObjectFactory pentahoObjectFactory = PentahoSystem.getObjectFactory();
if (pentahoObjectFactory != null) {
try {
// $NON-NLS-1$
session = pentahoObjectFactory.get(IPentahoSession.class, "systemStartupSession", null);
} catch (ObjectFactoryException e) {
e.printStackTrace();
}
}
return session;
}
Aggregations