JPF 0.10

org.java.plugin.boot
Class Boot

java.lang.Object
  extended byorg.java.plugin.boot.Boot

public final class Boot
extends java.lang.Object

Main class to get JPF based application running in different modes. Application mode may be specified as jpf.boot.mode System property (via -Djpf.boot.mode= command line argument). Supported values are:

start
Runs application in "background" ("service") mode.
stop
Stops application, running in "background" mode.
restart
Restarts application, running in "background" mode. If it is not started, the action is the same as just starting application.
shell
Runs application in "shell" (or "interactive") mode. It is possible to control "service" style application from command line. Note, that currently running application will be stopped first.
The "shell" mode is default. Application will be started in this mode if no jpf.boot.mode System property can be found.

Application configuration is expected to be in boot.properties file located in the current directory. Note that properties will be loaded using specially extended version of Properties class, which supports parameters substitution. If there is no applicationRoot property available in the given configuration, the current folder will be published as default value.

Standard configuration parameters are (all are optional when application is running in "shell" mode):

org.java.plugin.boot.appInitializer
Application initializer class, for details see ApplicationInitializer. Default is DefaultApplicationInitializer.
org.java.plugin.boot.errorHandler
Error handler class, for details see BootErrorHandler. Default is BootErrorHandlerConsole for "service" style applications and BootErrorHandlerGui for "interactive" applications.
org.java.plugin.boot.controlHost
Host to be used by background control service, no default values.
org.java.plugin.boot.controlPort
Port number to be used by background control service, no default values.
org.java.plugin.boot.splashImage
Path to an image file to be shown as splash screen. If no file given, the splash screen will not be shown.

Version:
$Id: Boot.java,v 1.9 2006/03/15 19:24:41 ddimon Exp $

Field Summary
static java.lang.String BOOT_ERROR_FILE_NAME
          Name of the file, where to put boot error details.
static java.lang.String BOOT_MODE_COMMAND_NAME
          Boot mode System property name.
static java.lang.String BOOT_MODE_RESTART
          "restart" mode boot command value.
static java.lang.String BOOT_MODE_SHELL
          "shell" mode boot command value.
static java.lang.String BOOT_MODE_START
          "start" mode boot command value.
static java.lang.String BOOT_MODE_STOP
          "stop" mode boot command value.
 
Method Summary
static void main(java.lang.String[] args)
          Call this method to start/stop application.
static void stopApplication(Application application)
          Stops the application, shuts down plug-in manager and disposes log service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BOOT_ERROR_FILE_NAME

public static final java.lang.String BOOT_ERROR_FILE_NAME
Name of the file, where to put boot error details.

See Also:
Constant Field Values

BOOT_MODE_COMMAND_NAME

public static final java.lang.String BOOT_MODE_COMMAND_NAME
Boot mode System property name.

See Also:
Constant Field Values

BOOT_MODE_SHELL

public static final java.lang.String BOOT_MODE_SHELL
"shell" mode boot command value.

See Also:
Constant Field Values

BOOT_MODE_START

public static final java.lang.String BOOT_MODE_START
"start" mode boot command value.

See Also:
Constant Field Values

BOOT_MODE_STOP

public static final java.lang.String BOOT_MODE_STOP
"stop" mode boot command value.

See Also:
Constant Field Values

BOOT_MODE_RESTART

public static final java.lang.String BOOT_MODE_RESTART
"restart" mode boot command value.

See Also:
Constant Field Values
Method Detail

main

public static void main(java.lang.String[] args)
Call this method to start/stop application.

Parameters:
args - command line arguments, not interpreted by this method but passed to ApplicationPlugin.initApplication(ExtendedProperties, String[]) method

stopApplication

public static void stopApplication(Application application)
                            throws java.lang.Exception
Stops the application, shuts down plug-in manager and disposes log service. Call this method before exiting interactive application. For service applications this method will be called automatically by control service or from shell.

Parameters:
application - application instance being stopped
Throws:
java.lang.Exception - if any error has occurred during application stopping

JPF 0.10

Copyright © 2004-2005 Dmitry Olshansky. All Rights Reserved.