xmlBlaster 2.1.0 API

org.xmlBlaster.engine.admin.intern
Class CoreHandler

java.lang.Object
  extended by org.xmlBlaster.engine.admin.intern.CoreHandler
All Implemented Interfaces:
I_CommandHandler, I_Plugin

public final class CoreHandler
extends java.lang.Object
implements I_CommandHandler, I_Plugin

Implementation of administrative access to xmlBlaster internal java objects.

Since:
0.79f
Author:
xmlBlaster@marcelruff.info

Field Summary
private  CommandManager commandManager
           
private  ServerScope glob
           
private  java.lang.String listSeparator
           
private static java.util.logging.Logger log
           
private  java.lang.String ME
           
 
Constructor Summary
CoreHandler()
           
 
Method Summary
private  java.lang.Object[] convertMethodArguments(java.lang.Class[] classes, java.lang.String[] args)
           
private  MsgUnit[] doGetInvoke(CommandWrapper cmd, java.lang.String property, java.lang.Object impl, java.lang.Class clazz)
           
 MsgUnit[] get(AddressServer addressServer, java.lang.String sessionId, CommandWrapper cmd)
          Your plugin should process the command.
 java.lang.String getName()
          Get a human readable name of this filter implementation
 java.lang.String getType()
          Return plugin type for Plugin loader
 java.lang.String getVersion()
          Return plugin version for Plugin loader
 java.lang.String help()
           
 java.lang.String help(java.lang.String cmd)
           
 void init(Global glob, PluginInfo pluginInfo)
          This method is called by the PluginManager (enforced by I_Plugin).
 void initialize(ServerScope glob, CommandManager commandManager)
          This is called after creation of the plugin.
 java.lang.String set(AddressServer addressServer, java.lang.String sessionId, CommandWrapper cmd)
          Set a value.
private  java.lang.Object setInvoke(java.lang.String property, java.lang.Object impl, java.lang.Class aClass, java.lang.String[] argValuesAsStrings)
           
 void shutdown()
          Cleans up the resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ME

private java.lang.String ME

glob

private ServerScope glob

log

private static java.util.logging.Logger log

commandManager

private CommandManager commandManager

listSeparator

private java.lang.String listSeparator
Constructor Detail

CoreHandler

public CoreHandler()
Method Detail

initialize

public void initialize(ServerScope glob,
                       CommandManager commandManager)
This is called after creation of the plugin.

Specified by:
initialize in interface I_CommandHandler
Parameters:
glob - The Global handle of this xmlBlaster server instance.
commandManager - My big brother taking care of me

init

public void init(Global glob,
                 PluginInfo pluginInfo)
This method is called by the PluginManager (enforced by I_Plugin).

Specified by:
init in interface I_Plugin
See Also:
I_Plugin.init(org.xmlBlaster.util.Global,org.xmlBlaster.util.plugin.PluginInfo)

getType

public java.lang.String getType()
Return plugin type for Plugin loader

Specified by:
getType in interface I_Plugin
Returns:
"CoreHandler"

getVersion

public java.lang.String getVersion()
Return plugin version for Plugin loader

Specified by:
getVersion in interface I_Plugin
Returns:
"1.0"

getName

public java.lang.String getName()
Get a human readable name of this filter implementation

Returns:
"CoreHandler"

doGetInvoke

private MsgUnit[] doGetInvoke(CommandWrapper cmd,
                              java.lang.String property,
                              java.lang.Object impl,
                              java.lang.Class clazz)
                       throws XmlBlasterException
Throws:
XmlBlasterException

get

public MsgUnit[] get(AddressServer addressServer,
                     java.lang.String sessionId,
                     CommandWrapper cmd)
              throws XmlBlasterException
Description copied from interface: I_CommandHandler
Your plugin should process the command.

Specified by:
get in interface I_CommandHandler
Parameters:
addressServer - The protocol plugin or external access layer calling us
sessionId - Is null if not logged in
cmd - The command to process, e.g. "clientList"
Returns:
An array of MsgUnitRaw object:
  • Internal message are delivered as is, please don't manipulate them
  • System properties and internal state queries are marked with msgUnit.getQos() == "text/plain" and the key contains the plain key and the content the plain value. The MsgUnitRaw is just misused to carry the key/value data.
Throws:
XmlBlasterException
See Also:
org.xmlBlaster.engine.admin.I_CommandHandler#get(String,CommandWrapper)

set

public java.lang.String set(AddressServer addressServer,
                            java.lang.String sessionId,
                            CommandWrapper cmd)
                     throws XmlBlasterException
Set a value.

Specified by:
set in interface I_CommandHandler
Parameters:
addressServer - The protocol plugin or external access layer calling us
sessionId - Is null if not logged in
cmd - The command to process, e.g. ?trace=true
Returns:
null if not set
Throws:
XmlBlasterException
See Also:
command requirement

convertMethodArguments

private java.lang.Object[] convertMethodArguments(java.lang.Class[] classes,
                                                  java.lang.String[] args)
                                           throws XmlBlasterException
Parameters:
property - e.g. "uptime", the method "getUptime()" will be called
aClass - e.g. I_AdminSubject.class
Returns:
Object typically of type String or String[]
Throws:
XmlBlasterException

setInvoke

private java.lang.Object setInvoke(java.lang.String property,
                                   java.lang.Object impl,
                                   java.lang.Class aClass,
                                   java.lang.String[] argValuesAsStrings)
                            throws XmlBlasterException
Parameters:
property - e.g. "uptime", the method "setUptime()" will be called
aClass - e.g. I_AdminSubject.class
argValues - = new Object[1]; argValues[0] = "Hi"
Throws:
XmlBlasterException

help

public java.lang.String help()
Specified by:
help in interface I_CommandHandler

help

public java.lang.String help(java.lang.String cmd)
Specified by:
help in interface I_CommandHandler

shutdown

public void shutdown()
Description copied from interface: I_Plugin
Cleans up the resource.

Specified by:
shutdown in interface I_CommandHandler
Specified by:
shutdown in interface I_Plugin

xmlBlaster 2.1.0 API

Copyright © 1999-2011 The xmlBlaster.org contributers.