org.activemq.web
Class WebClient

java.lang.Object
  extended by org.activemq.web.WebClient
All Implemented Interfaces:
Externalizable, Serializable, EventListener, HttpSessionActivationListener

public class WebClient
extends Object
implements HttpSessionActivationListener, Externalizable

Represents a messaging client used from inside a web container typically stored inside a HttpSession

Version:
$Revision: 1.1.1.1 $
See Also:
Serialized Form

Nested Class Summary
protected static class WebClient.SessionConsumerPair
           
 
Field Summary
static String brokerUrlInitParam
           
static String connectionFactoryAttribute
           
static String embeddedBrokerInitParam
           
static String queueConsumersAttribute
           
static String webClientAttribute
           
 
Constructor Summary
WebClient()
          Only called by serialization
WebClient(ServletContext context)
           
 
Method Summary
protected  org.activemq.ActiveMQSession createSession()
           
protected  WebClient.SessionConsumerPair createSessionConsumerPair(Destination destination)
           
 org.activemq.ActiveMQConnection getConnection()
           
 MessageConsumer getConsumer(Destination destination)
           
 int getDeliveryMode()
           
 Session getSession()
           
static WebClient getWebClient(HttpSession session)
           
static ConnectionFactory initConnectionFactory(ServletContext servletContext)
           
static void initContext(ServletContext context)
           
static Map initQueueConsumers(ServletContext context)
           
 void readExternal(ObjectInput in)
           
 void send(Destination destination, Message message)
           
 void sessionDidActivate(HttpSessionEvent event)
           
 void sessionWillPassivate(HttpSessionEvent event)
           
 void setDeliveryMode(int deliveryMode)
           
 void start()
           
 void stop()
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

webClientAttribute

public static final String webClientAttribute
See Also:
Constant Field Values

connectionFactoryAttribute

public static final String connectionFactoryAttribute
See Also:
Constant Field Values

queueConsumersAttribute

public static final String queueConsumersAttribute
See Also:
Constant Field Values

brokerUrlInitParam

public static final String brokerUrlInitParam
See Also:
Constant Field Values

embeddedBrokerInitParam

public static final String embeddedBrokerInitParam
See Also:
Constant Field Values
Constructor Detail

WebClient

public WebClient()
Only called by serialization


WebClient

public WebClient(ServletContext context)
Method Detail

getWebClient

public static WebClient getWebClient(HttpSession session)
Returns:
the web client for the current HTTP session or null if there is not a web client created yet

initContext

public static void initContext(ServletContext context)

getDeliveryMode

public int getDeliveryMode()

setDeliveryMode

public void setDeliveryMode(int deliveryMode)

start

public void start()
           throws JMSException
Throws:
JMSException

stop

public void stop()
          throws JMSException
Throws:
JMSException

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

send

public void send(Destination destination,
                 Message message)
          throws JMSException
Throws:
JMSException

getSession

public Session getSession()
                   throws JMSException
Throws:
JMSException

getConnection

public org.activemq.ActiveMQConnection getConnection()
                                              throws JMSException
Throws:
JMSException

sessionWillPassivate

public void sessionWillPassivate(HttpSessionEvent event)
Specified by:
sessionWillPassivate in interface HttpSessionActivationListener

sessionDidActivate

public void sessionDidActivate(HttpSessionEvent event)
Specified by:
sessionDidActivate in interface HttpSessionActivationListener

initQueueConsumers

public static Map initQueueConsumers(ServletContext context)

initConnectionFactory

public static ConnectionFactory initConnectionFactory(ServletContext servletContext)

getConsumer

public MessageConsumer getConsumer(Destination destination)
                            throws JMSException
Throws:
JMSException

createSession

protected org.activemq.ActiveMQSession createSession()
                                              throws JMSException
Throws:
JMSException

createSessionConsumerPair

protected WebClient.SessionConsumerPair createSessionConsumerPair(Destination destination)
                                                           throws JMSException
Throws:
JMSException


Copyright © 2004-2010 Protique, Ltd.. All Rights Reserved.