org.figure8.join.services.notification
Class SubscribersNotifierJMSAdapter

java.lang.Object
  extended by org.figure8.join.services.notification.SubscribersNotifierAdapterSupport
      extended by org.figure8.join.services.notification.SubscribersNotifierJMSAdapter
All Implemented Interfaces:
javax.jms.MessageListener, Configurable, JMSConsumerBean
Direct Known Subclasses:
GoogleTalkNotifierJMSAdapter, MailNotifierJMSAdapter, XMPPNotifierJMSAdapter

public abstract class SubscribersNotifierJMSAdapter
extends SubscribersNotifierAdapterSupport
implements JMSConsumerBean

This is a base class for JMS consumers that wants to notify subscribers when a new message arrive. It acts as an adapter between the JMS world and the SubscribersNotifier facilities.
This class is a JMSConsumerBean that is Configurable : it defines a mandatory parameter that should be a PropertiesExtractor impl. This extractor help the transition from a JMS view (that is object message based) to a notification content view (a template with curly braced varaibles representing object properties).
Extensions of this class should specifiy which SubscribersNotifier implementation to use when running scripts.

Version:
$Revision: 1.1 $
Author:
Laurent Broudoux
See Also:
Configurable, JMSConsumerBean, PropertiesExtractor

Field Summary
protected static ParameterDefinition extractionParam
          ParameterDefinition representation of parameter denoting the propertiesExtractor to use.
static java.lang.String EXTRACTOR_PARAM
          Name of configurable parameter denoting the propertiesExtractor to use for getting props.
protected static java.util.List parameters
          List of ParameterDefinitions supported by this adapter
static java.lang.String RESOURCE_PROP_PARAM
          Name of configurable parameter denoting the object property representing the key of resource to notify event for
protected static ParameterDefinition resourcePropParam
          ParameterDefinition representation of parameter denoting the key of resource to notify event for.
 
Fields inherited from class org.figure8.join.services.notification.SubscribersNotifierAdapterSupport
EVENT_PARAM, eventParam, name, RESOURCE_PARAM, resourceParam
 
Constructor Summary
SubscribersNotifierJMSAdapter()
           
 
Method Summary
 java.util.List getParameterDefinitionsAsList()
          Get this object parameters definitions as a list
 void onMessage(javax.jms.Message message)
          This method is executed on message delivery.
 void setParameter(java.lang.String parameterName, java.lang.String parameterValue)
          Set the value of a parameter using its name
 void setPropertiesExtractorClass(java.lang.String extractorClass)
          Specify the class of PropertiesExtractor implementation to use
 void setResourceProperty(java.lang.String resourceProperty)
           
 void stop()
          Implement this method to stop current process and free resources.
 
Methods inherited from class org.figure8.join.services.notification.SubscribersNotifierAdapterSupport
getEventKey, getName, getParameterDefinitions, getResourceKey, getSubscribersNotifier, retrieveMailingList, retrieveReportingService, retrieveSubscribers, setEventKey, setName, setParameter, setParameters, setResourceKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.figure8.join.core.messaging.JMSConsumerBean
getName, setName
 

Field Detail

RESOURCE_PROP_PARAM

public static final java.lang.String RESOURCE_PROP_PARAM
Name of configurable parameter denoting the object property representing the key of resource to notify event for

See Also:
Constant Field Values

EXTRACTOR_PARAM

public static final java.lang.String EXTRACTOR_PARAM
Name of configurable parameter denoting the propertiesExtractor to use for getting props.

See Also:
Constant Field Values

parameters

protected static java.util.List parameters
List of ParameterDefinitions supported by this adapter


resourcePropParam

protected static final ParameterDefinition resourcePropParam
ParameterDefinition representation of parameter denoting the key of resource to notify event for.


extractionParam

protected static final ParameterDefinition extractionParam
ParameterDefinition representation of parameter denoting the propertiesExtractor to use.

Constructor Detail

SubscribersNotifierJMSAdapter

public SubscribersNotifierJMSAdapter()
Method Detail

setResourceProperty

public void setResourceProperty(java.lang.String resourceProperty)
Parameters:
resourceProperty - Property representing resource

setPropertiesExtractorClass

public void setPropertiesExtractorClass(java.lang.String extractorClass)
                                 throws InvalidParameterException
Specify the class of PropertiesExtractor implementation to use

Parameters:
extractorClass - The FQN of Java class representing PropertiesExtractor impl
Throws:
InvalidParameterException - if extractorClass is not found or does not implement the PropertiesExtractor interface

onMessage

public void onMessage(javax.jms.Message message)
This method is executed on message delivery. This implementation only process message of type ObjectMessage. The process is the following :
first: retrieve object from message and eventually extract its properties,

Specified by:
onMessage in interface javax.jms.MessageListener
Parameters:
message -

stop

public void stop()
Implement this method to stop current process and free resources. This method should not throw exceptions.

Specified by:
stop in interface JMSConsumerBean

getParameterDefinitionsAsList

public java.util.List getParameterDefinitionsAsList()
Get this object parameters definitions as a list

Specified by:
getParameterDefinitionsAsList in interface Configurable
Overrides:
getParameterDefinitionsAsList in class SubscribersNotifierAdapterSupport
Returns:
A list of ParameterDefinition objects

setParameter

public void setParameter(java.lang.String parameterName,
                         java.lang.String parameterValue)
                  throws InvalidParameterException
Set the value of a parameter using its name

Specified by:
setParameter in interface Configurable
Overrides:
setParameter in class SubscribersNotifierAdapterSupport
Parameters:
parameterName - The name of parameter so set value for
parameterValue - The value of the paramater
Throws:
InvalidParameterException - if this parameter is not supported by this object


Copyright © 2005-2008 Join. All Rights Reserved.