util
Class StatusAccess

java.lang.Object
  extended by util.CommandLineParser
      extended by util.StatusAccess

public class StatusAccess
extends CommandLineParser

A small class allowing command-line controled access to bound RmiStatusProviding instances.

See Also:
CommandLineParser

Nested Class Summary
 
Nested classes/interfaces inherited from class util.CommandLineParser
CommandLineParser.Test
 
Field Summary
static String FOOT
          A footer usage message.
static Map<String,String> USE
           
static String ZEROSWITCHES
          The zero-argument command line switches understood.
 
Constructor Summary
StatusAccess()
          Constructs a new listener shifter.
 
Method Summary
static void main(String[] arg)
          Register and/or deregisters a listener from a given caster.
 boolean process()
          Process the command line arguments, when parsing was already done.
 boolean process(String[] arg)
          Processes the command line arguments.
protected  boolean processSwitches(Remote listener)
          Process the command line switches found.
 
Methods inherited from class util.CommandLineParser
getArguments, getCommandLine, getCommands, getRegisteredSwitches, hasAnySwitch, hasSwitch, hasSwitch, haveAllSwitches, parse, printCommandLine, registerLine, registerSwitches, setCommands, staticUsage, usage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ZEROSWITCHES

public static final String ZEROSWITCHES
The zero-argument command line switches understood.

See Also:
Constant Field Values

USE

public static Map<String,String> USE

FOOT

public static final String FOOT
A footer usage message.

See Also:
Constant Field Values
Constructor Detail

StatusAccess

public StatusAccess()
Constructs a new listener shifter. The switches understood are readily added to the command line parser.

Method Detail

process

public boolean process(String[] arg)
                throws ParseException
Processes the command line arguments. After parsing, the commands retrieved are converted to an rmi-reference of a ListenerControlling. If this conversion is successful the processSwitches(java.rmi.Remote) method is called.

Returns:
True on success.
Throws:
ParseException

process

public boolean process()
Process the command line arguments, when parsing was already done.


processSwitches

protected boolean processSwitches(Remote listener)
Process the command line switches found. If the remote reference handed over is a ListenerControlling and one of the switches defined in #ONESWITCHES is given, the appropriate method of the listener control is called. Note that the command line must be parsed before calling this method.
Implementation note: If both processable arguments, -r and -d are given, the deregistering at the caster is processed first.

Returns:
True on success.

main

public static void main(String[] arg)
                 throws ParseException
Register and/or deregisters a listener from a given caster. The order of the listener and the switches is not strict.

Throws:
ParseException