Class MessageCatcher
- java.lang.Object
-
- ejava.examples.jms10.jmsmechanics.MessageCatcher
-
-
Field Summary
Fields Modifier and Type Field Description protected intackModeprotected ConnectionFactoryconnFactoryprotected Destinationdestinationprivate static org.slf4j.Loggerloggerprotected List<Message>messagesprotected Stringnameprotected Stringpasswordprotected SessionsharedSessionprotected booleanstartedprotected booleanstopprotected booleanstoppedprotected Stringuser
-
Constructor Summary
Constructors Constructor Description MessageCatcher(String name)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearMessages()voidexecute()protected ConnectiongetConnection()intgetCount()List<Message>getMessages()StringgetName()booleanisStarted()booleanisStopped()static voidmain(String[] args)voidrun()MessageCatchersetAckMode(int ackMode)voidsetConnFactory(ConnectionFactory connFactory)voidsetDestination(Destination destination)voidsetPassword(String password)MessageCatchersetSession(Session session)voidsetUser(String user)voidstop()
-
-
-
Field Detail
-
logger
private static final org.slf4j.Logger logger
-
connFactory
protected ConnectionFactory connFactory
-
user
protected String user
-
password
protected String password
-
sharedSession
protected Session sharedSession
-
destination
protected Destination destination
-
ackMode
protected int ackMode
-
stop
protected boolean stop
-
stopped
protected boolean stopped
-
started
protected boolean started
-
name
protected String name
-
-
Constructor Detail
-
MessageCatcher
public MessageCatcher(String name)
-
-
Method Detail
-
getName
public String getName()
-
setConnFactory
public void setConnFactory(ConnectionFactory connFactory)
-
setUser
public void setUser(String user)
-
setPassword
public void setPassword(String password)
-
setSession
public MessageCatcher setSession(Session session)
-
setDestination
public void setDestination(Destination destination)
-
setAckMode
public MessageCatcher setAckMode(int ackMode)
-
getCount
public int getCount()
-
clearMessages
public void clearMessages()
-
stop
public void stop()
-
isStopped
public boolean isStopped()
-
isStarted
public boolean isStarted()
-
getConnection
protected Connection getConnection() throws JMSException
- Throws:
JMSException
-
execute
public void execute() throws JMSException- Throws:
JMSException
-
main
public static void main(String[] args)
-
-