org.globus.ogsa.impl.core.notification
Class JMSAdapter

java.lang.Object
  extended byorg.globus.ogsa.impl.core.service.ServicePropertiesImpl
      extended byorg.globus.ogsa.impl.ogsi.GridServiceImpl
          extended byorg.globus.ogsa.impl.core.notification.JMSAdapter
All Implemented Interfaces:
GridService, GridServiceBase, GridServiceCallback, java.rmi.Remote, ServiceDataValueCallback, ServiceProperties

public class JMSAdapter
extends GridServiceImpl

This class connects the Java Messaging Service to the OGSA notification system. First call start(), then either
jmsToOgsa() if jms is publishing and ogsa is subscribing
or
ogsaToJMS() if ogsa is publishing and jms is subscribing.
and then stop() when you are done. jmsToOgsa and ogsaToJMS hook up one topic at a time and can be called more than once on a single instance of the JMSAdapter to hook up more than one topic. It will pull the JNDI initial context parameters: java.naming.factory.initial, java.naming.provider.url, and java.naming.factory.url.pkgs from the server-config.wsdd file, if you need to set any others you must call setInitialJndiProperty() before calling start(). It uses Session.AUTO_ACKNOWLEDGE on the JMS side, so delivery is not guaranteed.


Nested Class Summary
static class JMSAdapter.AdapterListener
           
static class JMSAdapter.JMSListener
           
static class JMSAdapter.OGSAListener
           
 
Field Summary
 
Fields inherited from class org.globus.ogsa.impl.ogsi.GridServiceImpl
queryEngine, serviceData
 
Fields inherited from interface org.globus.ogsa.ServiceProperties
ACTIVATE_ON_STARTUP, ACTIVATION, BASE_CLASS_NAME, BOOTSTRAP, CONFIG_PATH, CONTAINS_REFERENCE, CREATION_EXTENSIBILITY, CREATION_EXTENSIBILITY_OUTPUT, CUSTOM_EXTENSIBILITY_DESERIALIZER, CUSTOM_EXTENSIBILITY_SERIALIZER, CUSTOM_MAPPING_REGISTERED, DEACTIVATED_PERSISTENT, DEACTIVATED_STATE, DEACTIVATED_TRANSIENT, DEACTIVATION, DESTROY_LISTENER, DESTRUCTION_SKELETON, DISABLE_FACTORY_REGISTRY, ENDPOINT, ENTRY_INSTANCE_CREATION, FACTORY, FACTORY_CALLBACK, FACTORY_HANDLE, FACTORY_PROVIDER, FACTORY_REGISTRY, GSR_DESCRIPTION, HANDLE, HANDLE_PORT, HANDLE_PROTOCOL, INSTANCE_CLASS, INSTANCE_DEACTIVATION, INSTANCE_GSR_DESCRIPTION, INSTANCE_LIFECYCLE, INSTANCE_PORT_TYPE, INSTANCE_PORT_TYPE_NS, INSTANCE_PREFIX, INSTANCE_REGISTRY, INSTANCE_SCHEMA_PATH, INSTANCE_WSDL, INTERFACE_CLASS_NAME, INVOCATION_ID, LAZY_CREATION, LIFECYCLE, LIFECYCLE_MONITOR, LIFECYCLE_MONITOR_CLASS, NAME, NOTIFICATION_ENGINE, NOTIFICATION_FACTORY, NOTIFICATION_SOURCE, OPERATION_PROVIDERS, PERSISTENT, PERSISTENT_PROPERTIES, PORT, PORT_TYPE, PORT_TYPE_NS, PRIMARY_KEY, PROTOCOL, QUERY_ENGINE, REDIRECT_RESOLVER, REGISTRY, RESOLVER_CACHE, ROUTER_HEADER, ROUTER_VIA, SCHEMA_LOCATION, SCHEMA_PATH, SERVICE_ACTIVATOR, SERVICE_DATA, SERVICE_DEPLOYMENT, SERVICE_GROUP_ENTRY, SERVICE_GROUP_PROVIDER, SERVICE_LOADER, SERVICE_NODE, SERVICE_PATH, SINK_ID, STARTUP_STATE, SWEEP_SERVICE_DATA, TIMEOUT, TIMESTAMP, TRANSIENT, TYPE, USER, WEBSTART_PANEL_NAME, WEBSTART_URL, WSDL
 
Constructor Summary
JMSAdapter()
           
 
Method Summary
 void destroy()
           
 void disconnectTopic(java.lang.String jmsTopicName)
          Disconnects a single topic so messages are no longer forwarded.
 void finalize()
           
 void jmsToOgsa(java.lang.String jmsTopicName, java.lang.String ogsaTopicName, java.lang.String jmsToOgsaConverterClassName)
          Connects to an existing JMS topic and forwards all its messages to a new OGSA topic.
 void jmsToOgsaSimple(java.lang.String topicName)
          Connects to an existing JMS topic and forwards all its messages to a new OGSA topic.
 void ogsaToJMS(java.lang.String ogsaSourceUrlString, java.lang.String ogsaTopicName, java.lang.String jmsTopicName, java.lang.String ogsaToJMSConverterClassName)
          Connects to an existing ogsa topic and forwards all its messages to an existing jms topic.
 void ogsaToJMSSimple(java.lang.String ogsaSourceUrlString, java.lang.String topicName)
          Connects to an existing ogsa topic and forwards all its messages to an existing jms topic.
 void postCreate(GridContext context)
          called when a service has been created and all of its configuration has been set up.
 void setInitialJndiProperty(java.lang.String key, java.lang.String value)
          Sets a parameter to the JNDI InitialContext that is created when you call start().
 void start(java.lang.String jmsTopicFactoryName)
          Starts the JMSAdapter and looks up the JMS TopicConnectionFactory.
 void stop()
          Stops everything and frees resources.
 
Methods inherited from class org.globus.ogsa.impl.ogsi.GridServiceImpl
activate, addOperationProvider, deactivate, findServiceData, getInstanceProperty, getOperationProvider, getQueryEngine, getServiceDataSet, getServiceDataValues, getServiceInterface, getTerminationTime, populateInstanceProperties, preCreate, preDestroy, requestTerminationAfter, requestTerminationBefore, setDefaultTermination, setQueryEngine, setServiceData, setServiceDataSet
 
Methods inherited from class org.globus.ogsa.impl.core.service.ServicePropertiesImpl
flush, getPersistentProperty, getProperty, keySet, setPersistentProperty, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.globus.ogsa.ServiceProperties
flush, getPersistentProperty, getProperty, setPersistentProperty, setProperty
 

Constructor Detail

JMSAdapter

public JMSAdapter()
Method Detail

postCreate

public void postCreate(GridContext context)
                throws GridServiceException
Description copied from interface: GridServiceCallback
called when a service has been created and all of its configuration has been set up.

Specified by:
postCreate in interface GridServiceCallback
Overrides:
postCreate in class GridServiceImpl
Throws:
GridServiceException

setInitialJndiProperty

public void setInitialJndiProperty(java.lang.String key,
                                   java.lang.String value)
Sets a parameter to the JNDI InitialContext that is created when you call start(). All calls to this method should be made before calling start().


start

public void start(java.lang.String jmsTopicFactoryName)
           throws JMSAdapterException
Starts the JMSAdapter and looks up the JMS TopicConnectionFactory.

Throws:
JMSAdapterException

disconnectTopic

public void disconnectTopic(java.lang.String jmsTopicName)
Disconnects a single topic so messages are no longer forwarded. This breaks the connection established by jmsToOgsa or ogsaToJMS. Notice that the parameter is always the JMS topic name.


stop

public void stop()
Stops everything and frees resources. This calls disconnectTopic() for every topic.


destroy

public void destroy()
             throws java.rmi.RemoteException,
                    FaultType,
                    ServiceNotDestroyedFaultType
Specified by:
destroy in interface GridService
Overrides:
destroy in class GridServiceImpl
Throws:
java.rmi.RemoteException
FaultType
ServiceNotDestroyedFaultType

finalize

public void finalize()

jmsToOgsaSimple

public void jmsToOgsaSimple(java.lang.String topicName)
                     throws JMSAdapterException
Connects to an existing JMS topic and forwards all its messages to a new OGSA topic. Uses the default message converter and the same name for both topics. The "source url" of the ogsa topic is the url of the JMSAdapter, something like "http://localhost:8080/ogsa/services/base/jmsadapter/JMSAdapterFactoryService/myInstance"

Throws:
JMSAdapterException

jmsToOgsa

public void jmsToOgsa(java.lang.String jmsTopicName,
                      java.lang.String ogsaTopicName,
                      java.lang.String jmsToOgsaConverterClassName)
               throws JMSAdapterException
Connects to an existing JMS topic and forwards all its messages to a new OGSA topic.

Parameters:
jmsTopicName - The name of the existing jms topic
ogsaTopicName - The name of the new ogsa topic it will create.
jmsToOgsaConverterClassName - Fully qualified name of the class to use to convert a jms message to an ogsa message. It must implement org.globus.ogsa.impl.base.jmsadapter.JMSToOgsaConverter
Throws:
JMSAdapterException

ogsaToJMSSimple

public void ogsaToJMSSimple(java.lang.String ogsaSourceUrlString,
                            java.lang.String topicName)
                     throws JMSAdapterException
Connects to an existing ogsa topic and forwards all its messages to an existing jms topic. Uses the default message converter and the same name for both topics.

Throws:
JMSAdapterException

ogsaToJMS

public void ogsaToJMS(java.lang.String ogsaSourceUrlString,
                      java.lang.String ogsaTopicName,
                      java.lang.String jmsTopicName,
                      java.lang.String ogsaToJMSConverterClassName)
               throws JMSAdapterException
Connects to an existing ogsa topic and forwards all its messages to an existing jms topic.

Parameters:
ogsaToJMSConverterClassName - Fully qualified name of the class to use to convert an ogsa message to a jms message. It must implement org.globus.ogsa.impl.base.jmsadapter.OgsaToJMSConverter. Can be null, which becomes org.globus.ogsa.impl.base.jmsadapter.DefaultOgsaToJMSConverter
Throws:
JMSAdapterException


Copyright © 1999 University of Chicago and The University of Southern California. All Rights Reserved.