wmx
Class WMX_component

java.lang.Object
  extended by wmx.WMX_component
All Implemented Interfaces:
com.FranckBarbier.Java._PauWare._Velcro.Velcro, com.FranckBarbier.Java._PauWare._Velcro.VelcroExecutor, com.FranckBarbier.Java._PauWare.Manager
Direct Known Subclasses:
Light, PauWare_component, TrafficLight

public abstract class WMX_component
extends java.lang.Object
implements com.FranckBarbier.Java._PauWare.Manager, com.FranckBarbier.Java._PauWare._Velcro.VelcroExecutor

The WMX internal manager used for controlling the internal behavior of a component embedded in a wireless device. It is also responsible for giving abstract knowledge of this behavior to the external manager of project WMX2JMX.

Author:
Fabien Romeo - fabien.romeo@univ-pau.fr

Field Summary
private  java.util.Vector _states
          Vector of com.FranckBarbier.Java.
private  ComponentWirelessPort _wirelessPort
          The wireless port to which are delegated the wireless communications.
 
Constructor Summary
WMX_component()
          Creates a new instance of WMX_component
 
Method Summary
 void addWirelessPort(ComponentWirelessPort wirelessPort)
          Connects a wireless port.
 void initialize(com.FranckBarbier.Java._PauWare.AbstractStatechart_monitor monitor)
          Not used (yet?).
protected  void registerState(com.FranckBarbier.Java._PauWare.AbstractStatechart s)
          Registers a state of the component's behavior into the manager.
 void run_to_completion(java.util.Hashtable execution)
          This method aims at communicating the stable consistent context of a state machine.
 void start_management()
          Effectively activates the management process.
protected  int stateID(com.FranckBarbier.Java._PauWare.AbstractStatechart s)
          Searches for the ID number of the given state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.FranckBarbier.Java._PauWare._Velcro.VelcroExecutor
execute
 

Field Detail

_states

private java.util.Vector _states
Vector of com.FranckBarbier.Java._PauWare.AbstractStatechart. This field is used to ID all the states of the component's behavior. These ID numbers are shared among internal and external managers.


_wirelessPort

private ComponentWirelessPort _wirelessPort
The wireless port to which are delegated the wireless communications. State changes are send with send_state_change(int stateIDs). Upon reception, incoming control commands are executed by execute(String action,Object[] args).

Constructor Detail

WMX_component

public WMX_component()
Creates a new instance of WMX_component

Method Detail

registerState

protected void registerState(com.FranckBarbier.Java._PauWare.AbstractStatechart s)
Registers a state of the component's behavior into the manager. WARNING: States have to be registered into both internal and external managers in the same order.

Parameters:
s - state to be registered.

stateID

protected int stateID(com.FranckBarbier.Java._PauWare.AbstractStatechart s)
Searches for the ID number of the given state.

Parameters:
s - a (registered) state.
Returns:
the ID number of the given state; -1 if not found.

addWirelessPort

public void addWirelessPort(ComponentWirelessPort wirelessPort)
Connects a wireless port.

Parameters:
wirelessPort - The wireless port to be connected.

start_management

public void start_management()
Effectively activates the management process.


initialize

public void initialize(com.FranckBarbier.Java._PauWare.AbstractStatechart_monitor monitor)
Not used (yet?). Needed for compatibility with PauWare (Manager interface).

Specified by:
initialize in interface com.FranckBarbier.Java._PauWare.Manager
Parameters:
monitor - The structure of the state machine.

run_to_completion

public void run_to_completion(java.util.Hashtable execution)
This method aims at communicating the stable consistent context of a state machine. Such a communication occurs after a run-to-completion cycle.

Specified by:
run_to_completion in interface com.FranckBarbier.Java._PauWare.Manager
Parameters:
execution - Result of the last execution. Keys: transitions:Transition; Values: executed_actions:[]