|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.turbine.services.BaseInitable org.apache.turbine.services.BaseService org.apache.turbine.services.TurbineBaseService org.apache.jetspeed.services.messaging.jms.AbstractJMSMessagingService
This class provides basic functionality for accessing the JMS server. This implementation conforms to the JMS 1.1 specification. New implementations of a JMS Messaging Service should extend this class and implement the createConnection method. Also, any default variables that need to be set should be added to a default constructor.
Field Summary | |
protected int |
ackMode
|
protected static java.lang.String |
AUTO_ACKNOWLEDGE
|
protected static java.lang.String |
CLIENT_ACKNOWLEDGE
|
protected static java.lang.String |
CONFIG_ACK_MODE
|
protected static java.lang.String |
CONFIG_CONNECTION_FACTORY
|
protected static java.lang.String |
CONFIG_DELIVERY_MODE
|
protected static java.lang.String |
CONFIG_DURABLE
|
protected static java.lang.String |
CONFIG_HOST
|
protected static java.lang.String |
CONFIG_NAME
|
protected static java.lang.String |
CONFIG_NOLOCAL
|
protected static java.lang.String |
CONFIG_PORT
|
protected static java.lang.String |
CONFIG_PRIORITY
|
protected static java.lang.String |
CONFIG_SCHEME
|
protected static java.lang.String |
CONFIG_TIME_TO_LIVE
|
protected static java.lang.String |
CONFIG_TOPIC
|
protected static java.lang.String |
CONFIG_TRANSACTED
|
protected static java.lang.String |
CONFIG_URL
|
protected javax.jms.Connection |
connection
|
protected java.lang.String |
connectionFactory
|
protected java.util.Hashtable |
consumers
|
protected int |
DEFAULT_ACK_MODE
|
protected java.lang.String |
DEFAULT_CONNECTION_FACTORY
|
protected int |
DEFAULT_DELIVERY_MODE
|
protected boolean |
DEFAULT_DURABLE
|
protected java.lang.String |
DEFAULT_HOST
|
protected java.lang.String |
DEFAULT_NAME
|
protected boolean |
DEFAULT_NOLOCAL
|
protected java.lang.String |
DEFAULT_PORT
|
protected int |
DEFAULT_PRIORITY
|
protected java.lang.String |
DEFAULT_SCHEME
|
protected int |
DEFAULT_TIME_TO_LIVE
|
protected boolean |
DEFAULT_TOPIC
|
protected boolean |
DEFAULT_TRANSACTED
|
protected java.lang.String |
DEFAULT_URL
|
protected int |
deliveryMode
|
protected java.util.Hashtable |
destinations
|
protected static java.lang.String |
DUPS_OK_ACKNOWLEDGE
|
protected boolean |
durable
|
protected java.lang.String |
host
|
protected java.lang.String |
initialContextFactory
|
protected java.lang.String |
name
|
protected boolean |
nolocal
|
protected static java.lang.String |
NON_PERSISTENT
|
protected static java.lang.String |
PERSISTENT
|
protected java.lang.String |
port
|
protected int |
priority
|
protected java.util.Hashtable |
producers
|
protected java.lang.String |
scheme
|
protected javax.jms.Session |
session
|
protected int |
timeToLive
|
protected boolean |
transacted
|
protected java.lang.String |
url
|
protected boolean |
use_topic
|
Fields inherited from class org.apache.turbine.services.BaseService |
configuration, properties, serviceBroker |
Fields inherited from class org.apache.turbine.services.BaseInitable |
initableBroker, isInitialized |
Fields inherited from interface org.apache.jetspeed.services.messaging.MessagingService |
BYTE_MESSAGE, GROUP_UPDATE_SUBJECT, MAP_MESSAGE, MESSAGE, OBJECT_MESSAGE, PSML_UPDATE_SUBJECT, REGISTRY_UPDATE_SUBJECT, ROLE_UPDATE_SUBJECT, SECURITY_CACHE_UPDATE_SUBJECT, SECURITY_UPDATE_SUBJECT, SERVICE_NAME, STREAM_MESSAGE, TEXT_MESSAGE, USER_UPDATE_SUBJECT |
Fields inherited from interface org.apache.turbine.services.Service |
SERVICE_NAME |
Constructor Summary | |
AbstractJMSMessagingService()
|
Method Summary | |
void |
addMessageListener(javax.jms.MessageListener listener,
java.lang.String id,
java.lang.String destination)
This method creates a new consumer if one with the given id has not been created. |
protected abstract void |
createConnection()
Create the connection the the JMS Server |
javax.jms.MessageConsumer |
createConsumer(java.lang.String destination)
This method creates a new MessageConsumer. |
javax.jms.Message |
createMessage(int messageType)
Create a message based on the give type |
protected void |
createSession()
Create the JMS Session |
protected javax.naming.Context |
getContext()
Genereate a JNDI context using the context factory and the provider url |
protected javax.jms.Destination |
getDestination(java.lang.String destination)
|
protected javax.jms.MessageProducer |
getProducer(java.lang.String destination)
Return the producer based on the given destination. |
protected java.lang.String |
getProviderURL()
Return the url if it was configured, othewise, generate the url from the scheme, host, port, and name properties |
void |
init(javax.servlet.ServletConfig conf)
This is the early initialization method called by the Turbine Service framework |
protected void |
initJMSConfiguration()
Initialize the JMS Configuration |
protected java.lang.String |
printAckMode()
Helper method to print the acknowledgement mode |
protected java.lang.String |
printDeliveryMode()
Helper method to print the delivery mode |
void |
removeMessageListener(java.lang.String id)
Remove a message listener that was added to the service previously via the addMessageListener method. |
void |
sendMessage(javax.jms.Message message,
java.lang.String destination)
Send a message to the chose destination |
void |
shutdown()
This is the shutdown method called by the Turbine Service framework |
Methods inherited from class org.apache.turbine.services.TurbineBaseService |
init, init, init |
Methods inherited from class org.apache.turbine.services.BaseService |
getConfiguration, getName, getProperties, getServiceBroker, setName, setServiceBroker |
Methods inherited from class org.apache.turbine.services.BaseInitable |
getInit, getInitableBroker, setInit, setInitableBroker |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.turbine.services.Initable |
getInit, setInitableBroker |
Field Detail |
protected static final java.lang.String CONFIG_SCHEME
protected static final java.lang.String CONFIG_HOST
protected static final java.lang.String CONFIG_PORT
protected static final java.lang.String CONFIG_NAME
protected static final java.lang.String CONFIG_URL
protected static final java.lang.String CONFIG_CONNECTION_FACTORY
protected static final java.lang.String CONFIG_TRANSACTED
protected static final java.lang.String CONFIG_ACK_MODE
protected static final java.lang.String CONFIG_TOPIC
protected static final java.lang.String CONFIG_DURABLE
protected static final java.lang.String CONFIG_NOLOCAL
protected static final java.lang.String CONFIG_DELIVERY_MODE
protected static final java.lang.String CONFIG_PRIORITY
protected static final java.lang.String CONFIG_TIME_TO_LIVE
protected java.lang.String DEFAULT_SCHEME
protected java.lang.String DEFAULT_HOST
protected java.lang.String DEFAULT_PORT
protected java.lang.String DEFAULT_NAME
protected java.lang.String DEFAULT_URL
protected java.lang.String DEFAULT_CONNECTION_FACTORY
protected boolean DEFAULT_TRANSACTED
protected int DEFAULT_ACK_MODE
protected boolean DEFAULT_TOPIC
protected boolean DEFAULT_DURABLE
protected boolean DEFAULT_NOLOCAL
protected int DEFAULT_DELIVERY_MODE
protected int DEFAULT_PRIORITY
protected int DEFAULT_TIME_TO_LIVE
protected static final java.lang.String AUTO_ACKNOWLEDGE
protected static final java.lang.String CLIENT_ACKNOWLEDGE
protected static final java.lang.String DUPS_OK_ACKNOWLEDGE
protected static final java.lang.String PERSISTENT
protected static final java.lang.String NON_PERSISTENT
protected java.lang.String scheme
protected java.lang.String host
protected java.lang.String port
protected java.lang.String name
protected java.lang.String url
protected java.lang.String connectionFactory
protected java.lang.String initialContextFactory
protected int deliveryMode
protected int priority
protected int timeToLive
protected boolean transacted
protected int ackMode
protected boolean use_topic
protected boolean durable
protected boolean nolocal
protected java.util.Hashtable destinations
protected java.util.Hashtable consumers
protected java.util.Hashtable producers
protected javax.jms.Connection connection
protected javax.jms.Session session
Constructor Detail |
public AbstractJMSMessagingService()
Method Detail |
public void init(javax.servlet.ServletConfig conf) throws org.apache.turbine.services.InitializationException
Service
framework
org.apache.turbine.services.InitializationException
protected void initJMSConfiguration()
protected java.lang.String printAckMode()
protected java.lang.String printDeliveryMode()
protected java.lang.String getProviderURL()
protected javax.naming.Context getContext() throws javax.naming.NamingException
javax.naming.NamingException
protected void createSession() throws javax.jms.JMSException
javax.jms.JMSException
protected abstract void createConnection() throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.Message createMessage(int messageType)
MessagingService
createMessage
in interface MessagingService
messageType
-
MessagingService.createMessage(int)
public void shutdown()
Service
framework
shutdown
in interface org.apache.turbine.services.Initable
public void addMessageListener(javax.jms.MessageListener listener, java.lang.String id, java.lang.String destination)
MessagingService
addMessageListener
in interface MessagingService
listener
- id
- destination
- org.apache.jetspeed.services.messaging.MessagingService#addMessageListener(java.lang.Object)
public javax.jms.MessageConsumer createConsumer(java.lang.String destination)
MessagingService
createConsumer
in interface MessagingService
destination
- MessagingService.createConsumer(java.lang.String)
public void removeMessageListener(java.lang.String id)
MessagingService
removeMessageListener
in interface MessagingService
id
- MessagingService.removeMessageListener(java.lang.String)
public void sendMessage(javax.jms.Message message, java.lang.String destination)
MessagingService
sendMessage
in interface MessagingService
message
- destination
- org.apache.jetspeed.services.messaging.MessagingService#sendMessage(java.lang.Object)
protected javax.jms.Destination getDestination(java.lang.String destination)
protected javax.jms.MessageProducer getProducer(java.lang.String destination)
destination
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |