Jump to: navigation, search

Difference between revisions of "Gyrex/Developer Guide/Roles"

(New page: In Gyrex ''roles'' are used to control what bundles and what OSGi applications (OSGi application admin) will be started on a particular node. == Dependencies == * Bundle <code>org.eclips...)
 
Line 9: Line 9:
 
Roles are implemented using the Equinox Extension Registry. This decision was made in order to allow a declaritive approach for devining roles without writing any line of Java as well as to support lazy activation. It may be possible to use DS in the future ({{bug|395332}}).
 
Roles are implemented using the Equinox Extension Registry. This decision was made in order to allow a declaritive approach for devining roles without writing any line of Java as well as to support lazy activation. It may be possible to use DS in the future ({{bug|395332}}).
  
In order to define a role you need to create an extension
+
In order to define a role you need to create an extension to the <code>org.eclipse.gyrex.server.roles</code> extension point. Each role consists of an identifier, a name and references a set of bundles and/or applications to start. Applications must be defined using the Equinox <code>org.eclipse.core.runtime.applications</code> extension point.
  
 +
=== Example ===
 +
The following Example defines a role "My Server Role".
 +
<source lang="xml">
 +
  <role id="com.abc.my.role" name="My Server Role">
 +
    <requireBundle symbolicName="com.abc.thridparty" />
 +
    <requireApplication applicationId="com.abc.my.application" />
 +
  </role>
 +
</source>
 +
 +
The role requires the bundle <code>com.abc.thridparty</code> to be started as well as the application <code>com.abc.my.application</code>.
  
 
[[Category:Gyrex]]
 
[[Category:Gyrex]]

Revision as of 15:00, 28 November 2012

In Gyrex roles are used to control what bundles and what OSGi applications (OSGi application admin) will be started on a particular node.

Dependencies

  • Bundle org.eclipse.gyrex.boot (Gyrex 1.0 or higher)
  • Equinox Extension Registry


Define Roles

Roles are implemented using the Equinox Extension Registry. This decision was made in order to allow a declaritive approach for devining roles without writing any line of Java as well as to support lazy activation. It may be possible to use DS in the future (bug 395332).

In order to define a role you need to create an extension to the org.eclipse.gyrex.server.roles extension point. Each role consists of an identifier, a name and references a set of bundles and/or applications to start. Applications must be defined using the Equinox org.eclipse.core.runtime.applications extension point.

Example

The following Example defines a role "My Server Role".

  <role id="com.abc.my.role" name="My Server Role">
    <requireBundle symbolicName="com.abc.thridparty" />
    <requireApplication applicationId="com.abc.my.application" />
  </role>

The role requires the bundle com.abc.thridparty to be started as well as the application com.abc.my.application.