org.epics.pvmanager
Interface PVWriter<T>

Type Parameters:
T - type of the write payload
All Known Implementing Classes:
PV

public interface PVWriter<T>

An object representing a writable PV. The write payload is specified by the generic type, and is changed is returned by write(java.lang.Object). Changes in values are notified through the PVWriterListener. Listeners can be registered from any thread. The value can only be accessed on the thread on which the listeners is called.

Author:
carcassi

Method Summary
 void addPVWriterListener(PVWriterListener listener)
          Adds a listener to the value.
 void close()
          De-registers all listeners, stops all notifications and closes all connections from the data sources needed by this.
 boolean isClosed()
          True if no more notifications are going to be sent for this PV.
 java.lang.Exception lastWriteException()
          Returns the last exception that was generated by write operations and clears it (subsequent call will return null).
 void removePVWriterListener(PVWriterListener listener)
          Removes a listener to the value.
 void write(T newValue)
          Writes a new value.
 

Method Detail

addPVWriterListener

void addPVWriterListener(PVWriterListener listener)
Adds a listener to the value. This method is thread safe.

Parameters:
listener - a new listener

removePVWriterListener

void removePVWriterListener(PVWriterListener listener)
Removes a listener to the value. This method is thread safe.

Parameters:
listener - the old listener

write

void write(T newValue)
Writes a new value. This method can be synchronous or synchronous depending on how the PV was created.

Parameters:
newValue -

close

void close()
De-registers all listeners, stops all notifications and closes all connections from the data sources needed by this. Once the PV is closed, it can't be re-opened. Subsequent calls to close do not do anything.


isClosed

boolean isClosed()
True if no more notifications are going to be sent for this PV.

Returns:
true if closed

lastWriteException

java.lang.Exception lastWriteException()
Returns the last exception that was generated by write operations and clears it (subsequent call will return null).

Returns:
the last generated exception or null