public class PentahoSystemBoot extends Object
PentahoSystemBoot
is a
self-contained and very easy to configure platform initializer which does not impose the use of configuration
files on your filesystem. A booter instance gives you the flexibility to configure and run the platform entirely
in memory.
In general you will want to
PentahoSystemBoot
define(Class, Class)
variants
start()
@Before public void init() { PentahoSystemBoot booter = new PentahoSystemBoot(); // setup your required object definitions booter.define( IUnifiedRepository.class, DefaultUnifiedRepository.class ); // initialize the minimal platform booter.init(); }
Constructor and Description |
---|
PentahoSystemBoot()
Creates a minimal ready-to-run platform.
|
PentahoSystemBoot(String solutionPath)
Creates a minimal ready-to-run platform with a specified solution path.
|
PentahoSystemBoot(String solutionPath,
org.pentaho.platform.api.engine.IPentahoDefinableObjectFactory factory) |
PentahoSystemBoot(String solutionPath,
String fullyQualifiedServerUrl) |
PentahoSystemBoot(String solutionPath,
String fullyQualifiedServerUrl,
org.pentaho.platform.api.engine.IPentahoDefinableObjectFactory factory) |
Modifier and Type | Method and Description |
---|---|
void |
addAdminAction(org.pentaho.platform.api.engine.IPentahoPublisher adminAction)
Adds an administrative action to the system.
|
void |
addLifecycleListener(org.pentaho.platform.api.engine.IPentahoSystemListener lifecycleListener)
Adds a lifecycle listener.
|
void |
addStartupAction(org.pentaho.platform.api.engine.ISessionStartupAction startupAction)
Adds a strtup action to the system.
|
protected void |
configure(String userFilePath,
String userFullyQualifiedServerUrl,
org.pentaho.platform.api.engine.IPentahoDefinableObjectFactory userFactory)
Configures this booter to run.
|
protected org.pentaho.platform.api.engine.IApplicationContext |
createApplicationContext()
Override this method if you want to change the type and state of the application context used to initialize
the system.
|
PentahoSystemBoot |
define(Class<?> interfaceClass,
Class<?> implClass)
Define a locally scoped object (aka prototype scope -- unique instance for each request for the class)
|
PentahoSystemBoot |
define(Class<?> interfaceClass,
Class<?> implClass,
org.pentaho.platform.api.engine.IPentahoDefinableObjectFactory.Scope scope)
Define an arbitrarily scoped object
|
PentahoSystemBoot |
define(String key,
Class<?> implClass)
Define a locally scoped object (aka prototype scope -- unique instance for each request for the class)
|
PentahoSystemBoot |
define(String key,
Class<?> implClass,
org.pentaho.platform.api.engine.IPentahoDefinableObjectFactory.Scope scope)
Define an arbitrarily scoped object
|
PentahoSystemBoot |
define(String key,
Object instance)
Hold an object instance by key name.
|
PentahoSystemBoot |
define(String key,
String implClassName,
org.pentaho.platform.api.engine.IPentahoDefinableObjectFactory.Scope scope)
Define an arbitrarily scoped object
|
org.pentaho.platform.api.engine.IPentahoObjectFactory |
getFactory()
Gets the object factory for the Pentaho platform
|
String |
getFilePath()
Sets the file path that will be used to get to file-based resources
|
List<org.pentaho.platform.api.engine.IPentahoSystemListener> |
getLifecycleListeners()
Returns the list of lifecycle listeners that will be used.
|
org.pentaho.platform.api.engine.ISystemSettings |
getSettingsProvider()
Gets the system settings object that will be used by the Pentaho platform
|
List<org.pentaho.platform.api.engine.ISessionStartupAction> |
getStartupActions()
Returns the list of startup actions.
|
void |
init()
Deprecated.
use
start() . This method is hanging around for backward compatibility with MicroPlatform |
boolean |
isInitialized()
Returns true if the Pentaho platform has initialized successfully.
|
void |
setAdminActions(List<org.pentaho.platform.api.engine.IPentahoPublisher> adminActions) |
void |
setFactory(org.pentaho.platform.api.engine.IPentahoObjectFactory factory)
Sets the object factory for the Pentaho platform, This defaults to the StandaloneObjectFactory
|
void |
setFilePath(String filePath)
Sets the file path to be used to find configuration and content files If this is not set the current directory
(.) is used.
|
void |
setFullyQualifiedServerUrl(String fullyQualifiedServerUrl)
Sets the URL that the platform uses to generate paths to its own resources
|
void |
setLifecycleListeners(List<org.pentaho.platform.api.engine.IPentahoSystemListener> lifecycleListeners)
Returns the list of lifecycle listeners that will be used.
|
void |
setSettingsProvider(org.pentaho.platform.api.engine.ISystemSettings settingsProvider)
Sets the system settings object that will be used by the Pentaho platform
|
void |
setStartupActions(List<org.pentaho.platform.api.engine.ISessionStartupAction> startupActions)
Sets the list of startup actions These actions will be executed on system startup or on session creation.
|
boolean |
start()
Starts the Pentaho platform, making it ready to process requests.
|
boolean |
stop()
Stops the Pentaho platform
|
public PentahoSystemBoot()
public PentahoSystemBoot(String solutionPath)
solutionPath
- full path to the pentaho_solutions folderpublic PentahoSystemBoot(String solutionPath, org.pentaho.platform.api.engine.IPentahoDefinableObjectFactory factory)
protected void configure(String userFilePath, String userFullyQualifiedServerUrl, org.pentaho.platform.api.engine.IPentahoDefinableObjectFactory userFactory)
null
will be set with default values. The
default values are as follows:
public String getFilePath()
public void setFilePath(String filePath)
filePath
- public void setFullyQualifiedServerUrl(String fullyQualifiedServerUrl)
baseUrl
- protected org.pentaho.platform.api.engine.IApplicationContext createApplicationContext()
public void init()
start()
. This method is hanging around for backward compatibility with MicroPlatformpublic boolean start() throws PlatformInitializationException
PlatformInitializationException
- if there was a problem initializing the platformpublic boolean stop()
public org.pentaho.platform.api.engine.IPentahoObjectFactory getFactory()
public void setFactory(org.pentaho.platform.api.engine.IPentahoObjectFactory factory)
public void addAdminAction(org.pentaho.platform.api.engine.IPentahoPublisher adminAction)
adminAction
- public void setAdminActions(List<org.pentaho.platform.api.engine.IPentahoPublisher> adminActions)
public void addLifecycleListener(org.pentaho.platform.api.engine.IPentahoSystemListener lifecycleListener)
lifecycleListener
- public List<org.pentaho.platform.api.engine.IPentahoSystemListener> getLifecycleListeners()
public void setLifecycleListeners(List<org.pentaho.platform.api.engine.IPentahoSystemListener> lifecycleListeners)
public org.pentaho.platform.api.engine.ISystemSettings getSettingsProvider()
public void setSettingsProvider(org.pentaho.platform.api.engine.ISystemSettings settingsProvider)
public boolean isInitialized()
public List<org.pentaho.platform.api.engine.ISessionStartupAction> getStartupActions()
public void setStartupActions(List<org.pentaho.platform.api.engine.ISessionStartupAction> startupActions)
startupActions
- public void addStartupAction(org.pentaho.platform.api.engine.ISessionStartupAction startupAction)
startupAction
- public PentahoSystemBoot define(String key, String implClassName, org.pentaho.platform.api.engine.IPentahoDefinableObjectFactory.Scope scope)
key
- the key to retrieval of this objectimplClassName
- the actual type that is served back to you when requested.scope
- the scope of the objectPentahoSystemBoot
instance, for chainingNoSuchMethodError
- if the object factory does not support runtime object definitionpublic PentahoSystemBoot define(Class<?> interfaceClass, Class<?> implClass, org.pentaho.platform.api.engine.IPentahoDefinableObjectFactory.Scope scope)
interfaceClass
- the key to retrieval of this objectimplClass
- the actual type that is served back to you when requested.scope
- the scope of the objectPentahoSystemBoot
instance, for chainingNoSuchMethodError
- if the object factory does not support runtime object definitionpublic PentahoSystemBoot define(String key, Class<?> implClass, org.pentaho.platform.api.engine.IPentahoDefinableObjectFactory.Scope scope)
key
- the key to retrieval of this objectimplClass
- the actual type that is served back to you when requested.scope
- the scope of the objectPentahoSystemBoot
instance, for chainingNoSuchMethodError
- if the object factory does not support runtime object definitionpublic PentahoSystemBoot define(Class<?> interfaceClass, Class<?> implClass)
interfaceClass
- the key to retrieval of this objectimplClass
- the actual type that is served back to you when requested.public PentahoSystemBoot define(String key, Class<?> implClass)
key
- the key to retrieval of this objectimplClass
- the actual type that is served back to you when requested.public PentahoSystemBoot define(String key, Object instance)
key
- the key to retrieval of this objectinstance
- the actual instance that is served back to you when requested.Copyright © 2019 Hitachi Vantara. All rights reserved.