Download Nuxeo Enterprise Platform

Transcript
Nuxeo Runtime
2. The XML component deployer (nx:name=bundleDeployer,type=deployer) that can deploy XML
descriptors as OSGi components
25.5.1.1. Installation
Deploy the NXRuntime.sar in JBoss, then deploy your OSGi bundles as common JBoss packages in any
JBoss-supported format.
That's it,, your bundles are deployed and activated.
25.5.2. Eclipse Integration
For Eclipse, a NXRuntime.jar bundle is provided. Since Eclipse is OSGi-compliant, Nuxeo Runtime will not
install any adapter (so it is not intervening on the bundle deployment).
When running on OSGi platforms, the main role of the runtime is to register components declared inside OSGi
bundles (as seen previously through their manifest).
Because Eclipse is not starting automatically OSGi bundles (it starts them only on demand or on class loading),
you need to update Eclipse's config.ini and configure it to start Nuxeo Runtime (i.e. org.nuxeo.runtime) when
Eclipse starts:
osgi.bundles=org.eclipse.equinox.common@2:start, org.eclipse.update.configurator@3:start, org.eclipse.core.runti
25.5.2.1. Installation
Update the config.ini file as described above, then copy NXRuntime.jar inside the Eclipse plugin directory.
Start Eclipse. You're done!
25.6. Using Nuxeo Runtime
25.6.1. Creating Components
Components may be created either from XML descriptor files, or programatically.
In order to register components you always need a runtime context.
25.6.1.1. Runtime Context
A runtime context is the context where a component is registered. Contexts are always associated with the
bundle containing the component classes. Through the context, a component can access the runtime service and
can load classes and retrieve resources from its bundle and other visible bundles. RuntimeContext objects
depend on the current implementation of the runtime service, which varies based on the deployment
environment:
Nuxeo Runtime provides three implementations of the RuntimeContext interface:
1. org.nuxeo.runtime.model.impl.DefaultRuntimeContext: this is a simple implementation of a context
designed to be used outside of an OSGi environment. This context uses the current thread context class
loader. It is provided so that simple Java applications like JUnit tests can function properly without
needing a full-blown OSGi system.
2. org.nuxeo.runtime.osgi.OSGiRuntimeContext: this context can be used on any platform supporting
OSGi bundles. This context uses the bundle's ClassLoader to load classes and find resources. This is the
context supplied when the Nuxeo Runtime is deployed on a OSGi platform.
Nuxeo EP 5.1 / 5.2
166