|
Nuxeo Enterprise Platform 5.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.nuxeo.runtime.api.Framework
public final class Framework
This class is the main entry point to a Nuxeo runtime application.
It offers an easy way to create new sessions, to access system services and other resources.
There are two type of services:
Method Summary | ||
---|---|---|
static void |
addListener(RuntimeServiceListener listener)
Registers a listener to be notified about runtime events. |
|
static java.lang.String |
expandVars(java.lang.String expression)
Expands any variable found in the given expression with the value of the corresponding framework property. |
|
static
|
getLocalService(java.lang.Class<T> serviceClass)
Gets a nuxeo-runtime local service. |
|
static java.util.Properties |
getProperties()
Gets all the framework properties. |
|
static java.lang.String |
getProperty(java.lang.String key)
Gets the given property value if any, otherwise null. |
|
static java.lang.String |
getProperty(java.lang.String key,
java.lang.String defValue)
Gets the given property value if any, otherwise returns the given default value. |
|
static SharedResourceLoader |
getResourceLoader()
|
|
static RuntimeService |
getRuntime()
Gets the runtime service instance. |
|
static
|
getService(java.lang.Class<T> serviceClass)
Gets a service given its class. |
|
static
|
getService(java.lang.Class<T> serviceClass,
java.lang.String name)
Gets a service given its class and an identifier. |
|
static void |
handleDevError(java.lang.Throwable t)
This method stops the application if development mode is enabled (i.e. org.nuxeo.dev system property is set) and one of the following errors occurs during startup: Component XML parse error. |
|
static void |
initialize(RuntimeService runtimeService)
|
|
static boolean |
isDevModeSet()
|
|
static boolean |
isInitialized()
Tests whether or not the runtime was initialized. |
|
static boolean |
isTestModeSet()
|
|
static javax.security.auth.login.LoginContext |
login()
Login in the system as the system user (a pseudo-user having all privileges). |
|
static javax.security.auth.login.LoginContext |
login(javax.security.auth.callback.CallbackHandler cbHandler)
Login in the system using the given callback handler for login info resolution. |
|
static javax.security.auth.login.LoginContext |
login(java.lang.String username,
java.lang.Object password)
Login in the system as the given user using the given password. |
|
static javax.security.auth.login.LoginContext |
loginAs(java.lang.String username)
Login in the system as the system user (a pseudo-user having all privileges). |
|
static java.lang.Object |
lookup(java.lang.String key)
Lookup a registered object given its key. |
|
static void |
main(java.lang.String[] args)
|
|
static void |
reloadResourceLoader()
|
|
static void |
removeListener(RuntimeServiceListener listener)
Removes the given listener. |
|
static void |
sendEvent(RuntimeServiceEvent event)
|
|
static void |
shutdown()
|
|
static void |
trackFile(java.io.File file,
java.lang.Object marker)
Deletes the given file when the marker object is collected by GC. |
|
static void |
trackFile(java.io.File file,
java.lang.Object marker,
FileDeleteStrategy fileDeleteStrategy)
Deletes the given file when the marker object is collected by GC. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void initialize(RuntimeService runtimeService) throws java.lang.Exception
java.lang.Exception
public static void reloadResourceLoader() throws java.lang.Exception
java.lang.Exception
public static void shutdown() throws java.lang.Exception
java.lang.Exception
public static boolean isInitialized()
public static SharedResourceLoader getResourceLoader()
public static RuntimeService getRuntime()
public static <T> T getService(java.lang.Class<T> serviceClass) throws java.lang.Exception
java.lang.Exception
public static <T> T getService(java.lang.Class<T> serviceClass, java.lang.String name) throws java.lang.Exception
java.lang.Exception
public static <T> T getLocalService(java.lang.Class<T> serviceClass)
public static java.lang.Object lookup(java.lang.String key)
public static javax.security.auth.login.LoginContext login() throws javax.security.auth.login.LoginException
javax.security.auth.login.LoginException
- on login failurepublic static javax.security.auth.login.LoginContext loginAs(java.lang.String username) throws javax.security.auth.login.LoginException
username
- the originating user id
javax.security.auth.login.LoginException
- on login failurepublic static javax.security.auth.login.LoginContext login(java.lang.String username, java.lang.Object password) throws javax.security.auth.login.LoginException
username
- the username to loginpassword
- the password
javax.security.auth.login.LoginException
- if login failedpublic static javax.security.auth.login.LoginContext login(javax.security.auth.callback.CallbackHandler cbHandler) throws javax.security.auth.login.LoginException
cbHandler
- used to fetch the login info
javax.security.auth.login.LoginException
public static void sendEvent(RuntimeServiceEvent event)
public static void addListener(RuntimeServiceListener listener)
If the listener is already registered, do nothing.
listener
- the listener to registerpublic static void removeListener(RuntimeServiceListener listener)
If the listener is not registered, do nothing.
listener
- the listener to removepublic static java.lang.String getProperty(java.lang.String key)
The framework properties will be searched first then if any matching property is found the system properties are searched too.
key
- the property key
public static java.lang.String getProperty(java.lang.String key, java.lang.String defValue)
The framework properties will be searched first then if any matching property is found the system properties are searched too.
key
- the property keydefValue
- the default value to use
public static java.util.Properties getProperties()
public static java.lang.String expandVars(java.lang.String expression)
The variable format is ${property_key}.
System properties are also expanded.
public static boolean isDevModeSet()
public static boolean isTestModeSet()
public static void handleDevError(java.lang.Throwable t)
t
- the exception or null if nonepublic static void trackFile(java.io.File file, java.lang.Object marker)
file
- The file to deletemarker
- the marker Objectpublic static void trackFile(java.io.File file, java.lang.Object marker, FileDeleteStrategy fileDeleteStrategy)
file
- The file to deletemarker
- the marker ObjectfileDeleteStrategy
- add a custom delete strategypublic static void main(java.lang.String[] args)
|
Nuxeo Enterprise Platform 5.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |