oracle.dacf.util
Class SimpleInfoBusConsumer
java.lang.Object
|
+--javax.infobus.InfoBusMemberSupport
|
+--oracle.dacf.util.SimpleInfoBusConsumer
- All Implemented Interfaces:
- java.util.EventListener, javax.infobus.InfoBusDataConsumer, javax.infobus.InfoBusEventListener, javax.infobus.InfoBusMember, java.beans.PropertyChangeListener
- public class SimpleInfoBusConsumer
- extends javax.infobus.InfoBusMemberSupport
- implements javax.infobus.InfoBusDataConsumer
This class allows a class to easily become an InfoBusConsumer.
Instances of this class must be members of the InfoBus before the
various findX methods are called. This is done by setting
the InfoBus name with setInfoBusName(). If the null
constructor is used to create an instance, then the instance will join
the default InfoBus as identified by
SessionInfo.DEFAULT_INFOBUS_NAME.
This class could be used in its present for but really should be
subclassed. Subclasses should override dataItemRevoked()
(and possible dataItemAvailable()) that they can take notice
of when the DataItem that was retrieved via findX() is being
revoked. Using a revoked DataItem will most likely result is numerous
exceptions being thrown.
Fields inherited from class javax.infobus.InfoBusMemberSupport |
m_infoBus, m_propSupport, m_sourceRef, m_syncLock, m_vetoSupport |
Method Summary |
protected java.lang.Object |
_findDataItem(java.lang.String name)
Looks for a named object on the InfoBus |
void |
dataItemAvailable(javax.infobus.InfoBusItemAvailableEvent event)
|
void |
dataItemRevoked(javax.infobus.InfoBusItemRevokedEvent event)
|
javax.infobus.DataItem |
findDataItem(java.lang.String name)
Looks for a named DataItem on the bus. |
javax.infobus.DbAccess |
findDbAccess(java.lang.String name)
Looks for a named DbAccess item on the bus. |
javax.infobus.ImmediateAccess |
findImmediateAccess(java.lang.String name)
Looks for a named ImmediateAccess item on the bus. |
javax.infobus.RowsetAccess |
findRowsetAccess(java.lang.String name)
Looks for a named RowsetAccess item on the bus. |
javax.infobus.ScrollableRowsetAccess |
findScrollableRowsetAccess(java.lang.String name)
Looks for a named ScrollableRowsetAccess item on the bus. |
java.lang.String |
getInfoBusName()
|
void |
propertyChange(java.beans.PropertyChangeEvent event)
|
void |
setInfoBusName(java.lang.String infoBusName)
Sets the name of the InfoBus to use and causes the instance to join
that bus. |
Methods inherited from class javax.infobus.InfoBusMemberSupport |
addInfoBusPropertyListener, addInfoBusVetoableListener, getInfoBus, joinInfoBus, joinInfoBus, leaveInfoBus, removeInfoBusPropertyListener, removeInfoBusVetoableListener, setInfoBus |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleInfoBusConsumer
public SimpleInfoBusConsumer()
SimpleInfoBusConsumer
public SimpleInfoBusConsumer(java.lang.String infoBusName)
setInfoBusName
public void setInfoBusName(java.lang.String infoBusName)
throws javax.infobus.InfoBusMembershipException,
java.beans.PropertyVetoException
- Sets the name of the InfoBus to use and causes the instance to join
that bus. This method must be called before any of the findX
methods are called.
- Parameters:
infoBusName
- The name of the bus to look on.
getInfoBusName
public java.lang.String getInfoBusName()
- Returns:
- The name of the bus to look on.
findImmediateAccess
public javax.infobus.ImmediateAccess findImmediateAccess(java.lang.String name)
- Looks for a named ImmediateAccess item on the bus.
- Returns:
- the requested ImmediateAccess item if it is available
findRowsetAccess
public javax.infobus.RowsetAccess findRowsetAccess(java.lang.String name)
- Looks for a named RowsetAccess item on the bus.
- Returns:
- the requested RowsetAccess item if it is available
findScrollableRowsetAccess
public javax.infobus.ScrollableRowsetAccess findScrollableRowsetAccess(java.lang.String name)
- Looks for a named ScrollableRowsetAccess item on the bus.
- Returns:
- the requested ScrollableRowsetAccess item if it is available
findDbAccess
public javax.infobus.DbAccess findDbAccess(java.lang.String name)
- Looks for a named DbAccess item on the bus.
- Returns:
- the requested DbAccess item if it is available
findDataItem
public javax.infobus.DataItem findDataItem(java.lang.String name)
- Looks for a named DataItem on the bus.
- Returns:
- the requested DataItem if it is available
_findDataItem
protected java.lang.Object _findDataItem(java.lang.String name)
- Looks for a named object on the InfoBus
- Returns:
- the named object if it is available on the bus
dataItemAvailable
public void dataItemAvailable(javax.infobus.InfoBusItemAvailableEvent event)
- Specified by:
dataItemAvailable
in interface javax.infobus.InfoBusDataConsumer
dataItemRevoked
public void dataItemRevoked(javax.infobus.InfoBusItemRevokedEvent event)
- Specified by:
dataItemRevoked
in interface javax.infobus.InfoBusDataConsumer
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent event)
- Specified by:
propertyChange
in interface java.beans.PropertyChangeListener