org.echarts.servlet.sip
Class JavaToEChartsMachine

java.lang.Object
  extended by org.echarts.servlet.sip.JavaToEChartsMachine
Direct Known Subclasses:
JavaToClick2DialFlow1Machine, JavaToClick2DialFlow4Machine, JavaToMonitorControlMachine, JavaToVxmlRedirectFSM

public abstract class JavaToEChartsMachine
extends java.lang.Object

Abstract class that can be subclassed for the purposes of providing an interface to an ECharts for SIP Servlets machine from its external environment. An interface that subclasses this class has access to a machine's ECharts monitor by way of putEvent(). It also has the option of overriding this class's init() method to initialize the instance. This class also provides a factory method to create an interface instance and a convenience method to create a new feature box and provide it with a EChartsMachineToJava instance.


Constructor Summary
JavaToEChartsMachine()
           
 
Method Summary
static
<T extends JavaToEChartsMachine>
T
getInstance(SipApplicationSession appSession)
          Gets existing JavaToEChartsMachine instance for specified appSession, or creates a new one if none currently exists.
static
<T extends JavaToEChartsMachine>
T
getInstance(java.lang.String uid)
          Gets existing JavaToEChartsMachine instance for specified appSession id, or creates a new one if no instance currently exists.
protected  void init(TransitionMachine machine)
          This method is called immediately after new JavaToEChartsMachine instance is created.
protected  void putEvent(MachineMonitorEvent event)
          Put an event to the machine's monitor.
protected  void setBox(FeatureBox box)
          Initializes this instance to use the putEvent() method if an instance of this class is created via a direct call to a constructor, rather than indeirectly via getInstance().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaToEChartsMachine

public JavaToEChartsMachine()
Method Detail

getInstance

public static final <T extends JavaToEChartsMachine> T getInstance(java.lang.String uid)
                                                        throws java.lang.Exception
Gets existing JavaToEChartsMachine instance for specified appSession id, or creates a new one if no instance currently exists. Instance class name is value of top-level machine name with prefix 'JavaTo' e.g. if top-level machine name is 'org.echarts.servlet.sip.features.monitorControl.MonitorControlMachine' then this method will return an instance of 'org.echarts.servlet.sip.features.monitorControl.JavaToMonitorControlMachine'.

Parameters:
sasId - the SIP application session ID associated with the JavaToEChartsMachine instance to be created
Returns:
JavaToEChartsMachine instance
Throws:
java.lang.Exception - if no application session is associated with specified sasId

getInstance

public static final <T extends JavaToEChartsMachine> T getInstance(SipApplicationSession appSession)
                                                        throws java.lang.Exception
Gets existing JavaToEChartsMachine instance for specified appSession, or creates a new one if none currently exists. Instance class name is value of top-level machine name with prefix 'JavaTo' e.g. if top-level machine name is 'org.echarts.servlet.sip.features.monitorControl.MonitorControlMachine' then this method will return an instance of 'org.echarts.servlet.sip.features.monitorControl.JavaToMonitorControlMachine'.

Parameters:
appSession - the SIP application session associated with the JavaToEChartsMachine instance to be created
Returns:
JavaToEChartsMachine instance
Throws:
java.lang.Exception

setBox

protected void setBox(FeatureBox box)
Initializes this instance to use the putEvent() method if an instance of this class is created via a direct call to a constructor, rather than indeirectly via getInstance(). There is no need to use this method if this instance is created the usual way via a call to getInstance() since the initialization will occur automatically.

Parameters:
box - FeatureBox instance associated with this interface instance.

putEvent

protected void putEvent(MachineMonitorEvent event)
Put an event to the machine's monitor.

Parameters:
event - the event to put to the monitor

init

protected void init(TransitionMachine machine)
             throws java.lang.Exception
This method is called immediately after new JavaToEChartsMachine instance is created. This method should be overridden in order to initialize subclass fields.

Parameters:
machine - application machine instance associated with this instance's SIP application session
Throws:
java.lang.Exception