Difference between revisions of "Migration Guidelines from 0.5.1 to 0.6"
From GCube System
(→Changes Related to the Implementation of Services) |
(→Changes Related to the Implementation of Services) |
||
Line 8: | Line 8: | ||
==== Changes Related to the Implementation of Services ==== | ==== Changes Related to the Implementation of Services ==== | ||
− | :* The interface <code>ISPublisher</code> in <code>org.gcube.common.core.informationsystem.publisher</code> is now extended by <code>ISSyncPublisher</code> and <code>ISASyncPublisher</code> interfaces, in the same package. These are tagging interfaces that implicitly impose synchronous and asynchronous behaviour on their implementations, respectively. The default implementation of <code>ISPublisher</code> is the default implementation of <code>ISAsyncPublisher</code>. This means that existing code retains its current semantics. Interface implementations are obtained though standard means: | + | :* ''New interfaces for resource publication''. |
+ | :: The interface <code>ISPublisher</code> in <code>org.gcube.common.core.informationsystem.publisher</code> is now extended by <code>ISSyncPublisher</code> and <code>ISASyncPublisher</code> interfaces, in the same package. These are tagging interfaces that implicitly impose synchronous and asynchronous behaviour on their implementations, respectively. The default implementation of <code>ISPublisher</code> is the default implementation of <code>ISAsyncPublisher</code>. This means that existing code retains its current semantics. Interface implementations are obtained though standard means: | ||
<source lang="java"> | <source lang="java"> | ||
Line 25: | Line 26: | ||
</source> | </source> | ||
− | |||
− | |||
− | ::* <code> | + | :* ''New plugin management facilities''. |
+ | ::<code>org.gcube.common.core.plugins</code> includes programming abstractions for the design of pluggable services, most noticeably: | ||
+ | :::* <code>GCUBEPluginManager</code>, a partial implementation of service components dedicated to the overall management of service plugins. <code>GCUBEPluginManager</code> predefines behaviour to register and unregister plugins, to validate their contents against general and service-specific requirements, to notify other components of registration and unregistration events, to persist plugin profiles so as to automatically re-register them after container restarts, and to store and expose registered plugins within service implementations. Developers specialise <code>GCUBEPluginManager</code> to link its facilities to their services and to add validation checks that reflect specific service expectations. See the [http://gcore.research-infrastructures.eu/javadoc/ API documentation] for further details. | ||
− | ::Plugin managers are identified in the JNDI configuration of the service as exemplified below: | + | :::* <code>GCUBEPluginContext</code>, a partial implementation of plugin components that act as entry points to the functionality and information in the plugin. <code>GCUBEPluginContext</code> predefines behaviour to expose the profile of the plugin, its descriptive properties, and the type mappings required by the plugin, if any. Service developers specialise <code>GCUBEPluginContext</code> to link its facilities to their service plugins, to pre-define descriptive properties common to all their plugins, and to add any other property or method that they require from the plugins (typically to identify implementations of service interfaces upon which the service needs to act). Plugin developers then further derive this classes to comply with service requirements and include them in the plugins. See the [http://gcore.research-infrastructures.eu/javadoc/ API documentation] for further details. |
+ | |||
+ | :::Plugin managers are identified in the JNDI configuration of the service as exemplified below: | ||
<pre> | <pre> | ||
Line 44: | Line 47: | ||
</pre> | </pre> | ||
− | :: based on this configuration, gCF will instantiate the plugin manager at service startup. Thereafter, the <code>Deployer</code> will interface them transparently to register service plugins that are available within the infrastructure. The registered plugins are also published in a distinguished section of the profile of the Running Instance (cf. <code>runninginstance.xsd</code> in <code>$GLOBUS_LOCATION/share/schema/gcube/common/core/profiles</code>). | + | ::: based on this configuration, gCF will instantiate the plugin manager at service startup. Thereafter, the <code>Deployer</code> will interface them transparently to register service plugins that are available within the infrastructure. The registered plugins are also published in a distinguished section of the profile of the Running Instance (cf. <code>runninginstance.xsd</code> in <code>$GLOBUS_LOCATION/share/schema/gcube/common/core/profiles</code>). |
+ | |||
+ | :* ''New handler facilities''. | ||
+ | :: The package <code>org.gcube.commo.core.utils.handlers</code> has undergone a number of retro-compatible changes, inlcuding: | ||
+ | |||
+ | :::* <code>GCUBEIHandler</code> is a new interface that characterises the behaviour of all handlers. This allows clients to extend the interface to enforce stronger expectations on handler implementations. <code>GCUBEHandler</code> implements the interface and remains the base implementation of all pre-defined handlers. | ||
+ | |||
+ | :::* <code>org.gcube.commo.core.utils.handlers.lifetime</code> includes classes and interfaces for handlers that wish to perform state management. See the [[The_Handler_Framework#Lifetime_and_Event_Management|developer's guide]] for details. All pre-defined handlers now perform state management. | ||
+ | |||
+ | :::* <code>org.gcube.commo.core.utils.handlers.events</code> includes classes and interfaces for handlers that wish to perform event management. See the [[The_Handler_Framework#Lifetime_and_Event_Management|developer's guide]] for details. All pre-defined handlers now perform event management. | ||
:* '''the method <code>org.gcube.common.core.contexts.GHNContext.getHostName()</code> no longer throws a <code>java.utils.IOException</code>'''. | :* '''the method <code>org.gcube.common.core.contexts.GHNContext.getHostName()</code> no longer throws a <code>java.utils.IOException</code>'''. | ||
− | :* '''<code>org.gcube.common.core.utils.handlers | + | :* '''the class <code>GCUBEScheduledHandler</code> in <code>org.gcube.common.core.utils.handlers</code> has changed its parametrisation'''. |
+ | :: The old parametrisation was: | ||
<source lang="java"> | <source lang="java"> |
Revision as of 14:17, 28 October 2009
gCore 0.6
requires or supports the following changes to practices and service implementations that are compliant with gCore 0.5.1
(non retro-compatible changes are typeset in bold):
Changes Related to Configuration and Use of the gHN
- debugging and profiling launch scripts.
- The are two new scripts in
$GLOBUS_LOCATION/bin
,gcore-start-container-debug
andgcore-start-container-profile
, to start the gHN in debugging and profiling mode, respectively. See the Primer for detailed usage instructions.
Changes Related to the Implementation of Services
- New interfaces for resource publication.
- The interface
ISPublisher
inorg.gcube.common.core.informationsystem.publisher
is now extended byISSyncPublisher
andISASyncPublisher
interfaces, in the same package. These are tagging interfaces that implicitly impose synchronous and asynchronous behaviour on their implementations, respectively. The default implementation ofISPublisher
is the default implementation ofISAsyncPublisher
. This means that existing code retains its current semantics. Interface implementations are obtained though standard means:
ISSyncPublisher sp = GHNContext.getImplementation(ISSyncPublisher.class); //obtains a publisher for synchronous publication ISASyncPublisher ap = GHNContext.getImplementation(ISASyncPublisher.class); //obtains a publisher for asynchronous publication ISPublisher p = GHNContext.getImplementation(ISPublisher.class); //also obtains a publisher for asynchronous publication
-
org.gcube.common.core.state.GCUBEWSResource
has a new methodgetPublisher()
that returns the implementation ofISPublisher
used for the publication of WS-Resources. The method returns the default implementation ofISPublisher
, which is an asynchronous publisher (see above). Developers can override it to return the implementations of specific publishers, as shown below:
-
/**{@inheritDoc}*/ protected ISPublisher getPublisher() throws Exception { return GHNContext.getImplementation(ISSyncPublisher.class); //forces a synchronous publisher }
- New plugin management facilities.
org.gcube.common.core.plugins
includes programming abstractions for the design of pluggable services, most noticeably:-
GCUBEPluginManager
, a partial implementation of service components dedicated to the overall management of service plugins.GCUBEPluginManager
predefines behaviour to register and unregister plugins, to validate their contents against general and service-specific requirements, to notify other components of registration and unregistration events, to persist plugin profiles so as to automatically re-register them after container restarts, and to store and expose registered plugins within service implementations. Developers specialiseGCUBEPluginManager
to link its facilities to their services and to add validation checks that reflect specific service expectations. See the API documentation for further details.
-
-
GCUBEPluginContext
, a partial implementation of plugin components that act as entry points to the functionality and information in the plugin.GCUBEPluginContext
predefines behaviour to expose the profile of the plugin, its descriptive properties, and the type mappings required by the plugin, if any. Service developers specialiseGCUBEPluginContext
to link its facilities to their service plugins, to pre-define descriptive properties common to all their plugins, and to add any other property or method that they require from the plugins (typically to identify implementations of service interfaces upon which the service needs to act). Plugin developers then further derive this classes to comply with service requirements and include them in the plugins. See the API documentation for further details.
-
- Plugin managers are identified in the JNDI configuration of the service as exemplified below:
<resource name="pluginManagerProfile" type="org.gcube.common.core.plugins.GCUBEPluginManagerProfile"> <resourceParams> <parameter><name>factory</name><value>org.globus.wsrf.jndi.BeanFactory</value></parameter> <parameter> <name>className</name> <value>org.acme.myservice.MyPluginManager</value> </parameter> </resourceParams> </resource>
- based on this configuration, gCF will instantiate the plugin manager at service startup. Thereafter, the
Deployer
will interface them transparently to register service plugins that are available within the infrastructure. The registered plugins are also published in a distinguished section of the profile of the Running Instance (cf.runninginstance.xsd
in$GLOBUS_LOCATION/share/schema/gcube/common/core/profiles
).
- based on this configuration, gCF will instantiate the plugin manager at service startup. Thereafter, the
- New handler facilities.
- The package
org.gcube.commo.core.utils.handlers
has undergone a number of retro-compatible changes, inlcuding:
-
GCUBEIHandler
is a new interface that characterises the behaviour of all handlers. This allows clients to extend the interface to enforce stronger expectations on handler implementations.GCUBEHandler
implements the interface and remains the base implementation of all pre-defined handlers.
-
-
org.gcube.commo.core.utils.handlers.lifetime
includes classes and interfaces for handlers that wish to perform state management. See the developer's guide for details. All pre-defined handlers now perform state management.
-
-
org.gcube.commo.core.utils.handlers.events
includes classes and interfaces for handlers that wish to perform event management. See the developer's guide for details. All pre-defined handlers now perform event management.
-
- the method
org.gcube.common.core.contexts.GHNContext.getHostName()
no longer throws ajava.utils.IOException
.
- the method
- the class
GCUBEScheduledHandler
inorg.gcube.common.core.utils.handlers
has changed its parametrisation.
- The old parametrisation was:
- the class
public GCUBEScheduledHandler extends GCUBEHandler<GCUBEHandler<?>>
- it is now:
public class GCUBEScheduledHandler<HANDLED> extends GCUBEHandler<HANDLED> ...
- Accordingly, a
GCUBEScheduledHandler
handles arbitrary objects rather than the handlers it schedules. The change allows clients to process scheduled handlers as any other handler. The implication is that the methodssetHandled()
andgetHandled()
no longer set and return the scheduled handler. The new methodssetScheduled()
andgetScheduled()
can be instead used for this purpose. See the API documentation for further details.
- Accordingly, a
Changes Related to the Resource Profiles
- TODO.
- TODO.