Class PentahoSystem
- java.lang.Object
-
- org.pentaho.platform.engine.core.system.PentahoSystem
-
public class PentahoSystem extends Object
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description PentahoSystem()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static void
addInitializationFailureMessage(int failureBit, String message)
static void
addLogoutListener(org.pentaho.platform.api.engine.ILogoutListener listener)
static void
clearGlobals()
static void
clearObjectFactory()
static Object
createObject(String className)
Deprecated.static Object
createObject(String className, org.pentaho.platform.api.engine.ILogger logger)
Deprecated.static boolean
deregisterObjectFactory(org.pentaho.platform.api.engine.IPentahoObjectFactory factory)
De-Register an ObjectFactorystatic <T> T
get(Class<T> interfaceClass)
A convenience method for retrieving Pentaho system objects from the object factory.static <T> T
get(Class<T> interfaceClass, String key, org.pentaho.platform.api.engine.IPentahoSession session)
A convenience method for retrieving Pentaho system objects from the object factory.static <T> T
get(Class<T> interfaceClass, org.pentaho.platform.api.engine.IPentahoSession session)
A convenience method for retrieving Pentaho system objects from the object factory implementing or extending the given Class literalstatic <T> T
get(Class<T> interfaceClass, org.pentaho.platform.api.engine.IPentahoSession session, Map<String,String> properties)
A convenience method for retrieving Pentaho system objects from the object factory.static List
getACLFileExtensionList()
static <T> List<T>
getAll(Class<T> interfaceClass)
A convenience method for retrieving Pentaho system objects from the object factory.static <T> List<T>
getAll(Class<T> interfaceClass, org.pentaho.platform.api.engine.IPentahoSession session)
A convenience method for retrieving Pentaho system objects from the object factory.static <T> List<T>
getAll(Class<T> interfaceClass, org.pentaho.platform.api.engine.IPentahoSession session, Map<String,String> props)
Retrieves objects from the object factory registered to the PentahoSystem implementing or extending the given Class literalstatic org.pentaho.platform.api.engine.IApplicationContext
getApplicationContext()
static org.pentaho.platform.api.engine.ICacheManager
getCacheManager(org.pentaho.platform.api.engine.IPentahoSession session)
static List
getDownloadRolesList()
static org.pentaho.platform.api.engine.IParameterProvider
getGlobalParameters()
static List<String>
getInitializationFailureMessages()
static boolean
getInitializedOK()
static int
getInitializedStatus()
static org.pentaho.platform.api.engine.IPentahoObjectFactory
getObjectFactory()
Gets the factory that will create and manage Pentaho system objects.static <T> org.pentaho.platform.api.engine.IPentahoObjectReference<T>
getObjectReference(Class<T> interfaceClass, org.pentaho.platform.api.engine.IPentahoSession curSession)
Returns an IPentahoObjectReference for the requested Object containing registered Object Properties.static <T> org.pentaho.platform.api.engine.IPentahoObjectReference<T>
getObjectReference(Class<T> interfaceClass, org.pentaho.platform.api.engine.IPentahoSession curSession, Map<String,String> properties)
Returns an IPentahoObjectReference for the requested Object containing registered Object Properties.static <T> List<org.pentaho.platform.api.engine.IPentahoObjectReference<T>>
getObjectReferences(Class<T> interfaceClass, org.pentaho.platform.api.engine.IPentahoSession curSession)
static <T> List<org.pentaho.platform.api.engine.IPentahoObjectReference<T>>
getObjectReferences(Class<T> interfaceClass, org.pentaho.platform.api.engine.IPentahoSession curSession, Map<String,String> properties)
static org.pentaho.platform.api.engine.IContentOutputHandler
getOutputDestinationFromContentRef(String contentTag, org.pentaho.platform.api.engine.IPentahoSession session)
static List
getPublisherList()
static org.dom4j.Document
getPublishersDocument()
static List<String>
getSystemDatasourcesList()
static List<String>
getSystemDatasourcesRolesList()
static String
getSystemName()
static String
getSystemSetting(String settingName, String defaultValue)
static String
getSystemSetting(String path, String settingName, String defaultValue)
static org.pentaho.platform.api.engine.ISystemSettings
getSystemSettings()
static void
globalStartup()
static void
globalStartup(org.pentaho.platform.api.engine.IPentahoSession session)
static boolean
init()
static boolean
init(org.pentaho.platform.api.engine.IApplicationContext pApplicationContext)
static boolean
init(org.pentaho.platform.api.engine.IApplicationContext pApplicationContext, Map listenerMap)
static void
invokeLogoutListeners(org.pentaho.platform.api.engine.IPentahoSession session)
static String
publish(org.pentaho.platform.api.engine.IPentahoSession session, String className)
static Object
putInGlobalAttributesMap(Object key, Object value)
static void
refreshSettings()
static org.pentaho.platform.api.engine.IPentahoObjectRegistration
registerObject(Object obj)
This static method shadows the one defined here:.IPentahoRegistrableObjectFactory#registerObject(Object)
static org.pentaho.platform.api.engine.IPentahoObjectRegistration
registerObject(Object obj, org.pentaho.platform.api.engine.IPentahoRegistrableObjectFactory.Types types)
This static method shadows the one defined here:.IPentahoRegistrableObjectFactory#registerObject(Object, org.pentaho.platform.api.engine .IPentahoRegistrableObjectFactory.Types)
static <T> org.pentaho.platform.api.engine.IPentahoObjectRegistration
registerObject(T obj, Class<?>... classes)
This static method shadows the one defined here:.IPentahoRegistrableObjectFactory#registerObject(Object, Class[])
static void
registerObjectFactory(org.pentaho.platform.api.engine.IPentahoObjectFactory pentahoObjectFactory)
Registers the factory that will create and manage Pentaho system objects.static void
registerPrimaryObjectFactory(org.pentaho.platform.api.engine.IPentahoObjectFactory pentahoObjectFactory)
Registers the primary factory that will create and manage Pentaho system objects.static <T> org.pentaho.platform.api.engine.IPentahoObjectRegistration
registerReference(org.pentaho.platform.api.engine.IPentahoObjectReference<T> reference)
IPentahoRegistrableObjectFactory.registerReference(org.pentaho.platform.api.engine.IPentahoObjectReference)
static <T> org.pentaho.platform.api.engine.IPentahoObjectRegistration
registerReference(org.pentaho.platform.api.engine.IPentahoObjectReference<T> reference, Class<?>... classes)
This static method shadows the one defined here:.IPentahoRegistrableObjectFactory#registerReference(org.pentaho.platform.api.engine.IPentahoObjectReference, Class[])
static <T> org.pentaho.platform.api.engine.IPentahoObjectRegistration
registerReference(org.pentaho.platform.api.engine.IPentahoObjectReference<T> reference, org.pentaho.platform.api.engine.IPentahoRegistrableObjectFactory.Types types)
This static method shadows the one defined here:.IPentahoRegistrableObjectFactory#registerReference(org.pentaho.platform.api.engine.IPentahoObjectReference, org.pentaho.platform.api.engine .IPentahoRegistrableObjectFactory.Types)
static org.pentaho.platform.api.engine.ILogoutListener
remove(org.pentaho.platform.api.engine.ILogoutListener listener)
static Object
removeFromGlobalAttributesMap(Object key)
static void
sessionStartup(org.pentaho.platform.api.engine.IPentahoSession session)
static void
sessionStartup(org.pentaho.platform.api.engine.IPentahoSession session, org.pentaho.platform.api.engine.IParameterProvider sessionParameters)
static void
setAdministrationPlugins(List<org.pentaho.platform.api.engine.IPentahoPublisher> administrationPlugins)
Registers administrative capabilities that can be invoked later viapublish(IPentahoSession, String)
static void
setApplicationContext(org.pentaho.platform.api.engine.IApplicationContext pApplicationContext)
static void
setBundleContext(org.osgi.framework.BundleContext context)
static void
setSessionStartupActions(List<org.pentaho.platform.api.engine.ISessionStartupAction> actions)
Registers server actions that will be invoked when a session is created.static void
setSystemListeners(List<org.pentaho.platform.api.engine.IPentahoSystemListener> systemListeners)
Registers custom handlers that are notified of both system startup and system shutdown events.static void
setSystemSettingsService(org.pentaho.platform.api.engine.ISystemSettings systemSettingsService)
Sets the system settings service: the means by which the platform obtains it's overall system settings.static void
shutdown()
static void
systemEntryPoint()
static void
systemExitPoint()
-
-
-
Field Detail
-
debug
public static final boolean debug
- See Also:
- Constant Field Values
-
trace
public static final boolean trace
- See Also:
- Constant Field Values
-
ignored
public static final boolean ignored
- See Also:
- Constant Field Values
-
JAVA_SYSTEM_PROPERTIES
public static final String JAVA_SYSTEM_PROPERTIES
- See Also:
- Constant Field Values
-
loggingLevel
public static int loggingLevel
-
CONTENT_REPOSITORY
protected static final String CONTENT_REPOSITORY
- See Also:
- Constant Field Values
-
RUNTIME_REPOSITORY
protected static final String RUNTIME_REPOSITORY
- See Also:
- Constant Field Values
-
SOLUTION_ENGINE
protected static final String SOLUTION_ENGINE
- See Also:
- Constant Field Values
-
BACKGROUND_EXECUTION
public static final String BACKGROUND_EXECUTION
- See Also:
- Constant Field Values
-
CONDITIONAL_EXECUTION
public static final String CONDITIONAL_EXECUTION
- See Also:
- Constant Field Values
-
DEFAULT_CONDITIONAL_EXECUTION_PROVIDER
public static String DEFAULT_CONDITIONAL_EXECUTION_PROVIDER
-
DEFAULT_MESSAGE_FORMATTER
public static String DEFAULT_MESSAGE_FORMATTER
-
SCHEDULER
public static final String SCHEDULER
- See Also:
- Constant Field Values
-
MESSAGE_FORMATTER
public static final String MESSAGE_FORMATTER
- See Also:
- Constant Field Values
-
SCOPE_GLOBAL
public static final String SCOPE_GLOBAL
- See Also:
- Constant Field Values
-
SCOPE_SESSION
public static final String SCOPE_SESSION
- See Also:
- Constant Field Values
-
SCOPE_LOCAL
public static final String SCOPE_LOCAL
- See Also:
- Constant Field Values
-
SCOPE
public static final String SCOPE
- See Also:
- Constant Field Values
-
PENTAHO_SESSION_KEY
public static final String PENTAHO_SESSION_KEY
- See Also:
- Constant Field Values
-
PENTAHO_AUTH_KEY
public static final String PENTAHO_AUTH_KEY
- See Also:
- Constant Field Values
-
PENTAHO_MDC_KEY
public static final String PENTAHO_MDC_KEY
- See Also:
- Constant Field Values
-
WAIT_SECONDS
public static final String WAIT_SECONDS
- See Also:
- Constant Field Values
-
CORS_REQUESTS_ALLOWED
public static final String CORS_REQUESTS_ALLOWED
- See Also:
- Constant Field Values
-
CORS_REQUESTS_ALLOWED_ORIGINS
public static final String CORS_REQUESTS_ALLOWED_ORIGINS
- See Also:
- Constant Field Values
-
SYSTEM_NOT_INITIALIZED
public static final int SYSTEM_NOT_INITIALIZED
- See Also:
- Constant Field Values
-
SYSTEM_INITIALIZED_OK
public static final int SYSTEM_INITIALIZED_OK
- See Also:
- Constant Field Values
-
SYSTEM_LISTENERS_FAILED
public static final int SYSTEM_LISTENERS_FAILED
-
SYSTEM_OBJECTS_FAILED
public static final int SYSTEM_OBJECTS_FAILED
-
SYSTEM_PUBLISHERS_FAILED
public static final int SYSTEM_PUBLISHERS_FAILED
-
SYSTEM_AUDIT_FAILED
public static final int SYSTEM_AUDIT_FAILED
-
SYSTEM_PENTAHOXML_FAILED
public static final int SYSTEM_PENTAHOXML_FAILED
-
SYSTEM_SETTINGS_FAILED
public static final int SYSTEM_SETTINGS_FAILED
-
SYSTEM_OTHER_FAILED
public static final int SYSTEM_OTHER_FAILED
-
HIDE_USER_HOME_FOLDER_ON_CREATION_PROPERTY
public static final String HIDE_USER_HOME_FOLDER_ON_CREATION_PROPERTY
- See Also:
- Constant Field Values
-
DEFAULT_FOLDER_WHEN_HOME_FOLDER_IS_HIDDEN_PROPERTY
public static final String DEFAULT_FOLDER_WHEN_HOME_FOLDER_IS_HIDDEN_PROPERTY
- See Also:
- Constant Field Values
-
-
Method Detail
-
setBundleContext
public static void setBundleContext(org.osgi.framework.BundleContext context)
-
init
public static boolean init()
-
init
public static boolean init(org.pentaho.platform.api.engine.IApplicationContext pApplicationContext)
-
init
public static boolean init(org.pentaho.platform.api.engine.IApplicationContext pApplicationContext, Map listenerMap)
-
getInitializedOK
public static boolean getInitializedOK()
-
getInitializedStatus
public static int getInitializedStatus()
-
addInitializationFailureMessage
public static void addInitializationFailureMessage(int failureBit, String message)
-
getOutputDestinationFromContentRef
public static org.pentaho.platform.api.engine.IContentOutputHandler getOutputDestinationFromContentRef(String contentTag, org.pentaho.platform.api.engine.IPentahoSession session)
-
get
public static <T> T get(Class<T> interfaceClass)
A convenience method for retrieving Pentaho system objects from the object factory. Looks up an object by using the name of theinterfaceClass
as the object key inget(Class, String, IPentahoSession)
. NOTE: session will be derived for you by using PentahoSessionHolder, so a session must already have been bound to the thread local in PentahoSessionHolder in order for you to be able to access session-bound objects.
-
get
public static <T> T get(Class<T> interfaceClass, org.pentaho.platform.api.engine.IPentahoSession session, Map<String,String> properties)
A convenience method for retrieving Pentaho system objects from the object factory. Looks up an object by using the name of theinterfaceClass
as the object key inget(Class, IPentahoSession, Map)
. NOTE: session will be derived for you by using PentahoSessionHolder, so a session must already have been bound to the thread local in PentahoSessionHolder in order for you to be able to access session-bound objects.
-
getAll
public static <T> List<T> getAll(Class<T> interfaceClass)
A convenience method for retrieving Pentaho system objects from the object factory. Looks up an object by using the name of theinterfaceClass
as the object key ingetAll(Class, IPentahoSession)
. NOTE: session will be derived for you by using PentahoSessionHolder, so a session must already have been bound to the thread local in PentahoSessionHolder in order for you to be able to access session-bound objects.
-
getAll
public static <T> List<T> getAll(Class<T> interfaceClass, org.pentaho.platform.api.engine.IPentahoSession session)
A convenience method for retrieving Pentaho system objects from the object factory. Looks up an object by using the name of theinterfaceClass
as the object key ingetAll(Class, IPentahoSession)
. NOTE: session will be derived for you by using PentahoSessionHolder, so a session must already have been bound to the thread local in PentahoSessionHolder in order for you to be able to access session-bound objects.
-
getAll
public static <T> List<T> getAll(Class<T> interfaceClass, org.pentaho.platform.api.engine.IPentahoSession session, Map<String,String> props)
Retrieves objects from the object factory registered to the PentahoSystem implementing or extending the given Class literal
-
get
public static <T> T get(Class<T> interfaceClass, org.pentaho.platform.api.engine.IPentahoSession session)
A convenience method for retrieving Pentaho system objects from the object factory implementing or extending the given Class literalget(Class, String, IPentahoSession)
.
-
get
public static <T> T get(Class<T> interfaceClass, String key, org.pentaho.platform.api.engine.IPentahoSession session)
A convenience method for retrieving Pentaho system objects from the object factory. Returns an instance of a configured object of the Pentaho system. This method will returnnull
if the object could not be retrieved for any reason. If the object is defined but for some reason can not be retrieved, an error message will be logged.- Returns:
- An instance of the requested object or
null
if either the object was not configured or it was configured but there was a problem retrieving it. - See Also:
getObjectFactory()
,IPentahoObjectFactory.get(Class, String, IPentahoSession)
-
getObjectReference
public static <T> org.pentaho.platform.api.engine.IPentahoObjectReference<T> getObjectReference(Class<T> interfaceClass, org.pentaho.platform.api.engine.IPentahoSession curSession)
Returns an IPentahoObjectReference for the requested Object containing registered Object Properties.- Parameters:
interfaceClass
- Interface or Class literal for which implementations of will be foundcurSession
- current session to be used for session-based implementations- Returns:
- IPentahoObjectReference for the matching Object or null if no Object is found
-
getObjectReference
public static <T> org.pentaho.platform.api.engine.IPentahoObjectReference<T> getObjectReference(Class<T> interfaceClass, org.pentaho.platform.api.engine.IPentahoSession curSession, Map<String,String> properties)
Returns an IPentahoObjectReference for the requested Object containing registered Object Properties.- Parameters:
interfaceClass
- Interface or Class literal for which implementations of will be foundcurSession
- current session to be used for session-based implementationsproperties
- Map of properties to filter matches in the ObjectFactory by- Returns:
- IPentahoObjectReference for the matching Object or null if no Object is found
-
getObjectReferences
public static <T> List<org.pentaho.platform.api.engine.IPentahoObjectReference<T>> getObjectReferences(Class<T> interfaceClass, org.pentaho.platform.api.engine.IPentahoSession curSession)
-
getObjectReferences
public static <T> List<org.pentaho.platform.api.engine.IPentahoObjectReference<T>> getObjectReferences(Class<T> interfaceClass, org.pentaho.platform.api.engine.IPentahoSession curSession, Map<String,String> properties)
-
getSystemName
public static String getSystemName()
-
getGlobalParameters
public static org.pentaho.platform.api.engine.IParameterProvider getGlobalParameters()
-
sessionStartup
public static void sessionStartup(org.pentaho.platform.api.engine.IPentahoSession session)
-
clearGlobals
public static void clearGlobals()
-
sessionStartup
public static void sessionStartup(org.pentaho.platform.api.engine.IPentahoSession session, org.pentaho.platform.api.engine.IParameterProvider sessionParameters)
-
globalStartup
public static void globalStartup()
-
globalStartup
public static void globalStartup(org.pentaho.platform.api.engine.IPentahoSession session)
-
shutdown
public static void shutdown()
-
getApplicationContext
public static org.pentaho.platform.api.engine.IApplicationContext getApplicationContext()
-
setApplicationContext
public static void setApplicationContext(org.pentaho.platform.api.engine.IApplicationContext pApplicationContext)
-
createObject
@Deprecated public static Object createObject(String className, org.pentaho.platform.api.engine.ILogger logger)
Deprecated.
-
createObject
@Deprecated public static Object createObject(String className)
Deprecated.
-
getSystemSetting
public static String getSystemSetting(String path, String settingName, String defaultValue)
-
getSystemSettings
public static org.pentaho.platform.api.engine.ISystemSettings getSystemSettings()
-
refreshSettings
public static void refreshSettings()
-
publish
public static String publish(org.pentaho.platform.api.engine.IPentahoSession session, String className)
-
getPublisherList
public static List getPublisherList()
-
getPublishersDocument
public static org.dom4j.Document getPublishersDocument()
-
systemEntryPoint
public static void systemEntryPoint()
-
systemExitPoint
public static void systemExitPoint()
-
getCacheManager
public static org.pentaho.platform.api.engine.ICacheManager getCacheManager(org.pentaho.platform.api.engine.IPentahoSession session)
-
getACLFileExtensionList
public static List getACLFileExtensionList()
-
getDownloadRolesList
public static List getDownloadRolesList()
-
addLogoutListener
public static void addLogoutListener(org.pentaho.platform.api.engine.ILogoutListener listener)
-
remove
public static org.pentaho.platform.api.engine.ILogoutListener remove(org.pentaho.platform.api.engine.ILogoutListener listener)
-
invokeLogoutListeners
public static void invokeLogoutListeners(org.pentaho.platform.api.engine.IPentahoSession session)
-
getObjectFactory
public static org.pentaho.platform.api.engine.IPentahoObjectFactory getObjectFactory()
Gets the factory that will create and manage Pentaho system objects.- Returns:
- the factory
-
registerObjectFactory
public static void registerObjectFactory(org.pentaho.platform.api.engine.IPentahoObjectFactory pentahoObjectFactory)
Registers the factory that will create and manage Pentaho system objects.- Parameters:
pentahoObjectFactory
- the factory
-
deregisterObjectFactory
public static boolean deregisterObjectFactory(org.pentaho.platform.api.engine.IPentahoObjectFactory factory)
De-Register an ObjectFactory- Parameters:
factory
-- Returns:
- true if the factory was registered and successfully removed.
-
registerPrimaryObjectFactory
public static void registerPrimaryObjectFactory(org.pentaho.platform.api.engine.IPentahoObjectFactory pentahoObjectFactory)
Registers the primary factory that will create and manage Pentaho system objects.- Parameters:
pentahoObjectFactory
- the factory
-
setAdministrationPlugins
public static void setAdministrationPlugins(List<org.pentaho.platform.api.engine.IPentahoPublisher> administrationPlugins)
Registers administrative capabilities that can be invoked later viapublish(IPentahoSession, String)
- Parameters:
administrationPlugins
- a list of admin functions to register
-
setSystemListeners
public static void setSystemListeners(List<org.pentaho.platform.api.engine.IPentahoSystemListener> systemListeners)
Registers custom handlers that are notified of both system startup and system shutdown events.- Parameters:
systemListeners
- the system event handlers
-
setSessionStartupActions
public static void setSessionStartupActions(List<org.pentaho.platform.api.engine.ISessionStartupAction> actions)
Registers server actions that will be invoked when a session is created. NOTE: it is completely up to theIPentahoSession
implementation whether to advise the system of it's creation viasessionStartup(IPentahoSession)
.- Parameters:
actions
- the server actions to execute on session startup
-
setSystemSettingsService
public static void setSystemSettingsService(org.pentaho.platform.api.engine.ISystemSettings systemSettingsService)
Sets the system settings service: the means by which the platform obtains it's overall system settings.- Parameters:
systemSettingsService
- the settings service
-
clearObjectFactory
public static void clearObjectFactory()
-
registerReference
public static <T> org.pentaho.platform.api.engine.IPentahoObjectRegistration registerReference(org.pentaho.platform.api.engine.IPentahoObjectReference<T> reference, org.pentaho.platform.api.engine.IPentahoRegistrableObjectFactory.Types types)
This static method shadows the one defined here:.IPentahoRegistrableObjectFactory#registerReference(org.pentaho.platform.api.engine.IPentahoObjectReference, org.pentaho.platform.api.engine .IPentahoRegistrableObjectFactory.Types)
- Type Parameters:
T
-- Parameters:
reference
-types
-
-
registerObject
public static org.pentaho.platform.api.engine.IPentahoObjectRegistration registerObject(Object obj)
This static method shadows the one defined here:.IPentahoRegistrableObjectFactory#registerObject(Object)
- Parameters:
obj
-
-
registerObject
public static org.pentaho.platform.api.engine.IPentahoObjectRegistration registerObject(Object obj, org.pentaho.platform.api.engine.IPentahoRegistrableObjectFactory.Types types)
This static method shadows the one defined here:.IPentahoRegistrableObjectFactory#registerObject(Object, org.pentaho.platform.api.engine .IPentahoRegistrableObjectFactory.Types)
- Parameters:
obj
-types
-
-
registerReference
public static <T> org.pentaho.platform.api.engine.IPentahoObjectRegistration registerReference(org.pentaho.platform.api.engine.IPentahoObjectReference<T> reference)
IPentahoRegistrableObjectFactory.registerReference(org.pentaho.platform.api.engine.IPentahoObjectReference)
- Type Parameters:
T
-- Parameters:
reference
-
-
registerObject
public static <T> org.pentaho.platform.api.engine.IPentahoObjectRegistration registerObject(T obj, Class<?>... classes)
This static method shadows the one defined here:.IPentahoRegistrableObjectFactory#registerObject(Object, Class[])
- Parameters:
obj
-classes
-
-
registerReference
public static <T> org.pentaho.platform.api.engine.IPentahoObjectRegistration registerReference(org.pentaho.platform.api.engine.IPentahoObjectReference<T> reference, Class<?>... classes)
This static method shadows the one defined here:.IPentahoRegistrableObjectFactory#registerReference(org.pentaho.platform.api.engine.IPentahoObjectReference, Class[])
- Type Parameters:
T
-- Parameters:
reference
-classes
-
-
-