org.echarts.servlet.sip
Class EChartsMachineToJava

java.lang.Object
  extended by org.echarts.servlet.sip.SipToJava
      extended by org.echarts.servlet.sip.EChartsMachineToJava
Direct Known Subclasses:
Click2DialFlow4MachineToJavaImpl, FileBasedProvisioning

public abstract class EChartsMachineToJava
extends SipToJava

Abstract class that can be subclassed for the purposes of defining an impelmentation of the interface from an ECharts for SIP Servlets machine to its external environment. An EChartsMachineToJava interface implementation class that does not subclass this class will not inherit this class's putEvent() method. This class provides a factory method for creating an interface instance, whether it subclasses this class or not.


Constructor Summary
EChartsMachineToJava()
           
 
Method Summary
static
<T> T
getInstance(SipApplicationSession appSession)
          Gets existing interface instance, otherwise creates new interface instance for specified appSession.
protected  java.lang.String getSipApplicationSessionId()
          Returns the SIP application session ID associated with this EChartsMachineToJava instance.
protected  void init()
          This method is called immediately after EChartsMachineToJava instance is created and its private fields are initialized.
protected  void publish(java.lang.String sasid)
          This method is called immediately after the init() method is called.
protected  void putEvent(MachineMonitorEvent event)
          Put an event to the machine's monitor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EChartsMachineToJava

public EChartsMachineToJava()
Method Detail

getInstance

public static final <T> T getInstance(SipApplicationSession appSession)
                           throws java.lang.Exception
Gets existing interface instance, otherwise creates new interface instance for specified appSession. When creating, creates an instance of class whose name is defined by a 'sipToJavaClassName' <init-param> element in the <servlet> element of sip.xml. If no such property is defined then class name defaults to value of top-level machine name with suffix 'ToJavaImpl' e.g. if top-level machine class name is 'org.echarts.servlet.sip.features.monitorControl.MonitorControlMacine' and the 'sipToJavaClassName' <init-param> element is not defined in sip.xml then this method will create an instance of 'org.echarts.servlet.sip.features.monitorControl.MonitorControlMachineToJavaImpl' if this class exists; if it doesn't then creates a dynamic proxy class instance that implements the 'org.echarts.servlet.sip.features.monitorControl.MonitorControlMachineToJava' interface. The proxy class instance simply returns a null value for all method calls declaring a return value.

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

init

protected void init()
This method is called immediately after EChartsMachineToJava instance is created and its private fields are initialized. This provides the opportunity to override this method in order to initialize the instance in lieu of using a class constructor.


putEvent

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

Parameters:
event - the event to put to the monitor

publish

protected void publish(java.lang.String sasid)
This method is called immediately after the init() method is called. The default behavior is to do nothing. It is intended to be overridden in the subclass in order to publish this EChartsMachineToJava instance's sasid for later use by the machine's JavaToEChartsMachine instance (if one happens to be defined).


getSipApplicationSessionId

protected java.lang.String getSipApplicationSessionId()
Returns the SIP application session ID associated with this EChartsMachineToJava instance. This method can only be called after the instance is fully initialized. Therefore it is safe to call this method from the init() method but not from the class constructor.

Returns:
SIP application session id associated with this EChartsMachineToJava instance