Migration Guidelines from 0.4.4 to 0.5

From GCube System
Revision as of 22:08, 4 May 2009 by Fabio.simeoni (Talk | contribs) (Changes Related to Services)

Jump to: navigation, search

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 with org.gcube.searchservice begin now with org.gcube.common.searchservice.
  • new log files and log file location.
All gCore logs are now located in $GLOBUS_LOCATION/logs, while nohup.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 file globus.log and do not propagate to the contatainer's log files (default log level for globus is WARN). 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 the GHNContext. See the Javadoc documentation for details of the signature.
  • (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:
jconsole localhost:60000
gHN-specific and RI-specific information and operations can be found in the MBeans tabbed pane under org.gcube. In the same tabbed pane, logger and appender information and operations can be found under log4j.

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 for loadOnStartup. Do note that:
  • The requirement that loadOnStartup be set to true for at least one port-type implementation does remain.
  • The requirements to derive GCUBEPortType are the same requirements to derive GCUBEStartupPortType (i.e. implement the method getServiceContext()).
Note also that GCUBEStartupPortType is recast as a subclass of GCUBEPortType for this release only.
See also the Primer for more information on this requirement.
  • New port-type callbacks on RI lifetime.
GCUBEPortType defines callbacks for all the states of RI lifetime: onInitialisation(), onInitialisation()onReady()</code, onFailure(), onUpdate(),onStateChange(). 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() and getPersistenceFile(). 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 their deploy-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:
  • <name>className</name> specifies the class of the only SMS-based persistence manager that ships with gCore
  • <name>monitoringInterval</name> 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.