Difference between revisions of "Configuration Components"

From GCube System
Jump to: navigation, search
(Configuring the ServiceContext)
(Configuring the ServiceContext)
Line 22: Line 22:
  
 
==== Configuring the ServiceContext ====
 
==== Configuring the ServiceContext ====
$The ServiceContext....
+
The ServiceContext models the configuration of the service instance as a whole. The context configuration MUST be placed in the '''deploy-jndi-config.xml''' in the etc folder under the service location as a <code>service</code> element. The minimal configuration requires the declaration of the service configuration folder as follows:
 +
<pre>
 +
<?xml version="1.0" encoding="UTF-8"?>
 +
<jndiConfig xmlns="http://wsrf.globus.org/jndi/config">
 +
<service name="acme/sample">
 +
<environment
 +
name="configDir"
 +
value="@config.dir@"
 +
type="java.lang.String"
 +
override="false" />
 +
</service>
 +
</jndiConfig>
 +
</pre>
  
 +
The ''@config.dir@'' is a placeholder replaced by the Axis facilities at deployment time with etc folder under the target service location.
  
At least, one port-type class in a gCore compliant service MUST:
+
The ServiceContext is initialised by a special port-type: the <code>GCUBEStartupPortType</code>. In order to allow the ServiceContext (and then the service) initialisation, gCore requires that a service MUST:
* extend the GCUBEStartupPortType
+
* implement one port-type class that extends the <code>GCUBEStartupPortType</code>
* be declared with the parameter <code><parameter name="loadOnStartup" value="true"/></code> in the '''deploy-server.wsdd''' file in the etc folder under the service location.  
+
* that port-type has to be declared with the parameter <code><parameter name="loadOnStartup" value="true"/></code> in the '''deploy-server.wsdd''' file in the etc folder under the service location.  
This port-type performs the ServiceContext initialisation.
+
 
gCore recommends that only one port-type extends the StartupPortType. If two (or more) port-types extend the GCUBEStartupPortType, you have to be aware that your service context is initialised twice. This is an overhead but not an issue for the gCore initialisation procedure. However, it could be a problem if a service performs specific initialisation actions in the service context events (like the onReady() or onInitialisation() callback methods) that are supposed to be executed only once.
+
gCore recommends that only one port-type extends the <code>GCUBEStartupPortType</code>. If two (or more) port-types extend the GCUBEStartupPortType, you have to be aware that your service context is initialised twice. This is an overhead but not an issue for the gCore initialisation procedure. However, it could be a problem if a service performs specific initialisation actions in the service context events (like the onReady() or onInitialisation() callback methods) that are supposed to be executed only once.
  
 
==== Configuring the Port-Type Context(s) ====
 
==== Configuring the Port-Type Context(s) ====

Revision as of 22:40, 1 June 2008

[coming soon]

Configure What?

[coming soon]

Profiles, JNDIs & Descriptors

[coming soon]

JNDIs

Each context can be configured with a JNDI section automatically loaded by gCore. Following the stack of contexts, we can configure:

  • the GHN Context
  • the Service Context
  • the port-type Context

While the first one is global for each node and its configuration is under the GHN manager responsibility, the others are service-specific and MUST be taken into consideration when developing a new gCore compliant service. Per each service, there are:

  • one and only one ServiceContext
  • several port-type Contexts, depending on the service architecture and needs

Both the Service Context and the port-type Contexts can be configured with a dedicated service element in the file called deploy-jndi-config.xml and placed in the etc folder under the service location.

Configuring the ServiceContext

The ServiceContext models the configuration of the service instance as a whole. The context configuration MUST be placed in the deploy-jndi-config.xml in the etc folder under the service location as a service element. The minimal configuration requires the declaration of the service configuration folder as follows:

<?xml version="1.0" encoding="UTF-8"?>
<jndiConfig xmlns="http://wsrf.globus.org/jndi/config">
	<service name="acme/sample">
		<environment 
		name="configDir" 
	 	value="@config.dir@" 
	 	type="java.lang.String"
	 	override="false" />
	</service>
</jndiConfig>

The @config.dir@ is a placeholder replaced by the Axis facilities at deployment time with etc folder under the target service location.

The ServiceContext is initialised by a special port-type: the GCUBEStartupPortType. In order to allow the ServiceContext (and then the service) initialisation, gCore requires that a service MUST:

  • implement one port-type class that extends the GCUBEStartupPortType
  • that port-type has to be declared with the parameter <parameter name="loadOnStartup" value="true"/> in the deploy-server.wsdd file in the etc folder under the service location.

gCore recommends that only one port-type extends the GCUBEStartupPortType. If two (or more) port-types extend the GCUBEStartupPortType, you have to be aware that your service context is initialised twice. This is an overhead but not an issue for the gCore initialisation procedure. However, it could be a problem if a service performs specific initialisation actions in the service context events (like the onReady() or onInitialisation() callback methods) that are supposed to be executed only once.

Configuring the Port-Type Context(s)