equip.data.beans
Class PropertyPublisherBean

java.lang.Object
  extended byjava.beans.beancontext.BeanContextChildSupport
      extended byequip.data.beans.PropertyPublisherBean
All Implemented Interfaces:
java.beans.beancontext.BeanContextChild, java.beans.beancontext.BeanContextServiceRevokedListener, java.beans.beancontext.BeanContextServicesListener, java.util.EventListener, java.beans.PropertyChangeListener, java.io.Serializable

public class PropertyPublisherBean
extends java.beans.beancontext.BeanContextChildSupport
implements java.beans.PropertyChangeListener

generic property publisher. monitors a bean property and publishes it as a Tuple in a dataspace. PropertyPublisherBean publishes a data item of class equip.data.Tuple with two fields. The first is a equip.data.StringBox with the nominal class name of the tuple, and the second is the property value itself (if a subclass of equip.runtime.ValueBase) or an equip.data.SerializedObject (if the property value is serializable). The name of the item (field of equip.data.ItemData) is also set by configuration to identify individual data items. The GUID is arbitrary and allocated on creation. to be active we require: - a dataspace to publish to (reference to equip.data.beans.DataspaceBean) - a source bean reference (java.lang.Object) - name of property to publish (String) - name to use for data item (String) - nominal tuple class name (String)

See Also:
Serialized Form

Field Summary
 boolean debug
          debug
protected  DataspaceBean mDataspace
          dataspace
protected  boolean mIsConnected
          active/connected
protected  java.lang.String mItemClassName
          item class name
protected  GUID mItemId
          dataspace item id
protected  java.lang.String mItemName
          item name
protected  java.lang.String mPropertyName
          source property name
protected  java.lang.Object mSource
          source as object
protected  java.lang.Object mValue
          last value
 
Fields inherited from class java.beans.beancontext.BeanContextChildSupport
beanContext, beanContextChildPeer, pcSupport, rejectedSetBCOnce, vcSupport
 
Constructor Summary
PropertyPublisherBean()
          no-arg constructor - required
 
Method Summary
protected  ItemData encodePropertyValue(java.lang.Object value)
          overridable type conversion of property value
 void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
          fire property changed
 DataspaceBean getDataspace()
          source getter
 boolean getDebug()
           
 java.lang.String getItemClassName()
          item name getter
 java.lang.String getItemName()
          item name getter
 java.lang.String getPropertyName()
          property name getter
 java.lang.Object getSource()
          source getter
 void propertyChange(java.beans.PropertyChangeEvent evt)
          property change event
 void setDataspace(DataspaceBean dataspace)
          dataspace setter - initialisation time only
 void setDebug(boolean d)
           
 void setItemClassName(java.lang.String itemClassName)
          item class name setter - initialisation time only
 void setItemName(java.lang.String itemName)
          item name setter - initialisation time only
 void setPropertyName(java.lang.String propertyName)
          property name setter - initialisation time only
 void setSource(java.lang.Object source)
          source setter - initialisation time only
 
Methods inherited from class java.beans.beancontext.BeanContextChildSupport
addPropertyChangeListener, addVetoableChangeListener, fireVetoableChange, getBeanContext, getBeanContextChildPeer, initializeBeanContextResources, isDelegated, releaseBeanContextResources, removePropertyChangeListener, removeVetoableChangeListener, serviceAvailable, serviceRevoked, setBeanContext, validatePendingSetBeanContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

public boolean debug
debug


mValue

protected java.lang.Object mValue
last value


mSource

protected java.lang.Object mSource
source as object


mPropertyName

protected java.lang.String mPropertyName
source property name


mDataspace

protected DataspaceBean mDataspace
dataspace


mItemName

protected java.lang.String mItemName
item name


mItemClassName

protected java.lang.String mItemClassName
item class name


mIsConnected

protected boolean mIsConnected
active/connected


mItemId

protected GUID mItemId
dataspace item id

Constructor Detail

PropertyPublisherBean

public PropertyPublisherBean()
no-arg constructor - required

Method Detail

setDebug

public void setDebug(boolean d)

getDebug

public boolean getDebug()

firePropertyChange

public void firePropertyChange(java.lang.String propertyName,
                               java.lang.Object oldValue,
                               java.lang.Object newValue)
fire property changed


setSource

public void setSource(java.lang.Object source)
source setter - initialisation time only


getSource

public java.lang.Object getSource()
source getter


setPropertyName

public void setPropertyName(java.lang.String propertyName)
property name setter - initialisation time only


getPropertyName

public java.lang.String getPropertyName()
property name getter


setItemName

public void setItemName(java.lang.String itemName)
item name setter - initialisation time only


getItemName

public java.lang.String getItemName()
item name getter


setItemClassName

public void setItemClassName(java.lang.String itemClassName)
item class name setter - initialisation time only


getItemClassName

public java.lang.String getItemClassName()
item name getter


setDataspace

public void setDataspace(DataspaceBean dataspace)
dataspace setter - initialisation time only


getDataspace

public DataspaceBean getDataspace()
source getter


propertyChange

public void propertyChange(java.beans.PropertyChangeEvent evt)
property change event

Specified by:
propertyChange in interface java.beans.PropertyChangeListener

encodePropertyValue

protected ItemData encodePropertyValue(java.lang.Object value)
                                throws java.io.IOException
overridable type conversion of property value

Throws:
java.io.IOException