one.world.core
Class ConcurrencyDomain

java.lang.Object
  |
  +--one.world.core.Domain
        |
        +--one.world.core.ConcurrencyDomain
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
NestedConcurrencyDomain

public class ConcurrencyDomain
extends Domain
implements Serializable

Implementation of a concurrency domain. A concurrency domain provides an animator for an environment. It is associated with an environment when the environment is created and cannot be changed afterwards. The ID of a concurrency domain is the same ID as the ID of the corresponding environment.

Version:
$Revision: 1.29 $
See Also:
Animator, Environment, Serialized Form

Method Summary
 void animate(boolean singleThreaded, boolean isRoot)
          Animate this concurrency domain.
 int getThreadNumber()
          Get the current number of threads for this concurrency domain's animator.
 boolean isConcurrent()
          Determine whether this concurrency domain's animator is concurrent, that is, if it can use more than one thread.
 void terminate()
          Terminate this concurrency domain.
 String toString()
          Return a string representation of this concurrency domain.
 
Methods inherited from class one.world.core.Domain
equals, getConcurrencyDomain, getId, getProtectionDomain, hashCode, isActive, isWrapped, unwrap
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

animate

public final void animate(boolean singleThreaded,
                          boolean isRoot)
Animate this concurrency domain. If this concurrency domain has not been associated with an animator, this method creates a new animator in the active state.

Invocations of this method must be synchronized externally.

Parameters:
singleThreaded - Flag for whether the newly created animator should be single-threaded.
isRoot - Flag for whether this is the root environment's main concurrency domain.
Throws:
SecurityException - Signals that the caller does not have permission to manage environments.

terminate

public final void terminate()
Terminate this concurrency domain. If this concurrency domain has not been terminated, this method terminates the concurrency domain and releases the concurrency domain's animator.

Invocations of this method must be synchronized externally.

Throws:
SecurityException - Signals that the caller does not have permission to manage environments.

isConcurrent

public final boolean isConcurrent()
Determine whether this concurrency domain's animator is concurrent, that is, if it can use more than one thread.
Returns:
true if this concurrency domain's animator is concurrent.
Throws:
IllegalStateException - Signals that this concurrency domain is not active.
See Also:
Animator.isConcurrent()

getThreadNumber

public final int getThreadNumber()
Get the current number of threads for this concurrency domain's animator.
Returns:
The number of threads for this concurrency domain's animator.
Throws:
IllegalStateException - Signals that this concurrency domain is not active.
See Also:
Animator.getThreadNumber()

toString

public String toString()
Return a string representation of this concurrency domain.
Overrides:
toString in class Object


(C) Copyright 2001 UW CSE