| java.lang.Object org.netbeans.CLIHandler
All known Subclasses: org.fakepkg.FakeHandler, org.netbeans.core.CLIOptions2, org.fakepkg.UserDirHandler,
CLIHandler | abstract public class CLIHandler extends Object (Code) | | Command Line Interface and User Directory Locker support class.
Subclasses may be registered into the system to handle special command-line options.
To be registered, use META-INF/services/org.netbeans.CLIHandler
in a JAR file in the startup or dynamic class path (e.g. lib/ext/
or lib/).
author: Jaroslav Tulach since: org.netbeans.core/1 1.18 See Also: "#32054" See Also: Specification |
Inner Class :final static class Status | |
Inner Class :static interface Execute | |
Inner Class :final public static class Args extends Object | |
Field Summary | |
final public static int | WHEN_BOOT Used during bootstrap sequence. | final public static int | WHEN_EXTRA Extra set of inits. | final public static int | WHEN_INIT Used during later initialization or while NetBeans is up and running. |
Constructor Summary | |
protected | CLIHandler(int when) Create a CLI handler and indicate its preferred timing. |
Method Summary | |
abstract protected int | cli(Args args) Process some set of command-line arguments. | static int | finishInitialization(boolean recreate) Run any
CLIHandler.WHEN_INIT handlers that were passed to the original command line. | static Status | initialize(String[] args, InputStream is, OutputStream os, java.io.OutputStream err, MainImpl.BootClassLoader loader, boolean failOnUnknownOptions, boolean cleanLockFile, Runnable runWhenHome) Initializes the system by creating lock file. | static Status | initialize(Args args, Integer block, Collection handlers, boolean failOnUnknownOptions, boolean cleanLockFile, Runnable runWhenHome) Initializes the system by creating lock file. | protected static int | notifyHandlers(Args args, Collection handlers, int when, boolean failOnUnknownOptions, boolean consume) Notification of available handlers. | protected static void | showHelp(PrintWriter w, Collection handlers, int when) | public static synchronized void | stopServer() Stops the server. | abstract protected void | usage(PrintWriter w) Print usage information for this handler. |
WHEN_BOOT | final public static int WHEN_BOOT(Code) | | Used during bootstrap sequence. Should only be used by core, not modules.
|
WHEN_EXTRA | final public static int WHEN_EXTRA(Code) | | Extra set of inits.
|
WHEN_INIT | final public static int WHEN_INIT(Code) | | Used during later initialization or while NetBeans is up and running.
|
cli | abstract protected int cli(Args args)(Code) | | Process some set of command-line arguments.
Unrecognized or null arguments should be ignored.
Recognized arguments should be nulled out.
Parameters: args - arguments error value or 0 if everything is all right |
finishInitialization | static int finishInitialization(boolean recreate)(Code) | | Run any
CLIHandler.WHEN_INIT handlers that were passed to the original command line.
Should be called when the system is up and ready.
Cancels any existing actions, in case it is called twice.
the result of executing the handlers |
initialize | static Status initialize(String[] args, InputStream is, OutputStream os, java.io.OutputStream err, MainImpl.BootClassLoader loader, boolean failOnUnknownOptions, boolean cleanLockFile, Runnable runWhenHome)(Code) | | Initializes the system by creating lock file.
Parameters: args - the command line arguments to recognize Parameters: classloader - to find command CLIHandlers in Parameters: failOnUnknownOptions - if true, fail (status 2) if some options are not recognized (also checks for -? and -help) Parameters: cleanLockFile - removes lock file if it appears to be dead the file to be used as lock file or null parsing of args failed |
initialize | static Status initialize(Args args, Integer block, Collection handlers, boolean failOnUnknownOptions, boolean cleanLockFile, Runnable runWhenHome)(Code) | | Initializes the system by creating lock file.
Parameters: args - the command line arguments to recognize Parameters: block - the state we want to block in Parameters: handlers - all handlers to use Parameters: failOnUnknownOptions - if true, fail (status 2) if some options are not recognized (also checks for -? and -help) Parameters: cleanLockFile - removes lock file if it appears to be dead Parameters: runWhenHome - runnable to be executed when netbeans.user property is set a status summary |
notifyHandlers | protected static int notifyHandlers(Args args, Collection handlers, int when, boolean failOnUnknownOptions, boolean consume)(Code) | | Notification of available handlers.
non-zero if one of the handlers fails |
stopServer | public static synchronized void stopServer()(Code) | | Stops the server.
|
usage | abstract protected void usage(PrintWriter w)(Code) | | Print usage information for this handler.
Parameters: w - a writer to print to |
|
|