|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ow2.jasmine.monitoring.mbeancmd.CommandDispatcher
public class CommandDispatcher
This is the main class of the archive. It dispatches the processing of the command to the right class. The available commands in the current archive are retrieved by introspection of the archive.
| Constructor Summary | |
|---|---|
protected |
CommandDispatcher()
Dummy constructor to avoid the class from being used in any other way than calling the CommandDispatcher.main method. |
| Method Summary | |
|---|---|
java.lang.String[] |
getAvailableCommands()
Returns the names of the available commands in the archive. |
Command |
getCommand(java.lang.String name)
Returns an instance of Command. |
protected java.io.InputStreamReader |
getInputStreamReader(java.lang.String name)
Return an inputStreamReader for the specified resource, by using the context class loader. |
int |
init(java.lang.String[] args)
|
boolean |
isEmbedded()
Get the state of MBeanCmd. |
protected static boolean |
isOSGiEnabled()
|
protected java.lang.Class<?> |
loadClass(java.lang.String cname)
Load and return a class for a given class name, by using the defining class loader of the current class. |
static void |
main(java.lang.String[] args)
Main method. |
void |
setEmbedded(boolean isEmbedded)
Set the sate of MBeanCmd |
protected static void |
setOSGiEnabled(boolean osgiEnabled)
Set if MBeanCmd is embedded in OSGi or not. |
static int |
start(java.lang.String[] args)
The class is selected from the first argument. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected CommandDispatcher()
| Method Detail |
|---|
public static void main(java.lang.String[] args)
start(String[])(args)
followed by System.exit of the returned value.
IMPORTANT: This method calls System.exit !
args - See start(String[]).public static int start(java.lang.String[] args)
args - Arguments of the command, including the command itself at the
first position.
public int init(java.lang.String[] args)
public Command getCommand(java.lang.String name)
name - the name of the command.
public java.lang.String[] getAvailableCommands()
protected java.io.InputStreamReader getInputStreamReader(java.lang.String name)
throws java.io.IOException
name - the resource name
java.io.IOException - if an I/O exception occurs
protected java.lang.Class<?> loadClass(java.lang.String cname)
throws java.lang.ClassNotFoundException
cname - a class name
java.lang.ClassNotFoundException - if the class cannot be foundpublic boolean isEmbedded()
public void setEmbedded(boolean isEmbedded)
isEmbedded - The state to set.protected static boolean isOSGiEnabled()
protected static void setOSGiEnabled(boolean osgiEnabled)
osgiEnabled - true if MBeanCmd is embedded in OSGi or not
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||