use of org.pentaho.platform.engine.core.system.StandaloneApplicationContext in project pentaho-platform by pentaho.
the class HttpWebServiceIT method setUp.
public void setUp() {
// $NON-NLS-1$
StandaloneApplicationContext applicationContext = new StandaloneApplicationContext(getSolutionPath(), "");
PentahoSystem.init(applicationContext, getRequiredListeners());
}
use of org.pentaho.platform.engine.core.system.StandaloneApplicationContext in project data-access by pentaho.
the class CsvTransformGeneratorIT method init.
private void init() {
if (!PentahoSystem.getInitializedOK()) {
// $NON-NLS-1$
IApplicationContext context = new StandaloneApplicationContext(SOLUTION_PATH, ".");
PentahoSystem.init(context);
}
}
use of org.pentaho.platform.engine.core.system.StandaloneApplicationContext in project data-access by pentaho.
the class PentahoSystemHelper method init.
public static void init() {
if (PentahoSystem.getInitializedOK()) {
return;
}
try {
PentahoSystem.setSystemSettingsService(new PathBasedSystemSettings());
if (PentahoSystem.getApplicationContext() == null) {
StandaloneApplicationContext applicationContext = // $NON-NLS-1$
new StandaloneApplicationContext(getSolutionPath(), "");
// set the base url assuming there is a running server on port 8080
if (PentahoRequestContextHolder.getRequestContext() != null) {
applicationContext.setFullyQualifiedServerURL(PentahoRequestContextHolder.getRequestContext().getContextPath());
}
// $NON-NLS-1$ //$NON-NLS-2$
String inContainer = System.getProperty("incontainer", "false");
if (inContainer.equalsIgnoreCase("false")) {
// $NON-NLS-1$
// Setup simple-jndi for datasources
System.setProperty("java.naming.factory.initial", // $NON-NLS-1$ //$NON-NLS-2$
"org.osjava.sj.SimpleContextFactory");
System.setProperty("org.osjava.sj.root", // $NON-NLS-1$ //$NON-NLS-2$
getSolutionPath() + "/system/simple-jndi");
// $NON-NLS-1$ //$NON-NLS-2$
System.setProperty("org.osjava.sj.delimiter", "/");
}
ApplicationContext springApplicationContext = getSpringApplicationContext();
IPentahoObjectFactory pentahoObjectFactory = new StandaloneSpringPentahoObjectFactory();
pentahoObjectFactory.init(null, springApplicationContext);
PentahoSystem.registerObjectFactory(pentahoObjectFactory);
// force Spring to inject PentahoSystem, there has got to be a better way than this,
// perhaps an alternate way of initting spring's app context
// $NON-NLS-1$
springApplicationContext.getBean("pentahoSystemProxy");
PentahoSystem.init(applicationContext);
}
} catch (Exception e) {
logger.error(e);
}
}
Aggregations