|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ikasan.framework.initiator.AbstractInitiator
org.ikasan.framework.initiator.messagedriven.JmsMessageDrivenInitiatorImpl
public abstract class JmsMessageDrivenInitiatorImpl
Abstract base class for JMS Message Driven Initiators
Subclasses will provide an implementation for handling of one or more of the specific JMS Message types into an
Event
| Field Summary | |
|---|---|
protected org.ikasan.framework.initiator.messagedriven.JmsMessageDrivenInitiatorImpl.Anesthetist |
anesthetist
The Anesthetist for stopping/starting the message listener container |
static String |
JMS_MESSAGE_DRIVEN_INITIATOR_TYPE
|
protected MessageListenerContainer |
messageListenerContainer
The message listener container |
| Fields inherited from class org.ikasan.framework.initiator.AbstractInitiator |
|---|
error, errorLoggingService, EXCEPTION_ACTION_IMPLIED_ROLLBACK, exceptionHandler, excludedEventService, exclusions, flow, moduleName, monitorListeners, name, retryCount, stopping, UNSUPPORTED_EXCLUDE_ENCONTERED |
| Constructor Summary | |
|---|---|
JmsMessageDrivenInitiatorImpl(String moduleName,
String name,
Flow flow,
IkasanExceptionHandler exceptionHandler)
Constructor |
|
| Method Summary | |
|---|---|
protected boolean |
anesthetistOperating()
Return true if the anesthetist is operating |
protected void |
cancelRetryCycle()
Cancels retry activity |
protected void |
completeRetryCycle()
Cancel the retry activity, and resume any business as usual activity |
protected void |
continueRetryCycle(long delay)
Template method for subclasses to selectively override |
MessageListenerContainer |
getMessageListenerContainer()
Accessor for messageListenerContainer |
String |
getType()
Returns the type of the initiator |
protected Event |
handleBytesMessage(javax.jms.BytesMessage message)
JMS Message specific type handling for BytesMessage
Subclasses that wish to support this Message type will override this |
protected Event |
handleMapMessage(javax.jms.MapMessage message)
JMS Message specific type handling for MapMessage
Subclasses that wish to support this Message type will override this |
protected Event |
handleObjectMessage(javax.jms.ObjectMessage message)
JMS Message specific type handling for ObjectMessage
Subclasses that wish to support this Message type will override this |
protected Event |
handleStreamMessage(javax.jms.StreamMessage message)
JMS Message specific type handling for StreamMessage
Subclasses that wish to support this Message type will override this |
protected Event |
handleTextMessage(javax.jms.TextMessage message)
JMS Message specific type handling for TextMessage
Subclasses that wish to support this Message type will override this |
boolean |
isRecovering()
Is this initiator in a recovering state. |
boolean |
isRunning()
Is this initiator running. |
void |
notifyListenerSetupFailure(Throwable throwable)
Notify error during listener setup |
void |
onMessage(javax.jms.Message message)
|
void |
setListenerSetupFailureRetryDelay(int listenerSetupFailureRetryDelay)
Setter for overriding the default value (10000)of listenerSetupFailureRetryDelay |
void |
setMaxListenerSetupFailureRetries(int maxListenerSetupFailureRetries)
Setter for overriding the default value (Indefinite) of listenerSetupFailureRetryDelay |
void |
setMessageListenerContainer(MessageListenerContainer messageListenerContainer)
|
protected void |
startInitiator()
Only the extending class knows how to start the initiator. |
protected void |
startRetryCycle(Integer maxAttempts,
long delay)
Initiator needs to start a retry cycle due to an exception action. |
protected void |
stopInitiator()
Only the extending class knows how to stop the initiator. |
| Methods inherited from class org.ikasan.framework.initiator.AbstractInitiator |
|---|
addListener, getExceptionHandler, getExclusions, getFlow, getHandledEventCount, getLastEventTime, getLogger, getModuleName, getMonitorListeners, getName, getRetryCount, getState, handleAction, handleRetry, invokeFlow, invokeFlow, isError, isStopping, logError, notifyMonitorListeners, removeListener, resume, setErrorLoggingService, setExcludedEventService, start, stop, stopInError, supportsExclusions |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.ikasan.framework.initiator.Initiator |
|---|
getExceptionHandler, getFlow, getHandledEventCount, getLastEventTime, getName, getRetryCount, getState, isError, start, stop |
| Methods inherited from interface org.ikasan.framework.monitor.MonitorSubject |
|---|
addListener, removeListener |
| Field Detail |
|---|
public static final String JMS_MESSAGE_DRIVEN_INITIATOR_TYPE
protected MessageListenerContainer messageListenerContainer
protected org.ikasan.framework.initiator.messagedriven.JmsMessageDrivenInitiatorImpl.Anesthetist anesthetist
| Constructor Detail |
|---|
public JmsMessageDrivenInitiatorImpl(String moduleName,
String name,
Flow flow,
IkasanExceptionHandler exceptionHandler)
moduleName - The name of the modulename - The name of this initiatorflow - The name of the flow it startsexceptionHandler - handler for Exceptions| Method Detail |
|---|
public String getType()
Initiator
getType in interface Initiatorpublic void onMessage(javax.jms.Message message)
onMessage in interface javax.jms.MessageListenerprotected void completeRetryCycle()
AbstractInitiator
completeRetryCycle in class AbstractInitiator
protected void startRetryCycle(Integer maxAttempts,
long delay)
AbstractInitiator
startRetryCycle in class AbstractInitiatordelay - The delay in milliseconds before we perform a retryprotected void continueRetryCycle(long delay)
AbstractInitiator
continueRetryCycle in class AbstractInitiatorprotected void cancelRetryCycle()
AbstractInitiator
cancelRetryCycle in class AbstractInitiatorpublic boolean isRecovering()
Initiator
isRecovering in interface Initiatorpublic boolean isRunning()
Initiator
isRunning in interface Initiatorprotected boolean anesthetistOperating()
protected void startInitiator()
AbstractInitiator
startInitiator in class AbstractInitiatorprotected void stopInitiator()
AbstractInitiator
stopInitiator in class AbstractInitiatorpublic void setMessageListenerContainer(MessageListenerContainer messageListenerContainer)
messageListenerContainer - the messageListenerContainer to setpublic MessageListenerContainer getMessageListenerContainer()
getMessageListenerContainer in interface JmsMessageDrivenInitiatorpublic void notifyListenerSetupFailure(Throwable throwable)
ListenerSetupFailureListener
notifyListenerSetupFailure in interface ListenerSetupFailureListener
protected Event handleBytesMessage(javax.jms.BytesMessage message)
throws javax.jms.JMSException
BytesMessage
Subclasses that wish to support this Message type will override this
message - The message to handle
javax.jms.JMSException - Exception if there is a problem with JMS
protected Event handleStreamMessage(javax.jms.StreamMessage message)
throws javax.jms.JMSException,
EventDeserialisationException
StreamMessage
Subclasses that wish to support this Message type will override this
message - The message to handle
javax.jms.JMSException
EventDeserialisationException
protected Event handleObjectMessage(javax.jms.ObjectMessage message)
throws javax.jms.JMSException,
EventDeserialisationException
ObjectMessage
Subclasses that wish to support this Message type will override this
message - The message to handle
javax.jms.JMSException - Exception if there is a problem with JMS
EventDeserialisationException
protected Event handleMapMessage(javax.jms.MapMessage message)
throws javax.jms.JMSException,
EventDeserialisationException
MapMessage
Subclasses that wish to support this Message type will override this
message - The message to handle
javax.jms.JMSException - Exception if there is a problem with JMS
EventDeserialisationException
protected Event handleTextMessage(javax.jms.TextMessage message)
throws javax.jms.JMSException,
EventDeserialisationException
TextMessage
Subclasses that wish to support this Message type will override this
message - The message to handle
javax.jms.JMSException - Exception if there is a problem with JMS
EventDeserialisationExceptionpublic void setListenerSetupFailureRetryDelay(int listenerSetupFailureRetryDelay)
listenerSetupFailureRetryDelay - in millisecondspublic void setMaxListenerSetupFailureRetries(int maxListenerSetupFailureRetries)
maxListenerSetupFailureRetries -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||