public class Requestor extends Object implements Runnable, MessageListener
Modifier and Type | Field and Description |
---|---|
protected ConnectionFactory |
connFactory |
protected int |
count |
private static org.apache.commons.logging.Log |
log |
protected int |
maxCount |
protected String |
name |
protected String |
password |
protected Destination |
requestQueue |
protected Map<String,Message> |
requests |
protected int |
responseCount |
protected long |
sleepTime |
protected boolean |
started |
protected long |
startTime |
protected boolean |
stop |
protected boolean |
stopped |
protected String |
username |
Modifier and Type | Method and Description |
---|---|
void |
clearMessages() |
protected Connection |
createConnection(ConnectionFactory connFactory) |
void |
execute() |
int |
getCount() |
protected Destination |
getReplyTo(Session session) |
boolean |
isStarted() |
boolean |
isStopped() |
static void |
main(String[] args) |
void |
onMessage(Message message)
This method is used to asynchronously receive the responses to
requests sent by the main loop.
|
void |
run() |
void |
setConnFactory(ConnectionFactory connFactory) |
void |
setMaxCount(int maxCount) |
void |
setPassword(String password) |
void |
setRequestQueue(Destination requestQueue) |
void |
setSleepTime(long sleepTime) |
void |
setUsername(String username) |
void |
stop() |
private static final org.apache.commons.logging.Log log
protected ConnectionFactory connFactory
protected Destination requestQueue
protected boolean stop
protected boolean stopped
protected boolean started
protected int count
protected String name
protected long sleepTime
protected int maxCount
protected int responseCount
protected long startTime
protected String username
protected String password
public Requestor(String name)
public void setConnFactory(ConnectionFactory connFactory)
public void setRequestQueue(Destination requestQueue)
public int getCount()
public void setSleepTime(long sleepTime)
public void setMaxCount(int maxCount)
public void clearMessages()
public void stop()
public boolean isStopped()
public boolean isStarted()
protected Connection createConnection(ConnectionFactory connFactory) throws Exception
Exception
protected Destination getReplyTo(Session session) throws Exception
Exception
public void setUsername(String username)
public void setPassword(String password)
public void onMessage(Message message)
onMessage
in interface MessageListener
public static void main(String[] args)
Copyright © 2015 John's Hopkins University, Engineering Programs for Professionals. All rights reserved.