org.apache.activemq.console.command
Class AbstractAmqCommand

java.lang.Object
  extended by org.apache.activemq.console.command.AbstractCommand
      extended by org.apache.activemq.console.command.AbstractAmqCommand
All Implemented Interfaces:
Command
Direct Known Subclasses:
AmqBrowseCommand

public abstract class AbstractAmqCommand
extends AbstractCommand


Field Summary
 
Fields inherited from class org.apache.activemq.console.command.AbstractCommand
COMMAND_OPTION_DELIMETER, context
 
Constructor Summary
AbstractAmqCommand()
           
 
Method Summary
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.
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.
 
Methods inherited from class org.apache.activemq.console.command.AbstractCommand
execute, parseOptions, printHelp, runTask, setCommandContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractAmqCommand

public AbstractAmqCommand()
Method Detail

createConnection

protected javax.jms.Connection createConnection()
                                         throws javax.jms.JMSException
Establishes a connection to the remote broker specified by the broker url.

Returns:
- connection to the broker
Throws:
javax.jms.JMSException

createConnection

protected javax.jms.Connection createConnection(java.lang.String username,
                                                java.lang.String password)
                                         throws javax.jms.JMSException
Establishes a connection to the remote broker specified by the broker url.

Parameters:
username - - username for the connection
password - - password for the connection
Returns:
- connection to the broker
Throws:
javax.jms.JMSException

closeAllConnections

protected void closeAllConnections()
Close all created connections.


handleOption

protected void handleOption(java.lang.String token,
                            java.util.List tokens)
                     throws java.lang.Exception
Handle the --amqurl option.

Overrides:
handleOption in class AbstractCommand
Parameters:
token - - current option
tokens - - succeeding list of arguments
Throws:
java.lang.Exception

setBrokerUrl

protected void setBrokerUrl(java.net.URI brokerUrl)
Set the broker url.

Parameters:
brokerUrl - - new broker url

setBrokerUrl

protected void setBrokerUrl(java.lang.String address)
                     throws java.net.URISyntaxException
Set the broker url.

Parameters:
address - - address of the new broker url
Throws:
java.net.URISyntaxException

getBrokerUrl

protected java.net.URI getBrokerUrl()
Get the current broker url.

Returns:
current broker url


Copyright © 2005-2011 FuseSource, Corp.. All Rights Reserved.