Framework Professional Edition Package


org.mbs.services.cu
Interface StateVariableListener

All Known Subinterfaces:
CUAdminCallback, StateVariableBatchListener

public interface StateVariableListener

StateVariableListeners are registered as OSGi Services. The control unit uses whiteboard pattern to notify the listeners, i.e. Control Unit Admin is responsible for tracking these services and to deliver them the appropriate events to them.
A service registration property may be used as a filter to limit the number of received events and to specify certain control unit and/or state variables to listen for. The key of this property is ControlConstants.EVENT_FILTER with value of type String representing LDAP filtering expression. The properties which may be used in the LDAP filer are ControlConstants.TYPE, {org.mbs.services.cu.ControlConstants#ID} and {org.mbs.services.cu.ControlConstants#STATE_VARIABLE_ID} The listener will be notified only for changes in the value of the state variables whose id and type of the corresponding control unit and id of the state variable satisfies this filter. If property ControlConstants.EVENT_FILTER does not present, the listener will receive events for changing of all state variables. Listeners may use the ControlConstants.EVENT_SYNC property to specify that events are to be delivered synchronously.

Author:
Valentin Valchev , Stoyan Zoubev

Field Summary
static java.lang.String RECEIVE_VALUES_ON_REGISTER
          StateVariableListeners' which wish to receive upon registration the values of the state variables for which they are listening should have this property in their service registration properties (the value of the property doesn't matter).
 
Method Summary
 void stateVariableChanged(java.lang.String controlUnitType, java.lang.String controlUnitID, java.lang.String stateVariableID, java.lang.Object value)
          This is the listener's callback method.
 

Field Detail

RECEIVE_VALUES_ON_REGISTER

static final java.lang.String RECEIVE_VALUES_ON_REGISTER
StateVariableListeners' which wish to receive upon registration the values of the state variables for which they are listening should have this property in their service registration properties (the value of the property doesn't matter). If a listener has registered with such property and a new control unit with variables matching the filter of the listener is registered it will receive the values of these variables.

See Also:
Constant Field Values
Method Detail

stateVariableChanged

void stateVariableChanged(java.lang.String controlUnitType,
                          java.lang.String controlUnitID,
                          java.lang.String stateVariableID,
                          java.lang.Object value)
This is the listener's callback method. It is called when a state variable of a certain control unit is changed.

Parameters:
controlUnitType - Control Unit type.
controlUnitID - id of the Control Unit which variable has changed.
stateVariableID - id of the changed state variable.
value - the new value of the state variable.

Framework Professional Edition Package


Copyright © 1999-2007 ProSyst Software GmbH. All Rights Reserved