Package org.apache.ofbiz.service.jms
Class AbstractJmsListener
java.lang.Object
org.apache.ofbiz.service.jms.AbstractJmsListener
- All Implemented Interfaces:
javax.jms.ExceptionListener
,javax.jms.MessageListener
,GenericMessageListener
- Direct Known Subclasses:
JmsQueueListener
,JmsTopicListener
public abstract class AbstractJmsListener
extends Object
implements GenericMessageListener, javax.jms.ExceptionListener
AbstractJmsListener
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractJmsListener
(Delegator delegator) Initializes the LocalDispatcher for this service listener. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Indicator if a connection is present.void
onException
(javax.jms.JMSException je) On exception try to re-establish connection to the JMS server.void
onMessage
(javax.jms.Message message) Receives the MapMessage and processes the service.void
refresh()
Refresh the connection.runService
(javax.jms.MapMessage message) Runs the service defined in the MapMessageprotected void
setConnected
(boolean connected) Setter method for the connected field.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.ofbiz.service.jms.GenericMessageListener
close, load
-
Constructor Details
-
AbstractJmsListener
Initializes the LocalDispatcher for this service listener.- Parameters:
delegator
- the delegator associated to the dispatcher
-
-
Method Details
-
runService
Runs the service defined in the MapMessage- Parameters:
message
-- Returns:
- Map
-
onMessage
public void onMessage(javax.jms.Message message) Receives the MapMessage and processes the service.- Specified by:
onMessage
in interfacejavax.jms.MessageListener
- See Also:
-
MessageListener.onMessage(Message)
-
onException
public void onException(javax.jms.JMSException je) On exception try to re-establish connection to the JMS server.- Specified by:
onException
in interfacejavax.jms.ExceptionListener
- See Also:
-
ExceptionListener.onException(JMSException)
-
refresh
Description copied from interface:GenericMessageListener
Refresh the connection.- Specified by:
refresh
in interfaceGenericMessageListener
- Throws:
GenericServiceException
-
isConnected
public boolean isConnected()Description copied from interface:GenericMessageListener
Indicator if a connection is present.- Specified by:
isConnected
in interfaceGenericMessageListener
- Returns:
- true if connectio is present.
-
setConnected
protected void setConnected(boolean connected) Setter method for the connected field.- Parameters:
connected
-
-