org.apache.activemq.store.kahadb.disk.util
Class CommandLineSupport

java.lang.Object
  extended by org.apache.activemq.store.kahadb.disk.util.CommandLineSupport

public class CommandLineSupport
extends Object

Support utility that can be used to set the properties on any object using command line arguments.

Author:
Hiram Chirino

Constructor Summary
CommandLineSupport()
           
 
Method Summary
static String[] setOptions(Object target, String[] args)
          Sets the properties of an object given the command line args.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandLineSupport

public CommandLineSupport()
Method Detail

setOptions

public static String[] setOptions(Object target,
                                  String[] args)
Sets the properties of an object given the command line args. if args contains: --ack-mode=AUTO --url=tcp://localhost:61616 --persistent then it will try to call the following setters on the target object. target.setAckMode("AUTO"); target.setURL(new URI("tcp://localhost:61616") ); target.setPersistent(true); Notice the the proper conversion for the argument is determined by examining the setter argument type.

Parameters:
target - the object that will have it's properties set
args - the command line options
Returns:
any arguments that are not valid options for the target


Copyright © 2005-2013 The Apache Software Foundation. All Rights Reserved.