Difference between revisions of "Migration Guidelines from 0.4.4 to 0.5"
From GCube System
(→Changes Related to Services) |
(→Changes Related to Services) |
||
Line 45: | Line 45: | ||
:: See also the Primer for more information [[The_Development_Cycle#A_Simple_Implementation|on this requirement]]. | :: See also the Primer for more information [[The_Development_Cycle#A_Simple_Implementation|on this requirement]]. | ||
− | :* ''New port-type callbacks on RI lifetime.'' | + | :* ''New port-type and home callbacks on RI lifetime.'' |
− | :: <code>GCUBEPortType</code> defines callbacks for all the states of RI lifetime: <code>onInitialisation()</code>, <code>onInitialisation()</code>onReady()</code, <code>onFailure()</code>, <code>onUpdate()</code>,<code>onStateChange()</code>. See the Developer's Guide for specific information on the [[Contexts#Lifetime_Management_2|lifetime of the RI]]. | + | :: <code>GCUBEPortType</code> defines callbacks for all the states of RI lifetime: <code>onInitialisation()</code>, <code>onInitialisation()</code>onReady()</code, <code>onFailure()</code>, <code>onUpdate()</code>,<code>onStateChange()</code>. The same callbacks are now also defined for <code>GCUBEWSHome</code>s. See the Developer's Guide for specific information on the [[Contexts#Lifetime_Management_2|lifetime of the RI]]. |
:* ''New file management methods on service contexts.'' | :* ''New file management methods on service contexts.'' | ||
Line 69: | Line 69: | ||
::* changes to persisted WS-Resources are automatically detected by the persistence manager. Changes to other files below the storage root of the service must be explicitly flagged by invoking the method <code>notifyStateChange()</code> of the service context. | ::* changes to persisted WS-Resources are automatically detected by the persistence manager. Changes to other files below the storage root of the service must be explicitly flagged by invoking the method <code>notifyStateChange()</code> of the service context. | ||
:: See also the release notes for an [[Release_Notes|overview of remote persistence]]. | :: See also the release notes for an [[Release_Notes|overview of remote persistence]]. | ||
+ | |||
+ | :* ''New ''<code>ISClient</code>'' interface.'' | ||
+ | :: The <code>ISClient</code> interface now supports query by reference. See the Primer for examples [[/Advanced_Topics#ISClient_interface|on usage]]. | ||
+ | |||
+ | :* ''New ''<code>ISNotifier</code>'' interface.'' | ||
+ | :: ['''Please summarise and point to primer section similarly to entry above''']. | ||
+ | |||
+ | :* ''New persistence modes for'' <code>GCUBEWSHome</code>. | ||
+ | :: <code>GCUBEWSHome</code>s now can be configured to support additional modes of persistence. See the Primer for an explanation of the [[Adding_State#Persistence_Modes|available modes and configuration details]]. | ||
+ | |||
+ | :* ''New locking mechanism for resources.'' | ||
+ | :: <code>GCUBEStatefulResource</code> now defines a method <code>getLock()</code> that returns a new <code>GCUBEReadWriteLock</code> that can be used by cooperating threads (including gCF's of course) to synchronise their access to the resource. <code>GCUBEReadWriteLock</code> is an extension of Java's [http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/locks/ReadWriteLock.html <code>ReadWriteLock</code>] which supports ''pre-emptive'' write locks (if one thread succeeds the others waiting for the lock are interrupted). This should be of limited interest to the vast majority of developers as the pre-emptive behaviour is use transparently by gCF on removal operations. Do use as a normal read-write lock otherwise. | ||
+ | |||
+ | :* ''' <code>isRemoved()</code> and <code>remove()</code> no longer available on resources'''. | ||
+ | ::<code>isRemoved()</code> and <code>remove()</code> were defined in <code>GCUBEStatefulResource</code>. The first was intended primarily for internal usage and has been made redundant by the new locking mechanism (see above), which should be used by developers. The second was thread-unsafe as all removal operations should pass for the method <code>remove()</code> of resource homes. |
Revision as of 09:12, 5 May 2009
gCore 0.5.0RC
requires or supports the following changes to practices and implementations that are compliant with gCore 0.4.4:
Changes Related to the gHN
- package change in
ResultSet
components
- The inclusion of the
ResultSet
service and related components in gCore has coincided with a refactorisation of their package structure. In particular, fully qualified names that begun withorg.gcube.searchservice
begin now withorg.gcube.common.searchservice
.
- package change in
- new log files and log file location.
- All gCore logs are now located in
$GLOBUS_LOCATION/logs
, whilenohup.out
remains in$GLOBUS_LOCATION
(now regardless of where the$GLOBUS_LOCATION/bin/gcore-start-container
is run from). The gHN's logs remains the same (container.fulllog
,container.log
), but the local services have dedicated log files (ghnmanager.log
,deployer.log
,delegation.log
,rs.log
). Globus logs are now collected in a separate log fileglobus.log
and do not propagate to the contatainer's log files (default log level for globus isWARN
). Developers are recommended to configure service-specific logs during development. For this purpose, the configuration for local services in$GLOBUS_LOCATION/container-log4j.properties
can be used as templates.
- new lower bound on memory requirement for gHNs.
- The gHN now requires the allocation of 1GB of heap space to the JVM in which it runs. This is a production-level requirement and can be disabled or corrected during development by editing the script
$GLOBUS_LOCATION/bin/gcore-start-container
(START_OPTIONS
variable).
- new gHN configuration file for offline use.
- gCore ships with a clone of
$GLOBUS_LOCATION/config/GHNConfig.xml
called$GLOBUS_LOCATION/config/GHNConfig.client.xml
. The latter can diverge arbitrarily from the former so as to decouple offline and online use of the gHN.
- (optional) configuration of free port range for the gHN.
- Administrators and developers can now specify a
portRange
environment in$GLOBUS_LOCATION/configs/GHNConfig.xml
' (or$GLOBUS_LOCATION/configs/GHNConfig.client.xml
if useful). The value of the environment can be specified as in the following example:
<environment name="portRange" value="60000-61000" type="java.lang.String" />
- Do note the following:
- The configuration does not imply that the ports are actually 'open', only that they can be bound.
- The gHN management interface (see below) depends on the existence of this configuration.
- The first free port in this range can be obtained by invoking the method
getFreePort()
om theGHNContext
. See the Javadoc documentation for details of the signature.
- Do note the following:
- (optional) use of the JMX management interface.
- The gHN now binds a JMX managemenet interface to the port that it finds free in the configured range (see above). The bound port is shown in the gHN logs:
...GHNContext: INITIALISED MANAGEMENT INTERFACE AT service:jmx:rmi:///jndi/rmi://localhost:60000
- The interface can then be used with
jconsole
, a graphical JMX client that ships with the JDK:
- The interface can then be used with
jconsole localhost:60000
- gHN-specific and RI-specific information and operations can be found in the
MBeans
tabbed pane underorg.gcube
. In the same tabbed pane, logger and appender information and operations can be found underlog4j
.
- gHN-specific and RI-specific information and operations can be found in the
Changes Related to Services
-
GCUBEStartupPortType
is deprecated and will be removed from the next minor/major release.
- Derive now all port-type implementations from
GCUBEPortType
, regardless of the value set in their deployment descriptors forloadOnStartup
. Do note that:- The requirement that
loadOnStartup
be set totrue
for at least one port-type implementation does remain. - The requirements to derive
GCUBEPortType
are the same requirements to deriveGCUBEStartupPortType
(i.e. implement the methodgetServiceContext()
).
- The requirement that
- Note also that
GCUBEStartupPortType
is recast as a subclass ofGCUBEPortType
for this release only. - See also the Primer for more information on this requirement.
-
- New port-type and home callbacks on RI lifetime.
-
GCUBEPortType
defines callbacks for all the states of RI lifetime:onInitialisation()
,onInitialisation()
onReady()</code,onFailure()
,onUpdate()
,onStateChange()
. The same callbacks are now also defined forGCUBEWSHome
s. See the Developer's Guide for specific information on the lifetime of the RI.
- New file management methods on service contexts.
- Service contexts offer two methods to write and read files from the file system:
getFile()
andgetPersistenceFile()
. The usage model and difference between the two methods are described in detail in the Developer's Guide, first here and then here . Do notice that, changes to persistent files must be explicitly notified to the persistence manager (see below), if one is configured for the service.
- (Optional) configuration of remote backup/recovery.
- Services that wish to take advantage of the new facility for remote backup and recovery can do so by adding the a
persistenceManagerProfile
resource to theirdeploy-jndi-xml
, as follows:
<resource name="persistenceManagerProfile" type="org.gcube.common.core.persistence.GCUBERIPersistenceManagerProfile"> <resourceParams> <parameter><name>factory</name><value>org.globus.wsrf.jndi.BeanFactory</value></parameter> <parameter><name>className</name><value>org.gcube.common.smspersistence.GCUBESMSPersistenceManager</value> </parameter><parameter><name>monitoringInterval</name><value>...value in seconds...</value></parameter> </resourceParams> </resource>
- Do note the following:
-
className
specifies the class of the only SMS-based persistence manager that ships with gCore -
monitoringInterval
measures in seconds how often the persistent manager will backup the RI state, if and only if this has changed since the last backup. - changes to persisted WS-Resources are automatically detected by the persistence manager. Changes to other files below the storage root of the service must be explicitly flagged by invoking the method
notifyStateChange()
of the service context.
-
- See also the release notes for an overview of remote persistence.
- Do note the following:
- New
ISClient
interface.
- The
ISClient
interface now supports query by reference. See the Primer for examples on usage.
- New
- New
ISNotifier
interface.
- [Please summarise and point to primer section similarly to entry above].
- New
- New persistence modes for
GCUBEWSHome
.
-
GCUBEWSHome
s now can be configured to support additional modes of persistence. See the Primer for an explanation of the available modes and configuration details.
- New persistence modes for
- New locking mechanism for resources.
-
GCUBEStatefulResource
now defines a methodgetLock()
that returns a newGCUBEReadWriteLock
that can be used by cooperating threads (including gCF's of course) to synchronise their access to the resource.GCUBEReadWriteLock
is an extension of Java'sReadWriteLock
which supports pre-emptive write locks (if one thread succeeds the others waiting for the lock are interrupted). This should be of limited interest to the vast majority of developers as the pre-emptive behaviour is use transparently by gCF on removal operations. Do use as a normal read-write lock otherwise.
-
isRemoved()
andremove()
no longer available on resources.
isRemoved()
andremove()
were defined inGCUBEStatefulResource
. The first was intended primarily for internal usage and has been made redundant by the new locking mechanism (see above), which should be used by developers. The second was thread-unsafe as all removal operations should pass for the methodremove()
of resource homes.
-