objectivehtml.oms
Class Signal

java.lang.Object
  |
  +--objectivehtml.oms.Signal

public final class Signal
extends java.lang.Object

This object represents a signal in OMS. The object includes the method that represents the signal and also the data that is associated with the signal. Any public method that returns a Signal object meets the requirements of being a signal method. However it must properly implement the Signal pattern to work correctly.

This is the implementation of the valueChanged(String,String) signal of HtmlInput:


 public Signal valueChanged(String sNewValue, String sOldValue)
 {
 	ParameterList objParamList = new ParameterList();
 	objParamList.addParam(sNewValue);
 	objParamList.addParam(sOldValue);
 	Signal objSignal = null;
 	try
 	{
 		objSignal = new Signal(signal("valueChanged(String, String)"), objParamList);
 	}
 	catch (Exception e)
 	{
 		e.printStackTrace();	// shouldn't happen
 	}
 	return objSignal;
 } // end valueChanged

 

To implement a signal method you need to do the following:

  1. Declare a public method that returns a Signal object, it should not throw an exception
  2. Instantiate a ParameterList object
  3. Add all the method parameters using the overloaded addParam method of the ParameterList class
  4. Instantiate a Signal object, pass to it a SignalId object that represents this method and also the parameter list
  5. Return the Signal object


Constructor Summary
Signal(SignalId objSignalId, ParameterList objParameterList)
          Constructs an instance of Signal.
 
Method Summary
 ParameterList getParameterList()
          Returns the parameter list
 SignalId getSignalId()
          Gets the signal id for this signal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Signal

public Signal(SignalId objSignalId,
              ParameterList objParameterList)
       throws InvalidParameterListException
Constructs an instance of Signal.
Parameters:
objSignalId - the signal id for this signal
objParameterList - the list of parameters for this signal
Throws:
InvalidParameterListException - if the number of parameters don't match or the parameter types don't match
Method Detail

getSignalId

public SignalId getSignalId()
Gets the signal id for this signal.
Returns:
the signal id

getParameterList

public ParameterList getParameterList()
Returns the parameter list
Returns:
the parameter list