Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.0.0)

E17493-01

oracle.ide.cmd
Class ExitCommand

java.lang.Object
  extended by oracle.ide.controller.Command
      extended by oracle.ide.cmd.ExitCommand

@ThreadSafe
public class ExitCommand
extends Command

The ExitCommand class implements the ide exit command.

See Also:
Command

Field Summary
static java.lang.String SILENT_SAVE_ALL
          Context flag, the command will not popup additional dialogs while saving files if set
static java.lang.String SKIP_SAVE_ALL
          Context flag, the command will skip saving all files if set
 
Fields inherited from class oracle.ide.controller.Command
CANCEL, context, EXECUTING, MULTI_NODE, NO_CHANGE, NO_UNDO, NORMAL, OK, type
 
Constructor Summary
ExitCommand()
          Constructor.
 
Method Summary
static void addExecutorService(java.util.concurrent.ExecutorService executor, java.lang.String name)
          Registers an ExecutorService for shutdown when the IDE exits.
static void addExecutorService(java.util.concurrent.ExecutorService executor, java.lang.String name, boolean immediate)
          Registers an ExecutorService for shutdown when the IDE exits.
static void addShutdownHook(ShutdownHook hook)
          Add a shutdown hook.
static void addShutdownHook(ShutdownHook hook, double weight)
          Add a shutdown hook.
 int doit()
          Executes the system exit action.
static void registerTerminateHook(java.lang.Runnable terminateHandlingHook)
           Add a terminate-handling hook.
static void removeExecutorService(java.util.concurrent.ExecutorService executor)
          Unregisters an ExecutorService.
static void removeShutdownHook(ShutdownHook hook)
          Remove a shutdown hook.
static void runTerminateHook()
          Runs the terminate handling hook.
static void shutdown()
           
 
Methods inherited from class oracle.ide.controller.Command
enableConfirmation, getAffectedNodes, getContext, getData, getId, getName, getType, isGlobal, setContext, setData, undo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SKIP_SAVE_ALL

public static final java.lang.String SKIP_SAVE_ALL
Context flag, the command will skip saving all files if set

See Also:
Constant Field Values

SILENT_SAVE_ALL

public static final java.lang.String SILENT_SAVE_ALL
Context flag, the command will not popup additional dialogs while saving files if set

See Also:
Constant Field Values
Constructor Detail

ExitCommand

public ExitCommand()
Constructor.

Method Detail

registerTerminateHook

public static void registerTerminateHook(java.lang.Runnable terminateHandlingHook)

Add a terminate-handling hook. This hook is only for code that is to be called last in the termination sequence. In 11.1.2.0.0 only one terminate handling hook should ever be registered.

The hook is guaranteed to be called:

Parameters:
terminateHandlingHook - for handling termination.
Since:
11.1.2.0.0

runTerminateHook

public static void runTerminateHook()
Runs the terminate handling hook.


addShutdownHook

public static void addShutdownHook(ShutdownHook hook)
Add a shutdown hook.

Parameters:
hook - a shutdown hook.

addShutdownHook

public static void addShutdownHook(ShutdownHook hook,
                                   double weight)
Add a shutdown hook.

Parameters:
hook - a shutdown hook.

removeShutdownHook

public static void removeShutdownHook(ShutdownHook hook)
Remove a shutdown hook.

Parameters:
hook - the shutdown hook to remove.
Since:
11.0

addExecutorService

public static void addExecutorService(java.util.concurrent.ExecutorService executor,
                                      java.lang.String name)
Registers an ExecutorService for shutdown when the IDE exits. The name is used for logging purposes and does not need to be translateable.

Parameters:
executor - the ExecutorService to be shut down
name - the name of this ExecutorService
Throws:
java.lang.NullPointerException - if the executor or name are null
Since:
11.0

addExecutorService

public static void addExecutorService(java.util.concurrent.ExecutorService executor,
                                      java.lang.String name,
                                      boolean immediate)
Registers an ExecutorService for shutdown when the IDE exits. The name is used for logging purposes and does not need to be translateable.

The caller can specify whether to immediately interupt running tasks or to perform an orderly shutdown, where running tasks are allowed to complete.

Note that an orderly shutdown can delay the shutdown of the IDE, and should only be used for executors running critical tasks that cannot be cancelled.

Parameters:
executor - the ExecutorService to be shut down
name - the name of this ExecutorService
immediate - true to immediately interrupt any running tasks on shutdown, false to perform an orderly shutdown
Throws:
java.lang.NullPointerException - if the executor or name are null
Since:
11.0

removeExecutorService

public static void removeExecutorService(java.util.concurrent.ExecutorService executor)
Unregisters an ExecutorService. This is useful, for example, if the ExecutorService is shut down prior to IDE shutdown.

Parameters:
executor - the ExecutorService
Since:
11.0

shutdown

public static void shutdown()

doit

public int doit()
         throws java.lang.Exception
Executes the system exit action. It closes the main application window which in turn exits the application.

Specified by:
doit in class Command
Throws:
java.lang.Exception

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.0.0)

E17493-01

Copyright © 1997, 2011, Oracle. All rights reserved.