SmartFrog 3.10.000

org.smartfrog.sfcore.common
Class CreateNewChildThread

java.lang.Object
  extended by java.lang.Thread
      extended by org.smartfrog.sfcore.common.CreateNewChildThread
All Implemented Interfaces:
java.lang.Runnable

public class CreateNewChildThread
extends java.lang.Thread


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
CreateNewChildThread(java.lang.Object name, Prim parent, ComponentDescription cmp, Context parms)
          Creates a CreateNewChildThread that will upon running, execute the given CreateNewChild.
CreateNewChildThread(java.lang.Object name, Prim parent, ComponentDescription cmp, Context parms, Prim deployer)
          Creates a CreateNewChildThread that will upon running, execute the given CreateNewChild.
 
Method Summary
 boolean cancel(boolean mayInterruptIfRunning)
          Cancel the thread
protected  void done()
          Protected method invoked when this task transitions to state isDone (whether normally or via cancellation).
 java.lang.Object get()
          Wait
 java.lang.Object get(long timeout)
          Wait
 boolean isCancelled()
          Check if the state as CANCELLED
 boolean isDone()
          Checks if the tasks is done
 void run()
          Sets this Future to the result of computation unless it has been cancelled.
protected  void set(java.lang.Object v)
          Sets the result of this Future to the given value unless this future has already been set or has been cancelled.
protected  void setException(java.lang.Throwable t)
          Causes this future to report an ExecutionException with the given throwable as its cause, unless this Future has already been set or has been cancelled.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CreateNewChildThread

public CreateNewChildThread(java.lang.Object name,
                            Prim parent,
                            ComponentDescription cmp,
                            Context parms)
                     throws SmartFrogException
Creates a CreateNewChildThread that will upon running, execute the given CreateNewChild. Parent cannot be null

Parameters:
name - child name
parent - parent component
cmp - component description
parms - Context
Throws:
SmartFrogException - if callable is null

CreateNewChildThread

public CreateNewChildThread(java.lang.Object name,
                            Prim parent,
                            ComponentDescription cmp,
                            Context parms,
                            Prim deployer)
                     throws SmartFrogException
Creates a CreateNewChildThread that will upon running, execute the given CreateNewChild. If parent null then it will create a independent application but a deployer needs to be provided

Parameters:
name - child name
parent - parent component
cmp - component description
parms - Context
deployer - deployer
Throws:
SmartFrogException - if callable is null
Method Detail

isCancelled

public boolean isCancelled()
Check if the state as CANCELLED

Returns:
boolean

isDone

public boolean isDone()
Checks if the tasks is done

Returns:
boolean

cancel

public boolean cancel(boolean mayInterruptIfRunning)
Cancel the thread

Parameters:
mayInterruptIfRunning - boolean to interrupt
Returns:
boolean

get

public java.lang.Object get()
                     throws java.lang.InterruptedException,
                            SmartFrogException
Wait

Returns:
Object
Throws:
java.lang.InterruptedException - if interrupted
SmartFrogException - if failed

get

public java.lang.Object get(long timeout)
                     throws java.lang.InterruptedException,
                            SmartFrogException
Wait

Parameters:
timeout - timeout
Returns:
Object
Throws:
java.lang.InterruptedException - if interrupted
SmartFrogException - if failed

done

protected void done()
Protected method invoked when this task transitions to state isDone (whether normally or via cancellation). The default implementation does nothing. Subclasses may override this method to invoke completion callbacks or perform bookkeeping. Note that you can query status inside the implementation of this method to determine whether this task has been cancelled.


set

protected void set(java.lang.Object v)
Sets the result of this Future to the given value unless this future has already been set or has been cancelled.

Parameters:
v - the value

setException

protected void setException(java.lang.Throwable t)
Causes this future to report an ExecutionException with the given throwable as its cause, unless this Future has already been set or has been cancelled.

Parameters:
t - the cause of failure.

run

public void run()
Sets this Future to the result of computation unless it has been cancelled.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

SmartFrog CORE 3.10.000

(C) Copyright 1998-2006 Hewlett-Packard Development Company, LP