org.netbeans.bootstrap/1 2.52

org.netbeans
Class CLIHandler

java.lang.Object
  extended by org.netbeans.CLIHandler

public abstract class CLIHandler
extends Object

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 ServiceProvider in a JAR file in the startup or dynamic class path (e.g. lib/ext/ or lib/).

Since:
org.netbeans.core/1 1.18
See Also:
"#32054", Specification

Nested Class Summary
static class CLIHandler.Args
          Class that represents available arguments to the CLI handlers.
 
Field Summary
static int WHEN_BOOT
          Used during bootstrap sequence.
static int WHEN_EXTRA
          Extra set of inits.
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
protected abstract  int cli(CLIHandler.Args args)
          Process some set of command-line arguments.
protected static int notifyHandlers(CLIHandler.Args args, Collection<? extends CLIHandler> handlers, int when, boolean failOnUnknownOptions, boolean consume)
          Notification of available handlers.
protected static void showHelp(PrintWriter w, Collection<? extends CLIHandler> handlers, int when)
           
static void stopServer()
          Stops the server.
protected abstract  void usage(PrintWriter w)
          Print usage information for this handler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WHEN_BOOT

public static final int WHEN_BOOT
Used during bootstrap sequence. Should only be used by core, not modules.

See Also:
Constant Field Values

WHEN_INIT

public static final int WHEN_INIT
Used during later initialization or while NetBeans is up and running.

See Also:
Constant Field Values

WHEN_EXTRA

public static final int WHEN_EXTRA
Extra set of inits.

See Also:
Constant Field Values
Constructor Detail

CLIHandler

protected CLIHandler(int when)
Create a CLI handler and indicate its preferred timing.

Parameters:
when - when to run the handler: WHEN_BOOT or WHEN_INIT
Method Detail

cli

protected abstract int cli(CLIHandler.Args args)
Process some set of command-line arguments. Unrecognized or null arguments should be ignored. Recognized arguments should be nulled out.

Parameters:
args - arguments
Returns:
error value or 0 if everything is all right

showHelp

protected static void showHelp(PrintWriter w,
                               Collection<? extends CLIHandler> handlers,
                               int when)

usage

protected abstract void usage(PrintWriter w)
Print usage information for this handler.

Parameters:
w - a writer to print to

notifyHandlers

protected static int notifyHandlers(CLIHandler.Args args,
                                    Collection<? extends CLIHandler> handlers,
                                    int when,
                                    boolean failOnUnknownOptions,
                                    boolean consume)
Notification of available handlers.

Returns:
non-zero if one of the handlers fails

stopServer

public static void stopServer()
Stops the server.


org.netbeans.bootstrap/1 2.52

Built on May 22 2012.  |  Portions Copyright 1997-2012 Oracle. All rights reserved.