public class WebClient extends Object implements javax.servlet.http.HttpSessionActivationListener, javax.servlet.http.HttpSessionBindingListener, Externalizable
| Modifier and Type | Field and Description |
|---|---|
static String |
BROKER_URL_INIT_PARAM |
static String |
CONNECTION_FACTORY_ATTRIBUTE |
static String |
CONNECTION_FACTORY_OPTIMIZE_ACK_PARAM |
static String |
CONNECTION_FACTORY_PREFETCH_PARAM |
static String |
PASSWORD_INIT_PARAM |
static String |
SELECTOR_NAME |
static String |
selectorName |
static String |
USERNAME_INIT_PARAM |
static String |
WEB_CLIENT_ATTRIBUTE |
| Constructor and Description |
|---|
WebClient() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
closeConsumer(javax.jms.Destination destination) |
void |
closeConsumers() |
protected javax.jms.Session |
createSession() |
protected static WebClient |
createWebClient(javax.servlet.http.HttpServletRequest request) |
javax.jms.Connection |
getConnection() |
javax.jms.MessageConsumer |
getConsumer(javax.jms.Destination destination,
String selector) |
javax.jms.MessageConsumer |
getConsumer(javax.jms.Destination destination,
String selector,
boolean create) |
List<javax.jms.MessageConsumer> |
getConsumers() |
int |
getDeliveryMode() |
String |
getPassword() |
javax.jms.MessageProducer |
getProducer() |
Semaphore |
getSemaphore() |
javax.jms.Session |
getSession() |
String |
getUsername() |
static WebClient |
getWebClient(javax.servlet.http.HttpServletRequest request)
Helper method to get the client for the current session, lazily creating
a client if there is none currently
|
static WebClient |
getWebClient(javax.servlet.http.HttpSession session) |
protected static void |
initConnectionFactory(javax.servlet.ServletContext servletContext) |
static void |
initContext(javax.servlet.ServletContext context) |
boolean |
isClosed() |
void |
readExternal(ObjectInput in) |
void |
send(javax.jms.Destination destination,
javax.jms.Message message) |
void |
send(javax.jms.Destination destination,
javax.jms.Message message,
boolean persistent,
int priority,
long timeToLive) |
void |
sessionDidActivate(javax.servlet.http.HttpSessionEvent event) |
void |
sessionWillPassivate(javax.servlet.http.HttpSessionEvent event) |
void |
setDeliveryMode(int deliveryMode) |
void |
setPassword(String password) |
void |
setProducer(javax.jms.MessageProducer producer) |
void |
setUsername(String username) |
void |
valueBound(javax.servlet.http.HttpSessionBindingEvent event) |
void |
valueUnbound(javax.servlet.http.HttpSessionBindingEvent event) |
void |
writeExternal(ObjectOutput out) |
public static final String WEB_CLIENT_ATTRIBUTE
public static final String CONNECTION_FACTORY_ATTRIBUTE
public static final String CONNECTION_FACTORY_PREFETCH_PARAM
public static final String CONNECTION_FACTORY_OPTIMIZE_ACK_PARAM
public static final String BROKER_URL_INIT_PARAM
public static final String USERNAME_INIT_PARAM
public static final String PASSWORD_INIT_PARAM
public static final String SELECTOR_NAME
public static String selectorName
public WebClient()
public static WebClient getWebClient(javax.servlet.http.HttpServletRequest request)
request - is the current HTTP requestpublic static WebClient getWebClient(javax.servlet.http.HttpSession session)
public static void initContext(javax.servlet.ServletContext context)
public int getDeliveryMode()
public void setDeliveryMode(int deliveryMode)
public String getUsername()
public void setUsername(String username)
public String getPassword()
public void setPassword(String password)
public void closeConsumers()
public void close()
public boolean isClosed()
public void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionpublic void send(javax.jms.Destination destination, javax.jms.Message message) throws javax.jms.JMSException
javax.jms.JMSExceptionpublic void send(javax.jms.Destination destination, javax.jms.Message message, boolean persistent, int priority, long timeToLive) throws javax.jms.JMSException
javax.jms.JMSExceptionpublic javax.jms.Session getSession() throws javax.jms.JMSException
javax.jms.JMSExceptionpublic javax.jms.Connection getConnection() throws javax.jms.JMSException
javax.jms.JMSExceptionprotected static void initConnectionFactory(javax.servlet.ServletContext servletContext)
public javax.jms.MessageProducer getProducer() throws javax.jms.JMSException
javax.jms.JMSExceptionpublic void setProducer(javax.jms.MessageProducer producer)
public javax.jms.MessageConsumer getConsumer(javax.jms.Destination destination, String selector) throws javax.jms.JMSException
javax.jms.JMSExceptionpublic javax.jms.MessageConsumer getConsumer(javax.jms.Destination destination, String selector, boolean create) throws javax.jms.JMSException
javax.jms.JMSExceptionpublic void closeConsumer(javax.jms.Destination destination) throws javax.jms.JMSException
javax.jms.JMSExceptionpublic List<javax.jms.MessageConsumer> getConsumers()
protected javax.jms.Session createSession() throws javax.jms.JMSException
javax.jms.JMSExceptionpublic Semaphore getSemaphore()
public void sessionWillPassivate(javax.servlet.http.HttpSessionEvent event)
sessionWillPassivate in interface javax.servlet.http.HttpSessionActivationListenerpublic void sessionDidActivate(javax.servlet.http.HttpSessionEvent event)
sessionDidActivate in interface javax.servlet.http.HttpSessionActivationListenerpublic void valueBound(javax.servlet.http.HttpSessionBindingEvent event)
valueBound in interface javax.servlet.http.HttpSessionBindingListenerpublic void valueUnbound(javax.servlet.http.HttpSessionBindingEvent event)
valueUnbound in interface javax.servlet.http.HttpSessionBindingListenerprotected static WebClient createWebClient(javax.servlet.http.HttpServletRequest request)
Copyright © 2005–2019 The Apache Software Foundation. All rights reserved.