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 Connection |
createConnection()
Establishes a connection to the remote broker specified by the broker
url.
|
protected 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.
|
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(ConnectionFactory factory) |
void |
setPassword(String password) |
void |
setPasswordFactory(PasswordFactory passwordFactory) |
void |
setUsername(String username) |
execute, parseOptions, printHelp, printHelpFromFile, runTask, setCommandContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getName, getOneLineDescription
public AbstractAmqCommand()
protected Connection createConnection() throws JMSException
JMSException
protected Connection createConnection(String username, String password) throws JMSException
username
- - username for the connectionpassword
- - password for the connectionJMSException
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 ConnectionFactory getConnectionFactory()
public String getUsername()
public void setFactory(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 FuseSource, Corp.. All rights reserved.