|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.PropertyContainer
util.rmi.RmiPropertyContainer
util.rmi.AbstractRmiListener
stella.jview.JLaunchBox
public class JLaunchBox
The generic class to allow GUI-driven command-sending. This class can be used to directly send commands to a single command server. The receiving edge (the command server) must be up and running, otherwise construction will fail.
Note that this class uses the CommandLaunching rmi-command casting
ability, regardless wether the underlying launcher is a true
rmi-implementation or a socket-based workaround. Additionally, to allow
proper functionality of this class as a done, acknowledge, and
error listener, it depends on rmi-based event delivery.
In the rmi-regime this is directly achieved by registering to the remote
command servers. In the socket world this again requires binding to
the command launching instance.
On startup this class uses its properties to establish the following thing:
KEY_COMMAND key points to the properties of the
CommandLaunching instance to use to send the commands.KEY_ACKNOWLEDGE key points to the binding name of the
rmi-enabled acknowledge caster this launch box should listen to.KEY_DONE key points to the binding name of the
rmi-enabled done caster this launch box should listen to.KEY_ERROR key points to the binding name of the
rmi-enabled error caster this launch box should listen to.KEY_TITLE key points to the name of this launch box.
It is normally used as the name of the frame the launch box resides in.JDisplayableCommand
components layed
out in grid-bag fashion. Pressing the appropriate OK button
assigned to the JDisplayableCommands sends the command to the
command server.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class util.PropertyContainer |
|---|
PropertyContainer.URLResource |
| Field Summary | |
|---|---|
private static int |
DEFCOLUMN
The default number of display columns (1). |
private static boolean |
DEFLOGFLAG
The default syslog-to-status behaviour. |
static String |
KEY_ACKNOWLEDGE
The key to the rmi-acknowledge caster to bind to, resolvable URL. |
static String |
KEY_COLUMN
The key denoting the number of colums to display. |
static String |
KEY_COMMAND
The key to the command launcher, properties file. |
static String |
KEY_DONE
The key to the rmi-done caster to bind to, resolvable URL. |
static String |
KEY_ERROR
The key to the rmi-error caster to bind to, resolvable URL. |
static String |
KEY_FILE
The key to a file containing a (long) list of all jcommands. |
static String |
KEY_LIST
The key to the jcommand list. |
static String |
KEY_LOGFLAG
If true, syslog messages are also passed to the status field. |
static String |
KEY_TITLE
The key to this launch box title. |
private CommandLaunching |
launch
The command launcher. |
private JStatusPanel |
status
The status panel. |
private List<JDisplayableCommand> |
valid
The list of displayable commands. |
| Fields inherited from class util.rmi.AbstractRmiListener |
|---|
KEY_ALIVE, KEY_EXPORTPORT, KEY_INIT, KEY_LISTENERNAME, KEY_RETRY, KEY_RETRYSLEEP, KEY_SHUTDOWNDELAY |
| Fields inherited from class util.PropertyContainer |
|---|
KEY_LISTSEPARATOR, KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR, KEY_NOINITONCREATE, KEY_RESOURCEBUNDLES |
| Fields inherited from interface util.PropertyBearing |
|---|
CONFIG, KEY_CLASS, KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME |
| Constructor Summary | |
|---|---|
JLaunchBox(Map prop)
Constructs a new launch box. |
|
| Method Summary | |
|---|---|
void |
actionPerformed(ActionEvent ae)
Catches the action events from the JDisplayableCommands. |
protected boolean |
deregisterAtCaster(RmiCaster rmicast,
Class service)
Deregisters at the specified caster if the caster is either an RmiDoneCaster or an RmiAcknowledgeCaster |
protected List |
getDisplayableCommands()
Returns the hosted list of displayable commands. |
Icon |
getIcon()
Might return an icon, if one was stated in the properties |
protected JPanel |
getJDisplayablePanel()
Does the layout for all JDisplayableCommand in the control box. |
protected CommandLaunching |
getLauncher()
Returns my command launching instance. |
protected Map<String,String> |
getLauncherProperties()
Returns the launcher properties from a file. |
Component |
getRepresentation()
Returns a panel where the status panel and the jdisplayables are combined. |
protected JStatusPanel |
getStatus()
Returns the status panel for delivering messages to it. |
void |
init()
Initialize first the list of command before adding the action listeners to the buttons. |
protected void |
launchCommand(CommandEvent cmd)
Launches a specified command through the command caster associated with this launch box. |
static void |
main(String[] arg)
Launches a command conrtol box. |
protected boolean |
registerAtCaster(RmiCaster rmicast,
Class service)
Binds to an caster. |
void |
rmiErrorOccured(ErrorEvent ee)
The receiving edge of the error listener. |
void |
rmiGotAcknowledge(AcknowledgeEvent ae)
The receiving edge of the acknowledge listener. |
void |
rmiGotDone(DoneEvent de)
The receiving edge of the done listener. |
void |
setAllEnabled(boolean isactive)
Enables or disables all command sending. |
| Methods inherited from class util.rmi.AbstractRmiListener |
|---|
allBound, blockBinding, blockBinding, disconnect, exit, getIP, getListenerName, isConnected, listenerName, releaseBinding, releaseBinding, rescanned, startBinding, startBinding |
| Methods inherited from class util.rmi.RmiPropertyContainer |
|---|
containsRemoteProperty, getRemoteProperties, getRemoteProperty, setRemoteProperty |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface util.rmi.RmiEventListener |
|---|
getListenerName |
| Methods inherited from interface util.rmi.RmiListener |
|---|
disconnect, isConnected |
| Field Detail |
|---|
public static final String KEY_COMMAND
public static final String KEY_ACKNOWLEDGE
public static final String KEY_DONE
public static final String KEY_ERROR
public static final String KEY_LIST
public static final String KEY_FILE
public static final String KEY_COLUMN
public static final String KEY_TITLE
public static final String KEY_LOGFLAG
private static final int DEFCOLUMN
private static final boolean DEFLOGFLAG
private CommandLaunching launch
private List<JDisplayableCommand> valid
private JStatusPanel status
| Constructor Detail |
|---|
public JLaunchBox(Map prop)
throws RemoteException
KEY_ACKNOWLEDGE,
KEY_DONE, and KEY_ERROR.
RemoteException| Method Detail |
|---|
public void init()
init in interface Initializableinit in class PropertyContainerprotected Map<String,String> getLauncherProperties()
public void setAllEnabled(boolean isactive)
JDisplayableCommands.
public void rmiGotAcknowledge(AcknowledgeEvent ae)
throws RemoteException
rmiGotAcknowledge in interface RmiAcknowledgeListenerRemoteException
public void rmiGotDone(DoneEvent de)
throws RemoteException
rmiGotDone in interface RmiDoneListenerRemoteException
public void rmiErrorOccured(ErrorEvent ee)
throws RemoteException
rmiErrorOccured in interface RmiErrorListenerRemoteExceptionpublic Icon getIcon()
getIcon in interface Displayablepublic Component getRepresentation()
getRepresentation in interface Displayablepublic void actionPerformed(ActionEvent ae)
JDisplayableCommands. The
action event command string is used for identifying the issuing
JDisplayableCommand. If successful,
the JDisplayableCommand.getCommand() is invoked and the
returned command event is sent to the command launcher.
actionPerformed in interface ActionListener
protected boolean registerAtCaster(RmiCaster rmicast,
Class service)
RmiCaster is an instance
of RmiDoneCaster this done listener registers to it via the
RmiDoneCaster.addRmiDoneListener(stella.rmi.RmiDoneListener) method. If the argumental
RmiCaster is an instance of RmiAcknowledgeCaster this
acknowledge listener registers to it via the
RmiAcknowledgeCaster.addRmiAcknowledgeListener(stella.rmi.RmiAcknowledgeListener) method. If the argument is neither of these two types the method returns silently.
registerAtCaster in class AbstractRmiListenerderegisterAtCaster(util.rmi.RmiCaster, java.lang.Class)
protected boolean deregisterAtCaster(RmiCaster rmicast,
Class service)
RmiDoneCaster or an RmiAcknowledgeCaster
deregisterAtCaster in class AbstractRmiListenerregisterAtCaster(util.rmi.RmiCaster, java.lang.Class)protected JPanel getJDisplayablePanel()
JDisplayableCommand in the control box.
The returned panel has a grid-bag layout with a number of columns
equal to KEY_COLUMN.
protected JStatusPanel getStatus()
protected List getDisplayableCommands()
protected CommandLaunching getLauncher()
protected void launchCommand(CommandEvent cmd)
public static void main(String[] arg)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||