Nuxeo Enterprise Platform 5.4

org.nuxeo.runtime.model.impl
Class ComponentPersistence

java.lang.Object
  extended by org.nuxeo.runtime.model.impl.ComponentPersistence

public class ComponentPersistence
extends java.lang.Object

Manage persistent components. Persistent components are located in ${nxserver_data_dir}/components directory, and can be dynamically removed or registered. After framework startup (after the application was completely started) the persistent components are deployed. The layout of the components directory is the following:

 components/
     component1.xml
     component2.xml
     ...
     bundle_symbolicName1/
         component1.xml
         component2.xml
         ...
     bundle_symbolicName1/
         ...
     ...
 
If components are put directly under the root then they will be deployed in the runtime bundle context. If they are put in a directory having as name the symbolicName of a bundle in the system, then the component will be deployed in that bundle context.

Any files not ending with .xml are ignored. Any directory that doesn't match a bundle symbolic name will be ignored too.

Dynamic components must use the following name convention: (it is not mandatory but it is recommended)

Examples: Given the following component files: components/mycomp1.xml and components/mybundle/mycomp2.xml the name for mycomp1 must be: comp1 and for mycomp2 must be mybundle/mycomp2

This service is working only with OSGiRuntimeService

Author:
Bogdan Stefanescu

Constructor Summary
ComponentPersistence(OSGiRuntimeService runtime)
           
 
Method Summary
 void createComponent(byte[] bytes)
           
 void createComponent(byte[] bytes, boolean isPersistent)
           
 RuntimeContext getContext(java.lang.String symbolicName)
           
 java.io.File getRoot()
           
 void loadPersistedComponent(java.io.File file)
           
 void loadPersistedComponents()
           
 void loadPersistedComponents(RuntimeContext rc, java.io.File root)
           
 org.w3c.dom.Document loadXml(java.io.File file)
           
static org.w3c.dom.Document loadXml(java.io.InputStream in)
           
 boolean removeComponent(java.lang.String compName)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentPersistence

public ComponentPersistence(OSGiRuntimeService runtime)
Method Detail

getRoot

public java.io.File getRoot()

getContext

public final RuntimeContext getContext(java.lang.String symbolicName)
                                throws java.lang.Exception
Throws:
java.lang.Exception

loadPersistedComponents

public void loadPersistedComponents()
                             throws java.lang.Exception
Throws:
java.lang.Exception

loadPersistedComponents

public void loadPersistedComponents(RuntimeContext rc,
                                    java.io.File root)
                             throws java.lang.Exception
Throws:
java.lang.Exception

loadPersistedComponent

public void loadPersistedComponent(java.io.File file)
                            throws java.lang.Exception
Throws:
java.lang.Exception

loadXml

public org.w3c.dom.Document loadXml(java.io.File file)
                             throws java.lang.Exception
Throws:
java.lang.Exception

loadXml

public static org.w3c.dom.Document loadXml(java.io.InputStream in)
                                    throws java.lang.Exception
Throws:
java.lang.Exception

createComponent

public void createComponent(byte[] bytes)
                     throws java.lang.Exception
Throws:
java.lang.Exception

createComponent

public void createComponent(byte[] bytes,
                            boolean isPersistent)
                     throws java.lang.Exception
Throws:
java.lang.Exception

removeComponent

public boolean removeComponent(java.lang.String compName)
                        throws java.lang.Exception
Throws:
java.lang.Exception

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.