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(java.lang.String username,
java.lang.String password)
Establishes a connection to the remote broker specified by the broker
url.
|
protected java.net.URI |
getBrokerUrl()
Get the current broker url.
|
javax.jms.ConnectionFactory |
getConnectionFactory() |
java.lang.String |
getPassword() |
PasswordFactory |
getPasswordFactory() |
java.lang.String |
getUsername() |
protected void |
handleOption(java.lang.String token,
java.util.List tokens)
Handle the --amqurl option.
|
protected void |
setBrokerUrl(java.lang.String address)
Set the broker url.
|
protected void |
setBrokerUrl(java.net.URI brokerUrl)
Set the broker url.
|
void |
setFactory(javax.jms.ConnectionFactory factory) |
void |
setPassword(java.lang.String password) |
void |
setPasswordFactory(PasswordFactory passwordFactory) |
void |
setUsername(java.lang.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(java.lang.String username, java.lang.String password) throws javax.jms.JMSException
username
- - username for the connectionpassword
- - password for the connectionjavax.jms.JMSException
protected void closeAllConnections()
protected void handleOption(java.lang.String token, java.util.List tokens) throws java.lang.Exception
handleOption
in class AbstractCommand
token
- - current optiontokens
- - succeeding list of argumentsjava.lang.Exception
protected void setBrokerUrl(java.net.URI brokerUrl)
brokerUrl
- - new broker urlprotected void setBrokerUrl(java.lang.String address) throws java.net.URISyntaxException
address
- - address of the new broker urljava.net.URISyntaxException
protected java.net.URI getBrokerUrl()
public javax.jms.ConnectionFactory getConnectionFactory()
public java.lang.String getUsername()
public void setFactory(javax.jms.ConnectionFactory factory)
factory
- the factory to setpublic void setUsername(java.lang.String username)
username
- the username to setpublic java.lang.String getPassword()
public void setPassword(java.lang.String password)
password
- the password to setpublic PasswordFactory getPasswordFactory()
public void setPasswordFactory(PasswordFactory passwordFactory)
passwordFactory
- the passwordFactory to setCopyright © 2005-2017. All Rights Reserved.