org.openmdx.base.application.control
Class ApplicationController

java.lang.Object
  extended by org.openmdx.base.application.control.ApplicationController
All Implemented Interfaces:
ExceptionListener, EventListener, CmdLineListener
Direct Known Subclasses:
ApplicationController_1_0

public class ApplicationController
extends Object
implements CmdLineListener, ExceptionListener

ApplicationController


Field Summary
protected  Application application
          The application
 
Constructor Summary
ApplicationController(String[] args)
          Creates an ApplicationController object.
 
Method Summary
 void cmdLineBadArgs(CmdLineEvent e)
           
 void cmdLineHelpRequest(CmdLineEvent e)
          CmdLineEvent listener.
 void cmdLineTrace(CmdLineEvent e)
          CmdLineEvent listener.
 void cmdLineVersionRequest(CmdLineEvent e)
          CmdLineEvent listener.
 void exceptionThrown(Exception e)
          ExceptionEvent listener.
 void exit()
          Terminates the currently running application using the applications exit code to exit.
 Application getApplication()
          Returns the application object.
 CmdLineArgs getCmdLineArgs()
          Returns the command line arguments as processed by the command line processor.
 String[] getRawArgs()
          Returns the command line arguments as received from the VM's main.
protected  void handleExceptionEvent(Exception exception)
          Handle an exception event by delegating it to the appropriate listener.
 void initLogging(String configName, String logSource)
          Initializes the logging system.
 void registerApplication(Application app)
          Register an application with the controller.
 void registerManageable(Manageable manageable)
          Register a manageable with the controller.
 void run()
          Runs the controller.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

application

protected Application application
The application

Constructor Detail

ApplicationController

public ApplicationController(String[] args)
Creates an ApplicationController object.

Parameters:
args - The command line arguments as obtained from the main()
Method Detail

run

public void run()
Runs the controller.

Parameters:
args - The command line arguments as obtained from the main

registerApplication

public void registerApplication(Application app)
Register an application with the controller.

Parameters:
app - The application

registerManageable

public void registerManageable(Manageable manageable)
Register a manageable with the controller.

Parameters:
app - The application

cmdLineBadArgs

public void cmdLineBadArgs(CmdLineEvent e)
Specified by:
cmdLineBadArgs in interface CmdLineListener

cmdLineHelpRequest

public void cmdLineHelpRequest(CmdLineEvent e)
CmdLineEvent listener.

Specified by:
cmdLineHelpRequest in interface CmdLineListener
See Also:
CmdLineListener.cmdLineHelpRequest(org.openmdx.base.application.control.CmdLineEvent)

cmdLineVersionRequest

public void cmdLineVersionRequest(CmdLineEvent e)
CmdLineEvent listener.

Specified by:
cmdLineVersionRequest in interface CmdLineListener
See Also:
CmdLineListener.cmdLineVersionRequest(org.openmdx.base.application.control.CmdLineEvent)

cmdLineTrace

public void cmdLineTrace(CmdLineEvent e)
CmdLineEvent listener.

Specified by:
cmdLineTrace in interface CmdLineListener
See Also:
CmdLineListener.cmdLineTrace(org.openmdx.base.application.control.CmdLineEvent)

exceptionThrown

public void exceptionThrown(Exception e)
ExceptionEvent listener.

Specified by:
exceptionThrown in interface ExceptionListener
See Also:
ExceptionListener.exception(org.openmdx.compatibility.base.application.control.ExceptionEvent)

exit

public void exit()
Terminates the currently running application using the applications exit code to exit. The argument serves as a status code; by convention, a nonzero status code indicates abnormal termination. This method calls the exit method in class System. This method never returns normally.


getApplication

public Application getApplication()
Returns the application object.

Returns:
the application object

initLogging

public void initLogging(String configName,
                        String logSource)
Initializes the logging system.

Parameters:
configName - A configuration name
logSource - A log source

getCmdLineArgs

public CmdLineArgs getCmdLineArgs()
Returns the command line arguments as processed by the command line processor.

Returns:
CmdLineArgs

getRawArgs

public String[] getRawArgs()
Returns the command line arguments as received from the VM's main.

Returns:
String[]

handleExceptionEvent

protected void handleExceptionEvent(Exception exception)
Handle an exception event by delegating it to the appropriate listener.

Parameters:
exception - An exception


This software is published under the BSD license. Copyright © 2003-2008, OMEX AG, Switzerland, All rights reserved. Use is subject to license terms.