org.objectweb.proactive.core.util
Class ThreadStoreImpl

java.lang.Object
  |
  +--org.objectweb.proactive.core.util.ThreadStoreImpl
All Implemented Interfaces:
java.io.Serializable, ThreadStore

public class ThreadStoreImpl
extends java.lang.Object
implements ThreadStore, java.io.Serializable

A straightford implementation of the threadstore interface.

Since:
ProActive 0.9.2
Version:
1.0, 2002/05
Author:
ProActive Team
See Also:
Serialized Form

Constructor Summary
ThreadStoreImpl()
          Creates a new ThreadStore that is opened after creation.
ThreadStoreImpl(boolean isOpened)
          Constructor for ThreadStoreImpl.
 
Method Summary
 void close()
          Closes the store.
 void enter()
          Signals that a thread wants to enter the store.
 void exit()
          Signals that a thread exited the store.
 void open()
          Opens the store.
 int threadCount()
          Returns how many threads are in the store.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadStoreImpl

public ThreadStoreImpl()
Creates a new ThreadStore that is opened after creation.


ThreadStoreImpl

public ThreadStoreImpl(boolean isOpened)
Constructor for ThreadStoreImpl.

Parameters:
isOpened - true is the store is opened after creation
Method Detail

threadCount

public int threadCount()
Description copied from interface: ThreadStore
Returns how many threads are in the store. This method is non blocking.

Specified by:
threadCount in interface ThreadStore
Returns:
how many threads are in the store.
See Also:
ThreadStore.threadCount()

enter

public void enter()
Description copied from interface: ThreadStore
Signals that a thread wants to enter the store. If the store is opened the call is non blocking. If the store is closed or closing the call is blocking until the store opens.

Specified by:
enter in interface ThreadStore
See Also:
ThreadStore.enter()

exit

public void exit()
Description copied from interface: ThreadStore
Signals that a thread exited the store. The call is non blocking.

Specified by:
exit in interface ThreadStore
See Also:
ThreadStore.exit()

close

public void close()
Description copied from interface: ThreadStore
Closes the store. The call is blocking until all threads currently in the store exit. No other thread can enter the store after this call. Therefore the store can be closing or closed.

Specified by:
close in interface ThreadStore
See Also:
ThreadStore.close()

open

public void open()
Description copied from interface: ThreadStore
Opens the store. The call is non blocking. It allows the thread waiting to enter the store to proceed.

Specified by:
open in interface ThreadStore
See Also:
ThreadStore.open()


Copyright © April 2004 INRIA All Rights Reserved.