public abstract class AbstractAmqCommand extends AbstractCommand
COMMAND_OPTION_DELIMETER, context
Constructor and Description |
---|
AbstractAmqCommand() |
Modifier and Type | Method and Description |
---|---|
protected void |
closeAllConnections()
Close all created connections.
|
protected javax.jms.Connection |
createConnection()
Establishes a connection to the remote broker specified by the broker
url.
|
protected javax.jms.Connection |
createConnection(String username,
String password)
Establishes a connection to the remote broker specified by the broker
url.
|
protected URI |
getBrokerUrl()
Get the current broker url.
|
javax.jms.ConnectionFactory |
getConnectionFactory() |
String |
getPassword() |
PasswordFactory |
getPasswordFactory() |
String |
getUsername() |
protected void |
handleOption(String token,
List tokens)
Handle the --amqurl option.
|
protected void |
setBrokerUrl(String address)
Set the broker url.
|
protected void |
setBrokerUrl(URI brokerUrl)
Set the broker url.
|
void |
setFactory(javax.jms.ConnectionFactory factory) |
void |
setPassword(String password) |
void |
setPasswordFactory(PasswordFactory passwordFactory) |
void |
setUsername(String username) |
execute, parseOptions, printHelp, runTask, setCommandContext
public AbstractAmqCommand()
protected javax.jms.Connection createConnection() throws javax.jms.JMSException
javax.jms.JMSException
protected javax.jms.Connection createConnection(String username, String password) throws javax.jms.JMSException
username
- - username for the connectionpassword
- - password for the connectionjavax.jms.JMSException
protected void closeAllConnections()
protected void handleOption(String token, List tokens) throws Exception
handleOption
in class AbstractCommand
token
- - current optiontokens
- - succeeding list of argumentsException
protected void setBrokerUrl(URI brokerUrl)
brokerUrl
- - new broker urlprotected void setBrokerUrl(String address) throws URISyntaxException
address
- - address of the new broker urlURISyntaxException
protected URI getBrokerUrl()
public javax.jms.ConnectionFactory getConnectionFactory()
public String getUsername()
public void setFactory(javax.jms.ConnectionFactory factory)
factory
- the factory to setpublic void setUsername(String username)
username
- the username to setpublic String getPassword()
public void setPassword(String password)
password
- the password to setpublic PasswordFactory getPasswordFactory()
public void setPasswordFactory(PasswordFactory passwordFactory)
passwordFactory
- the passwordFactory to setCopyright © 2005–2016. All rights reserved.