com.gridsystems.nextgrid.api.pom.ref
Class ReferenceSupport<T>

java.lang.Object
  extended by com.gridsystems.nextgrid.api.pom.ref.ReferenceSupport<T>
Type Parameters:
T - The referenced type
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, nextgrid.api.pom.Reference<T>
Direct Known Subclasses:
DataHandlerReference, DomReference, ObjectReference, ScalarReference

public abstract class ReferenceSupport<T>
extends java.lang.Object
implements nextgrid.api.pom.Reference<T>

ReferenceSupport type.

Author:
Rodrigo Ruiz
See Also:
Serialized Form

Field Summary
protected static org.apache.commons.logging.Log LOG
          Enactor logger.
 
Constructor Summary
ReferenceSupport()
          Creates a new instance with default reader and writer collections.
ReferenceSupport(java.util.Set<nextgrid.api.pom.Process> readers, java.util.Set<nextgrid.api.pom.Process> writers)
          Creates a new instance, allowing to specify the readers and writers instances to use.
 
Method Summary
 void addReader(nextgrid.api.pom.Process reader)
          
 void addWriter(nextgrid.api.pom.Process writer)
          
 void clearLinks()
          
 ReferenceSupport<T> copy()
          
 void dispose()
          
 java.util.Set<nextgrid.api.pom.Process> getReaders()
          
 java.util.Set<nextgrid.api.pom.Process> getWriters()
          
 boolean isAvailable()
          
 java.util.concurrent.locks.Lock readLock()
          
 void removeReader(nextgrid.api.pom.Process reader)
          
 void removeWriter(nextgrid.api.pom.Process writer)
          
 void reset()
          
 void setAvailable(boolean available)
          
 void waitAvailable()
          
 java.util.concurrent.locks.Lock writeLock()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface nextgrid.api.pom.Reference
canCastFrom, canCastTo, castTo, getValue, getValueType, setValue
 

Field Detail

LOG

protected static final org.apache.commons.logging.Log LOG
Enactor logger.

Constructor Detail

ReferenceSupport

public ReferenceSupport()
Creates a new instance with default reader and writer collections.


ReferenceSupport

public ReferenceSupport(java.util.Set<nextgrid.api.pom.Process> readers,
                        java.util.Set<nextgrid.api.pom.Process> writers)
Creates a new instance, allowing to specify the readers and writers instances to use.

Parameters:
readers - A set to store reader processes
writers - A set to store writer processes
Method Detail

clearLinks

public final void clearLinks()

Specified by:
clearLinks in interface nextgrid.api.pom.Reference<T>

dispose

public final void dispose()

Specified by:
dispose in interface nextgrid.api.pom.Reference<T>

reset

public final void reset()

Specified by:
reset in interface nextgrid.api.pom.Reference<T>

addReader

public final void addReader(nextgrid.api.pom.Process reader)

Specified by:
addReader in interface nextgrid.api.pom.Reference<T>

addWriter

public final void addWriter(nextgrid.api.pom.Process writer)

Specified by:
addWriter in interface nextgrid.api.pom.Reference<T>

getReaders

public final java.util.Set<nextgrid.api.pom.Process> getReaders()

Specified by:
getReaders in interface nextgrid.api.pom.Reference<T>

getWriters

public final java.util.Set<nextgrid.api.pom.Process> getWriters()

Specified by:
getWriters in interface nextgrid.api.pom.Reference<T>

removeReader

public final void removeReader(nextgrid.api.pom.Process reader)

Specified by:
removeReader in interface nextgrid.api.pom.Reference<T>

removeWriter

public final void removeWriter(nextgrid.api.pom.Process writer)

Specified by:
removeWriter in interface nextgrid.api.pom.Reference<T>

readLock

public java.util.concurrent.locks.Lock readLock()

Specified by:
readLock in interface nextgrid.api.pom.Reference<T>

writeLock

public java.util.concurrent.locks.Lock writeLock()

Specified by:
writeLock in interface nextgrid.api.pom.Reference<T>

isAvailable

public boolean isAvailable()

Specified by:
isAvailable in interface nextgrid.api.pom.Reference<T>

setAvailable

public void setAvailable(boolean available)

Specified by:
setAvailable in interface nextgrid.api.pom.Reference<T>

waitAvailable

public void waitAvailable()
                   throws java.lang.InterruptedException

Specified by:
waitAvailable in interface nextgrid.api.pom.Reference<T>
Throws:
java.lang.InterruptedException

copy

public ReferenceSupport<T> copy()

Specified by:
copy in interface nextgrid.api.pom.Reference<T>


Copyright © 2006-2008 Grid Systems, S.A.. All Rights Reserved.