Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

com::cosylab::acs::maci::manager::ComponentInfoTopologicalSortManager Class Reference

Collaboration diagram for com::cosylab::acs::maci::manager::ComponentInfoTopologicalSortManager:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ComponentInfoTopologicalSortManager (HandleDataStore components, HandleDataStore containers, ReaderPreferenceReadWriteLock activationPendingRWLock, Set pendingContainerShutdown, ThreadPoolExecutor threadPool, Logger logger)
void run ()
void requestTopologicalSort ()
synchronized void notifyTopologyChange (int containerHandleToNotify)
ComponentInfo[] getComponentShutdownOrder (ContainerInfo containerInfo)
synchronized void destroy ()

Private Member Functions

void notifyContainerShutdownOrder (ContainerInfo containerInfo, int[] handles)

Private Attributes

HandleDataStore components
HandleDataStore containers
volatile boolean destroyed = false
ReaderPreferenceReadWriteLock activationPendingRWLock
HashSet dirtyContainerMap = new HashSet()
Object listLock = new Object()
ComponentInfo[] currentTSList = new ComponentInfo[0]
Set pendingContainerShutdown
ThreadPoolExecutor threadPool
Logger logger
Map pendingContainerNotifications = new HashMap()

Detailed Description

Manages TS.


Constructor & Destructor Documentation

com::cosylab::acs::maci::manager::ComponentInfoTopologicalSortManager::ComponentInfoTopologicalSortManager HandleDataStore  components,
HandleDataStore  containers,
ReaderPreferenceReadWriteLock  activationPendingRWLock,
Set  pendingContainerShutdown,
ThreadPoolExecutor  threadPool,
Logger  logger
[inline]
 

Parameters:
components 
containers 


Member Function Documentation

synchronized void com::cosylab::acs::maci::manager::ComponentInfoTopologicalSortManager::destroy  )  [inline]
 

Destroy (terminate thread).

ComponentInfo [] com::cosylab::acs::maci::manager::ComponentInfoTopologicalSortManager::getComponentShutdownOrder ContainerInfo  containerInfo  )  [inline]
 

Get component shutdown order for container.

Parameters:
containerInfo valid container's info, if null complete TS is returned.
Returns:
component shutdown order

void com::cosylab::acs::maci::manager::ComponentInfoTopologicalSortManager::notifyContainerShutdownOrder ContainerInfo  containerInfo,
int[]  handles
[inline, private]
 

Task thats invokes Container::shutdown method.

Add new notification. This will keep only the latest one.

Parameters:
handles 
Returns:
true if notification is being accepted

synchronized void com::cosylab::acs::maci::manager::ComponentInfoTopologicalSortManager::notifyTopologyChange int  containerHandleToNotify  )  [inline]
 

Notify about (possible) topology change and initiates sorting.

Parameters:
containerHandleToNotify container handle to notify.

void com::cosylab::acs::maci::manager::ComponentInfoTopologicalSortManager::requestTopologicalSort  )  [inline]
 

Request topological sort.

void com::cosylab::acs::maci::manager::ComponentInfoTopologicalSortManager::run  )  [inline]
 

(Sync is clean since activationPendingRWLock is acquired and all notify request is issued only from its reader lock).

See also:
java.lang.Runnable#run()


Member Data Documentation

ReaderPreferenceReadWriteLock com::cosylab::acs::maci::manager::ComponentInfoTopologicalSortManager::activationPendingRWLock [private]
 

Lock.

HandleDataStore com::cosylab::acs::maci::manager::ComponentInfoTopologicalSortManager::components [private]
 

Components data store.

HandleDataStore com::cosylab::acs::maci::manager::ComponentInfoTopologicalSortManager::containers [private]
 

Containers data store.

ComponentInfo [] com::cosylab::acs::maci::manager::ComponentInfoTopologicalSortManager::currentTSList = new ComponentInfo[0] [private]
 

Current ordered TS list.

volatile boolean com::cosylab::acs::maci::manager::ComponentInfoTopologicalSortManager::destroyed = false [private]
 

Stastus flag.

HashSet com::cosylab::acs::maci::manager::ComponentInfoTopologicalSortManager::dirtyContainerMap = new HashSet() [private]
 

Dirty map.

Object com::cosylab::acs::maci::manager::ComponentInfoTopologicalSortManager::listLock = new Object() [private]
 

Lock.

Logger com::cosylab::acs::maci::manager::ComponentInfoTopologicalSortManager::logger [private]
 

Logger.

Map com::cosylab::acs::maci::manager::ComponentInfoTopologicalSortManager::pendingContainerNotifications = new HashMap() [private]
 

Informs containers abouts its component shutdown order.

Parameters:
containerInfo container to inform
handles ordered list of component handles

Set com::cosylab::acs::maci::manager::ComponentInfoTopologicalSortManager::pendingContainerShutdown [private]
 

List of all pending container shutdowns.

ThreadPoolExecutor com::cosylab::acs::maci::manager::ComponentInfoTopologicalSortManager::threadPool [private]
 

Thread pool (guarantees order of execution).


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 03:11:20 2009 for ACS Java API by doxygen 1.3.8