xmlBlaster 2.2.0 API

org.xmlBlaster
Class Main

java.lang.Object
  extended by org.xmlBlaster.Main
All Implemented Interfaces:
java.util.EventListener, I_RunlevelListener, I_Main, I_SignalListener, I_XmlBlasterExceptionHandler

public class Main
extends java.lang.Object
implements I_RunlevelListener, I_Main, I_SignalListener, I_XmlBlasterExceptionHandler

Main class to invoke the xmlBlaster server.

There are many command line parameters supported please invoke with "-?" to get a complete list of the supported parameters.
Every parameter may be set in the xmlBlaster.property file as a system property or at the command line, the command line is strongest, xmlBlaster.properties weakest. The leading "-" from the command line key parameters are stripped (see Property.java).

Examples how to start the xmlBlaster server:

java org.xmlBlaster.Main -bootstrapPort 3412

java org.xmlBlaster.Main -plugin/ior/iorFile /tmp/XmlBlaster_Ref

java org.xmlBlaster.Main -logging FINEST

java org.xmlBlaster.Main -plugin/xmlrpc/hostname 102.24.64.60 -plugin/xmlrpc/port 8081

java org.xmlBlaster.Main -?

Author:
Marcel Ruff.
See Also:
admin.telnet, util.property

Field Summary
(package private) static MainGUI controlPanel
          true: If instance created by control panel
false: running without GUI
private  ServerScope glob
           
private  boolean inShutdownProcess
           
private static java.util.logging.Logger log
           
private  java.lang.String ME
           
private  java.lang.String panicErrorCodes
          Comma separate list of errorCodes which to an immediate System.exit(1); Used by our default implementation of I_XmlBlasterExceptionHandler TODO: If you use JdbcManagerCommonTableDelegate.java you may NOT use ErrorCode.RESOURCE_DB_UNKNOWN as this will retry one time the operation! How to assure this if configured different???
private  RunlevelManager runlevelManager
          Starts/stops xmlBlaster
private  boolean showUsage
           
private  SignalCatcher signalCatcher
           
private  long startupTime
          Incarnation time of this object instance in millis
private  StdoutStderrRedirector stdoutStderrRedirector
           
 
Constructor Summary
Main()
          You need to call init() after construction.
Main(Global utilGlob)
          Start xmlBlaster using the properties from utilGlob without loading xmlBlaster.properties again
Main(ServerScope glob, MainGUI controlPanel_)
           
Main(java.lang.String[] args)
          Start xmlBlaster using the given properties and load xmlBlaster.properties.
 
Method Summary
 void blockThread()
           
private  void checkForKeyboardInput()
          Check for keyboard entries from console.
 void destroy()
          Same as shutdown() but does additionally an engine.global.shutdown()
 I_Authenticate getAuthenticate()
          Access the authentication singleton.
 ServerScope getGlobal()
           
 java.lang.String getName()
          A human readable name of the listener for logging.
 I_XmlBlaster getXmlBlaster()
          Access the xmlBlaster singleton.
 void init(Global utilGlob)
           
 void init(java.util.Properties props)
           
 void init(ServerScope glob)
           
 boolean isHalted()
           
private  void keyboardUsage()
          Keyboard input usage.
static void main(java.lang.String[] args)
          Invoke: java org.xmlBlaster.Main
 void newException(XmlBlasterException e)
          This will be called from XmlBlasterException constructor.
 void runlevelChange(int from, int to, boolean force)
          Invoked on run level change, see RunlevelManager.RUNLEVEL_HALTED and RunlevelManager.RUNLEVEL_RUNNING

Enforced by I_RunlevelListener

 void shutdown()
          Instructs the RunlevelManager to shut down, which causes all object adapters to shut down.
 void shutdownHook()
          You will be notified when the runtime exits.
private  void usage()
          Command line usage.
 
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

runlevelManager

private RunlevelManager runlevelManager
Starts/stops xmlBlaster


showUsage

private boolean showUsage

startupTime

private long startupTime
Incarnation time of this object instance in millis


inShutdownProcess

private boolean inShutdownProcess

signalCatcher

private SignalCatcher signalCatcher

panicErrorCodes

private java.lang.String panicErrorCodes
Comma separate list of errorCodes which to an immediate System.exit(1); Used by our default implementation of I_XmlBlasterExceptionHandler TODO: If you use JdbcManagerCommonTableDelegate.java you may NOT use ErrorCode.RESOURCE_DB_UNKNOWN as this will retry one time the operation! How to assure this if configured different???


controlPanel

static MainGUI controlPanel
true: If instance created by control panel
false: running without GUI


stdoutStderrRedirector

private StdoutStderrRedirector stdoutStderrRedirector
Constructor Detail

Main

public Main()
You need to call init() after construction. Currently used by XmlBlasterClassLoader


Main

public Main(ServerScope glob,
            MainGUI controlPanel_)

Main

public Main(Global utilGlob)
Start xmlBlaster using the properties from utilGlob without loading xmlBlaster.properties again

Parameters:
utilGlob - The environment for this server instance

Main

public Main(java.lang.String[] args)
Start xmlBlaster using the given properties and load xmlBlaster.properties.

Parameters:
args - The command line parameters
Method Detail

getGlobal

public ServerScope getGlobal()
Specified by:
getGlobal in interface I_Main

init

public void init(Global utilGlob)
Specified by:
init in interface I_Main

init

public void init(java.util.Properties props)
Specified by:
init in interface I_Main

init

public final void init(ServerScope glob)

blockThread

public void blockThread()

destroy

public void destroy()
Same as shutdown() but does additionally an engine.global.shutdown()

Specified by:
destroy in interface I_Main

shutdown

public void shutdown()
Instructs the RunlevelManager to shut down, which causes all object adapters to shut down.

The drivers are removed.

Specified by:
shutdown in interface I_Main

getAuthenticate

public I_Authenticate getAuthenticate()
Access the authentication singleton.


getXmlBlaster

public I_XmlBlaster getXmlBlaster()
Access the xmlBlaster singleton.


checkForKeyboardInput

private void checkForKeyboardInput()
Check for keyboard entries from console.

Supported input is: <ul> <li>'g' to pop up the control panel GUI</li> <li>'d' to dump the internal state of xmlBlaster</li> <li>'q' to quit xmlBlaster</li> </ul>

NOTE: This method never returns, only on exit for 'q'


isHalted

public boolean isHalted()
Specified by:
isHalted in interface I_Main

getName

public java.lang.String getName()
A human readable name of the listener for logging.

Enforced by I_RunlevelListener

Specified by:
getName in interface I_RunlevelListener

runlevelChange

public void runlevelChange(int from,
                           int to,
                           boolean force)
                    throws XmlBlasterException
Invoked on run level change, see RunlevelManager.RUNLEVEL_HALTED and RunlevelManager.RUNLEVEL_RUNNING

Enforced by I_RunlevelListener

Specified by:
runlevelChange in interface I_RunlevelListener
Parameters:
from - The current runlevel
to - The runlevel we want to switch to
force - If true force the change even if messages are lost
Throws:
XmlBlasterException
See Also:
I_RunlevelListener.runlevelChange(int, int, boolean)

newException

public void newException(XmlBlasterException e)
Description copied from interface: I_XmlBlasterExceptionHandler
This will be called from XmlBlasterException constructor.

Specified by:
newException in interface I_XmlBlasterExceptionHandler
Parameters:
e - The new created exception

shutdownHook

public void shutdownHook()
You will be notified when the runtime exits.

Specified by:
shutdownHook in interface I_SignalListener
See Also:
I_SignalListener.shutdownHook()

keyboardUsage

private void keyboardUsage()
Keyboard input usage.


usage

private void usage()
Command line usage.


main

public static void main(java.lang.String[] args)
Invoke: java org.xmlBlaster.Main


xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.