org.epics.ioc.db
Interface DBRecord

All Superinterfaces:
DBData, PVData, PVRecord, PVStructure, Requestor
All Known Implementing Classes:
DBRecordBase

public interface DBRecord
extends DBData, PVRecord

Interface for a record instance.

Author:
mrk

Method Summary
 void addListenerSource(AbstractDBData dbData)
          Used for communication between DBRecordBase and AbstractDBData.
 void beginProcess()
          Begin a set of record processing.
 RecordListener createRecordListener(DBListener listener)
          Create a RecordListener.
 void endProcess()
          End of record processing.
 DBD getDBD()
          Get the DBD that contains this record.
 IOCDB getIOCDB()
          Get the IOCDB to which this record belongs.
 int getRecordID()
          Get the id for this record instance.
 RecordProcess getRecordProcess()
          Get the RecordProcess for this record instance.
 void lock()
          Lock the record instance.
 void lockOtherRecord(DBRecord otherRecord)
          While holding lock on this record lock another record.
 void removeRecordListener(RecordListener listener)
          Remove a RecordListener interface.
 void removeRecordListeners()
          Remove all listeners.
 void setDBD(DBD dbd)
          Set the DBD that contains this record instance.
 void setIOCDB(IOCDB iocdb)
          Set the IOCDB.
 boolean setRecordProcess(RecordProcess recordProcess)
          Set the RecordProcess.
 void unlock()
          Unlock the record.
 
Methods inherited from interface org.epics.ioc.db.DBData
addListener, getDBRecord, getSupport, postPut, removeListener, setSupport
 
Methods inherited from interface org.epics.ioc.pv.PVRecord
getRecordName, message
 
Methods inherited from interface org.epics.ioc.pv.PVStructure
beginPut, endPut, getFieldPVDatas, replaceStructureField
 

Method Detail

lock

void lock()
Lock the record instance. This must be called before accessing anything contained in the record.


unlock

void unlock()
Unlock the record.


lockOtherRecord

void lockOtherRecord(DBRecord otherRecord)
While holding lock on this record lock another record. If the other record is already locked than this record may be unlocked. The caller must call the unlock method of the other record when done with it.

Parameters:
otherRecord - the other record.

getRecordProcess

RecordProcess getRecordProcess()
Get the RecordProcess for this record instance.

Returns:
The RecordProcess or null if has been set.

setRecordProcess

boolean setRecordProcess(RecordProcess recordProcess)
Set the RecordProcess.

Parameters:
recordProcess - The RecordProcess for this record instance.
Returns:
true if the support was set and false if the support already was set.

getRecordID

int getRecordID()
Get the id for this record instance. Each instance is assigned a unique integer id.

Returns:
The id.

beginProcess

void beginProcess()
Begin a set of record processing.


endProcess

void endProcess()
End of record processing.


createRecordListener

RecordListener createRecordListener(DBListener listener)
Create a RecordListener. This must be called by a client that wants to call DBData.addListener for one or more fields of this record instance.

Parameters:
listener - The DBListener interface.
Returns:
A RecordListener interface.

removeRecordListener

void removeRecordListener(RecordListener listener)
Remove a RecordListener interface. This also removes all calls to DBData.addListener;

Parameters:
listener - The Listen interface returned by the call to createListener.

removeRecordListeners

void removeRecordListeners()
Remove all listeners. Any code that modifies the structure of a record must call this before making modifications.


addListenerSource

void addListenerSource(AbstractDBData dbData)
Used for communication between DBRecordBase and AbstractDBData. AbstractDBData calls this the first time DBData.addListener is called.

Parameters:
dbData - The AbstractDBData instance.

getDBD

DBD getDBD()
Get the DBD that contains this record.

Returns:
The DBD or null if it was never set.

setDBD

void setDBD(DBD dbd)
Set the DBD that contains this record instance.

Parameters:
dbd - The DBD.

getIOCDB

IOCDB getIOCDB()
Get the IOCDB to which this record belongs. This can change so user code should never save the return value.

Returns:
The current IOC database.

setIOCDB

void setIOCDB(IOCDB iocdb)
Set the IOCDB.

Parameters:
iocdb - The iocdb to which this record belongs. This is called after an IOCDB is merged into the master to change it to the master.