|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objecthp.opencall.media.platform.Capability
hp.opencall.media.platform.ResourceCapability
hp.opencall.media.service.Session
hp.opencall.media.ccapi.CCSession
CCSession is the center class of the Call Control API.
Call Control service applications, also referred to as Oclets, are created by extending this class and providing implementation for its abstract methods.
CCSession models the abstraction of a session within the Media Platform and acts as the enclosing object for all the resources that are involved in the session. This means that, when the platform starts up an oclet, the oclet is instantiated in the context of a session.
The Platform starts up an oclet on the occurence of one of the following
events:
1. An incoming call addressed to this oclet is received by the platform
from the telephony network.
2. The service that corresponds to this oclet is configured and invoked
directly from the OCMP Management System.
The Platform starts up an oclet as follows:
1. It initializes a new session for the oclet.
2. It instantiates the oclet.
3. It invokes its newCCSession method.
The newCCSession method is thus the entry point for the oclet as it is the first oclet's method invoked by the platform. Several forms of newCCSession are provided, depending on how the oclet was initiated.
Incoming Calls
Incoming calls are dispatched by the platform to the applications (oclets)
depending on their called address. If the called address matches an address
which has been configured to map to the oclet in question, the platform
starts up the oclet, that is it initializes a new session with all the
resource objects (CallParty, TrunkLeg, etc..) associated to the call,
instantiates the oclet and invokes its newCCSession method.
In this case, newCCSession is invoked with the CallParty object associated
to the incoming call as a parameter.
Direct Invocation from the Management System
An oclet can be started directly from the OCMP management system. This means
that such an oclet is not associated to any incoming call.
In this case, the platform instanciates the oclet and invokes its
newCCSession method with no parameters.
Session Termination
A session is terminated by invoking the release() method. All the associated resources (such as CallParties) and all associated calls are then released.
Thread Management
The Platform schedules a thread, referred to as a User Thread, to invoke
the Call Control API callback methods. For example, newCCSession is invoked
on a User Thread.
In order to ensure appropriate synchronization in the platform, most of the
API methods, including CCSession methods and AsyncMediaGroup methods can
only be called from the User Thread that last called back to the user
code.
If it is required to implicitely or explicitely create new threads for the
application's own purposes, referred to as Application Threads,
care should be taken to not invoke those API methods from these threads.
This is particularly true when it is required to handle external events,
i.e. events that are not generated by the Platform, such as timers.
For example, if java timers (Timer class) are used, the actionPerformed
method of the timer listener object is called when the timer pops.
This method is called on the java event-dispatching thread, which is not a
platform's User Thread. Hence, the API methods cannot be called from this
thread.
In order to solve this problem a specific event handling mechanism is
provided, as follows:
- A listener object implementing the ExternalEventListener interface
has to be created.
- This listener object is registered in the oclet by a call to
addExternalEventListener.
- The event handler for external events should invoke notifyExternalEvent.
This method schedules a User Thread to invoke onExternalEvent in the listener
object previously created. The external event is passed in this call. Since
onExternalEvent is invoked on a User Thread, any API methods can be invoked
then., Deprecated
Another mechanism solves this problem. It enables create a proxy instance with users interfaces,
on which every methods can be called from external threads. This mechanism replaces
and enhances the external event mechanism., OCMP 2.2
| Field Summary | |
static hp.opencall.media.platform.AccessControlManager |
acm
FOR FUTURE USE. |
static int |
ACTIVE
The session is ACTIVE as long as it is not released, not revoked and at least one of its CallParties is not released. |
static int |
ASR_RECORDER_STREAM_MASK
|
static int |
IDLE
The session is IDLE until at least one of its CallParty gets connected. |
static int |
INCOMING_NETWORK_PROXY_STREAM_MASK
|
static int |
NO_STREAM_MASK
|
static int |
OUTGOING_NETWORK_PROXY_STREAM_MASK
|
static int |
RELEASED
A session goes to the RELEASED state if it is released by the Call Handler, or when it is revoked by the platform. |
static String[] |
stateString
Table indexed by state value to return state name |
static int |
TTS_PLAYER_STREAM_MASK
|
| Fields inherited from class hp.opencall.media.service.Session |
_defaultStreamsLogMask, myTerminal |
| Constructor Summary | |
CCSession()
|
|
| Method Summary | |
void |
activateTrace()
Activate traces for that CCSession |
void |
addExternalEventListener(ExternalEventListener listener)
Adds the specified listener to receive external events. |
CP |
addTrunkCParty(CallSpec aCallSpec)
Creates a new CallParty with a TrunkLeg. |
void |
bridge(CP aCP1)
Attaches a CallParty to a bridge. |
void |
bridge(CP aCP1,
BridgeDir bDir)
FOR FUTURE USE |
AsyncMediaGroup |
bridge(CP aCP,
BridgeDir bDir,
ConfigSpec aSpec,
MediaGroupDir mgDir)
|
AsyncMediaGroup |
bridge(CP aCP,
ConfigSpec aSpec)
Attaches a MediaGroup to the CallParty and bridges the CallParty. |
abstract void |
callPartyStateChange(CP aCP,
int aNewCPState)
Indicates a CallParty state change. |
static CCSession |
createNewServiceSession(String serviceName)
Creates an empty Service Session with no CallParty attached. |
static CCSession |
createNewServiceSession(String serviceName,
Object newCCSessionParam)
Creates an empty Service Session with no CallParty attached. |
void |
deactivateTrace()
Deactivate traces for that CCSession |
void |
destroyed()
Excecuted at session end This method may be overwrited by the user to get the session ends and to access to private user CCSession data but cannot be used to execute any ccapi session operation. |
void |
disconnect(CP aCP)
t Disconnects a CallParty that was either bridged or looped.It remains registered to conferences. |
static int |
getAndResetMaxLoopCPDuration()
|
CP[] |
getCallParties()
Gets a table of the CallParty objects available in this session. |
Object |
getProxy(Class aClass)
Creates a proxy instance on which users methods can be called from external threads. |
Object |
getProxy(Class[] aInterTab)
Creates a proxy instance on which users methods can be called from external threads. |
String |
getServiceName()
Get the Service Name. |
String |
getTraceIdentifier()
Get the prefix identifier used for tracing. |
void |
interrupt()
Wakes up the session. |
AsyncMediaGroup |
loopBridge()
Creates an AsyncMediaGroup and connects it to the softdspBridge. |
AsyncMediaGroup |
loopBridge(ConfigSpec aConfigSpec)
Creates an AsyncMediaGroup and connects it to the softdspBridge. |
AsyncMediaGroup |
loopCP(CP aCP,
ConfigSpec aSpec)
Causes a CallParty to loop its trunk leg to a media group leg. |
abstract void |
newCCSession()
Called by the platform at session/oclet startup. |
abstract void |
newCCSession(CP aCP)
Called by the platform at session/oclet startup on incoming call. |
void |
newCCSession(Object anObject)
Called by the platform at session/oclet creation with method createNewServiceSession(Name aNem, Object anObject) |
void |
notifyExternalEvent(EventObject event)
Notifies an external event to the session/oclet. |
ConferenceIF |
register(CP aCP,
ConferenceSpec acSpec)
Registers a CP to a conference Creates a default conferenceSession if none already exists with the same ConferenceSpec, registers a CallParty to this conference, creates a proxy on ConferenceSession with ConferenceIF interface and gives it back. |
ConferenceIF |
register(CP aCP,
ConferenceSpec acSpec,
Class aclass)
Registers a CP to a conference of type class Creates an extended conferenceSession if none already exists with the same ConferenceSpec, registers a CallParty to this conference, creates a proxy on ConferenceSession with ConferenceIF interface and gives it back. |
ConferenceIF |
register(CP aCP,
ConferenceSpec acSpec,
Class aclass,
ConferenceListener aconfListener)
Registers a CP to a conference of type Class and adds a ConferenceListener on this conference Creates a extended conferenceSession if none already exists with the same ConferenceSpec, registers a CallParty to this conference, adds a ConferenceListener on this conference and associates it to the CP, creates a proxy on ConferenceSession with ConferenceIF interface and gives it back. |
ConferenceIF |
register(CP aCP,
ConferenceSpec acSpec,
ConferenceListener aconfListener)
Registers a CP to a conference and adds a ConferenceListener on this conference Creates a default conferenceSession if none already exists with the same ConferenceSpec, registers a CallParty to this conference, adds a ConferenceListener on this conference and associates it to the CP, creates a proxy on ConferenceSession with ConferenceIF interface and gives it back. |
void |
release()
Terminates the session The session and all its associated resources, like CallParties, are released. |
void |
releaseCP(CP aCP)
Releases a CallParty. |
void |
removeExternalEventListener(ExternalEventListener listener)
Removes the specified listener so it no longer receives external events. |
static boolean |
serviceControlsBackwardAck()
Excecuted at service startup This method may be overwrited by the user to modify the way backward ack is controlled. |
abstract void |
sessionStateUpdate(int aNewState)
Indicates a Session state change. |
void |
setBridge(BridgeSpec aBridgeSpec)
Allocates a bridge to connect CallParty's together. |
void |
setStreamsLogMask(int mask)
Ask to the Media Group to log some I/O media streams in a file. |
void |
setTraceIdentifier(String id)
Add a developer specific prefix identifier in the session name used for tracing. |
void |
sleep()
Causes the session to sleep. |
void |
sleep(long milliseconds)
Causes the session to sleep for the specified number of ms. |
static void |
start()
Excecuted at service start This method may be overwrited by the user to execute service level operation at start of the service. |
static void |
stop()
Excecuted at service stop This method may be overwrited by the user to execute service level operation at stop of the service |
void |
unregister(CP aCP,
ConferenceIF aconfIF)
Unregisters a CP from a conference * Pre-conditions: 1. |
| Methods inherited from class hp.opencall.media.service.Session |
bindSessionToTerminal, checkObjectInterfaces, getName, getSessionAC, getTerminalAddress, printOut, sessionId, setDefaultStreamsLogMask, toString |
| Methods inherited from class hp.opencall.media.platform.ResourceCapability |
checkCapability, revoke |
| Methods inherited from class hp.opencall.media.platform.Capability |
addRevocationListener, removeRevocationListener |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final hp.opencall.media.platform.AccessControlManager acm
public static final int NO_STREAM_MASK
public static final int INCOMING_NETWORK_PROXY_STREAM_MASK
public static final int OUTGOING_NETWORK_PROXY_STREAM_MASK
public static final int ASR_RECORDER_STREAM_MASK
public static final int TTS_PLAYER_STREAM_MASK
public static final int IDLE
public static final int ACTIVE
public static final int RELEASED
public static final String[] stateString
| Constructor Detail |
public CCSession()
| Method Detail |
public void setTraceIdentifier(String id)
id - is the String that will prefixed the session name
public String getServiceName()
public void setStreamsLogMask(int mask)
Four media streams can be logged thanks to a combination of four masks : - INCOMING_NETWORK_PROXY_STREAM_MASK - OUTGOING_NETWORK_PROXY_STREAM_MASK - ASR_RECORDER_STREAM_MASK - TTS_PLAYER_STREAM_MASK
mask - is the int that combines different stream masks
NO_STREAM_MASK,
INCOMING_NETWORK_PROXY_STREAM_MASK,
OUTGOING_NETWORK_PROXY_STREAM_MASK,
ASR_RECORDER_STREAM_MASK,
public String getTraceIdentifier()
public void activateTrace()
public void deactivateTrace()
public CP addTrunkCParty(CallSpec aCallSpec)
throws AccessControlException
aCallSpec - specifies the call setup parameters that are
passed to the signalling system taking care of the call.
BadThreadException - if the method is not called on the proper User
Thread.
AccessControlException
public CP[] getCallParties()
throws AccessControlException
BadThreadException - if the method is not called on the proper User
Thread.
AccessControlException
public AsyncMediaGroup loopCP(CP aCP,
ConfigSpec aSpec)
throws AccessControlException,
BadConfigSpecException
This method creates a media group (AsyncMediaGroup) and an associated
media group leg which is looped to the Call Party's trunk leg.
The source side of the trunk leg is connected to the sink side of the
media group leg and conversely (duplex connection).
The media group can thus be used to play a message, record a message
or detect DTMF.
Other CallParties in the session are not involved, even if a bridge has been set.
Pre-conditions:
1. The CP must be in the state OPENED.
This means that if the CP has been previously bridged or looped, it
must have been disconnected by a call to disconnect().
Post-conditions:
1. The CP goes to the LOOPING state and then LOOPED. It may already be
in the LOOPED state when the call returns.
InvalidCPStateException - if the CallParty is not in the
proper state.
BadThreadException - if the method is not called on the proper User
Thread.
AccessControlException
BadConfigSpecException
public final AsyncMediaGroup loopBridge()
throws AccessControlException,
BadConfigSpecException,
ResourceNotAvailableException
Uses the ConfigSpec.bridgeGlobalConferenceConfig.
This media group can thus be used to play a message to both bridged CallParties,
and record the bridge in a file.
Pre-conditions:
1. softdspBridge has been specified for this session by calling setBridge(hp.opencall.media.ccapi.BridgeSpec)
with the parameter BridgeSpec.softdspBridgeSpec.
ResourceNotAvailableException - if no more MediaGroup resources
are available.
AccessControlException
BadConfigSpecException
public AsyncMediaGroup loopBridge(ConfigSpec aConfigSpec)
throws AccessControlException,
BadConfigSpecException,
ResourceNotAvailableException
The ConfigSpec iused must include ResourceSpec.basicConference.
This media group can thus be used perform global media action on both bridged CallParties.
Pre-conditions:
1. softdspBridge has been specified for this session by calling setBridge(hp.opencall.media.ccapi.BridgeSpec)
with the parameter BridgeSpec.softdspBridgeSpec.
ResourceNotAvailableException - if no more MediaGroup resources
are available.
AccessControlException
BadConfigSpecException
public void bridge(CP aCP1)
throws AccessControlException
Pre-conditions:
1. A bridge must have been setup (call to setBridge()).
2. There must remain space on the bridge to connect the CallParty.
3. The CallParty's streamFormat must be supported by the bridge.
4. The CallParty must be in the OPENED state.
Post-conditions:
1. For tdmBridgeSpec : The CallParty goes to the BRIDGING state and eventually BRIDGED. It
is possible it is already in the BRIDGED state when the call returns.
For softdspBridgeSpec : The CallParty goes to the LOOPING state and eventually LOOPED. It
is possible it is already in the LOOPED state when the call returns.
InvalidCPStateException - if the CallParty is not in the
proper state.
BadThreadException - if the method is not called on the proper User
Thread.
AccessControlException
public void bridge(CP aCP1,
BridgeDir bDir)
throws AccessControlException
AccessControlException
public AsyncMediaGroup bridge(CP aCP,
ConfigSpec aSpec)
throws AccessControlException,
BadConfigSpecException
This creates a MediaGroup and an associated media group leg. The source side of the CallParty's trunk leg is branched to the sink side of the media group leg. The so arranged CallParty is attached to a bridge.
Note that for BridgeSpec.tdmBridgeSpec :
only the sink side of the media group leg is attached to the
CallParty. This means the so created MediaGroup can only be used to
record messages or detect DTMF's received from the CallParty.
This cannot be used to play messages or generate signals.
Note that for BridgeSpec.softdspBridgeSpec:
Only the MediaGroup defined by ConfigSpec.bridgeCPConfigSpec can be
used for the ConfigSpec parameter .
Pre-conditions:
1. A bridge must have been setup (call to setBridge()).
2. There must remain space on the bridge to connect the CallParty.
3. The CallParty's streamFormat must be supported by the bridge.
4. The CallParty must be in the OPENED state.
5. Enough MediaProcessing resources must be available so that a
MediaGroup can be allocated.
Post-conditions:
1. For tdmBridgeSpec : The CallParty goes to the BRIDGING state and eventually BRIDGED. It
is possible it is already in the BRIDGED state when the call returns.
For softdspBridgeSpec : The CallParty goes to the LOOPING state and eventually LOOPED. It
is possible it is already in the LOOPED state when the call returns.
ResourceNotAvailableException - if no more MediaGroup resources
are available.
InvalidCPStateException - if the CallParty is not in the
proper state.
BadThreadException - if the method is not called on the proper User
Thread.
AccessControlException
BadConfigSpecException
public AsyncMediaGroup bridge(CP aCP,
BridgeDir bDir,
ConfigSpec aSpec,
MediaGroupDir mgDir)
throws AccessControlException,
BadConfigSpecException
AccessControlException
BadConfigSpecException
public ConferenceIF register(CP aCP,
ConferenceSpec acSpec)
throws AccessControlException
Creates a default conferenceSession if none already exists with the same ConferenceSpec, registers a CallParty to this conference, creates a proxy on ConferenceSession with ConferenceIF interface and gives it back. This proxy acts as a handler on the conference as it allows to calls ConferenceIF methods from a any thread (in addition to Conference User Thread)
ResourceNotAvailableException - if CP cannot be registered to conference.
AccessControlException - if conference cannot be created
BadThreadException - if the method is not called on the proper User
Thread.
public ConferenceIF register(CP aCP,
ConferenceSpec acSpec,
ConferenceListener aconfListener)
throws AccessControlException
Creates a default conferenceSession if none already exists with the same ConferenceSpec, registers a CallParty to this conference, adds a ConferenceListener on this conference and associates it to the CP, creates a proxy on ConferenceSession with ConferenceIF interface and gives it back. This proxy acts as a handler on the conference as it allows to calls ConferenceIF methods from a any thread (in addition to Conference User Thread)
ResourceNotAvailableException - if CP cannot be registered to it.
AccessControlException - if conference cannot be created
BadThreadException - if the method is not called on the proper User
Thread.
public ConferenceIF register(CP aCP,
ConferenceSpec acSpec,
Class aclass)
throws AccessControlException
Creates an extended conferenceSession if none already exists with the same ConferenceSpec,
registers a CallParty to this conference,
creates a proxy on ConferenceSession with ConferenceIF interface and gives it back.
This proxy acts as a handler on the conference as it allows to calls ConferenceIF methods from a
any thread (in addition to Conference User Thread)
Pre-conditions:
1. The ConferenceSession class must have been loaded with the service
Post-conditions:
1. A Class instance is created and method newConferenceSession() is called by the framework on a
conference User Thread
2. A proxy is created on ConferenceSession with ConferenceIF interface. It allows to call ConferenceIF methods (which usually
must be called from a Conference User Thread) from any thread.
3. This proxy is given back through ConferenceIF. It acts as the handler on the conference.
ResourceNotAvailableException - if CP cannot be registered to it.
BadThreadException - if the method is not called on the proper User
Thread.
CCBadParamsException - if the given Class is not a class or an extended class of ConferenceSession.
AccessControlException - if conference cannot be created or if a conference with the same conferenceSpec
already exists but is not an instance of Class.
public ConferenceIF register(CP aCP,
ConferenceSpec acSpec,
Class aclass,
ConferenceListener aconfListener)
throws AccessControlException
Creates a extended conferenceSession if none already exists with the same ConferenceSpec,
registers a CallParty to this conference, adds a ConferenceListener on this conference and associates it to the CP,
creates a proxy on ConferenceSession with ConferenceIF interface and gives it back.
This proxy acts as a handler on the conference as it allows to calls ConferenceIF methods from a
any thread (in addition to Conference User Thread)
Pre-conditions:
1. The ConferenceSession class must have been loaded with the service
Post-conditions:
1. A Class instance is created and method newConferenceSession() is called by the framework on a
conference User Thread
2. A proxy is created on ConferenceSession with ConferenceIF interface. It allows to call ConferenceIF methods (which usually
must be called from a Conference User Thread) from any thread.
3. This proxy is given back through ConferenceIF. It acts as the handler on the conference.
ResourceNotAvailableException - if CP cannot be registered to it.
BadThreadException - if the method is not called on the proper User
Thread.
CCBadParamsException - if the given Class is not a class or an extended class of ConferenceSession
AccessControlException - if conference cannot be created or if a conference with the same conferenceSpec
already exists but is not an instance of Class.
public void unregister(CP aCP,
ConferenceIF aconfIF)
throws AccessControlException
* Pre-conditions:
1. The CP must have been registered to this conference
Post-conditions:
CCBadParamsException - if the CP has never been registered to this conference
BadThreadException - if the method is not called on the proper User
Thread.
AccessControlException
public Object getProxy(Class aClass)
throws CCBadParamsException
The proxy must be created with one interface implemented by the oclet. It gives back a Object. A cast in the interface class is needed to call one of the interface method.
Pre-conditions:
1. The oclet must implement the interface given in parameter
Post-conditions:
CCBadParamsException - if the interface is not implemented by the oclet
public Object getProxy(Class[] aInterTab)
throws CCBadParamsException
The proxy must be created with a list of user interfaces implemented by the oclet. It gives back a Object. A cast in the interface class is needed to call an interface method.
Pre-conditions:
1. The oclet must implement the interfaces given in parameter
Post-conditions:
CCBadParamsException - if one of the given interfaces is not implemented by the oclet
public void disconnect(CP aCP)
throws AccessControlException
All but the CallParty's trunk leg are released. This means that if
the CallParty was bridged, with or without a media group, it is detached
from the bridge. If the CallParty was bridged with a media group, or
looped with a media group, the media group object with its media group
leg is discarded.The CallParty remains registered to conferences.
The CallParty object goes back to the OPENED state.
BadThreadException - if the method is not called on the proper User
Thread.
AccessControlException
public void releaseCP(CP aCP)
throws AccessControlException
The call associated with the CallParty is released. The CallParty cannot be used anymore, any method call referencing this CallParty will throw a ResourceReleasedException.
aCP - is one of the active CallParties of the CCSession.
BadThreadException - if the method is not called on the proper User
Thread.
AccessControlExceptionpublic void release()
The session and all its associated resources, like CallParties, are
released. The Calls associated with the CallParties are released.
Any further reference to this session object will throw
ResourceReleasedException.
public void sleep()
throws AccessControlException,
InterruptedException
This causes the session to sleep until it is woken up by a call to interrupt() or until the session is terminated by a call to release().
NOTE: Use this method instead of Thread.sleep(). This is because a
session runs in platform User Threads. When this method is invoked,
the session sleeps, but the User Thread the session was running in is
re-used by the platform for other applications.
If Thread.sleep was used, it would cause the session AND its User Thread
to sleep and this thread could not be re-used by the platform.
InterruptedException - when the CCSession's interrupt method
is invoked.
CCAccessException - when CCSession is released.
BadThreadException - if the method is not called on the proper User
Thread.
AccessControlException
public void sleep(long milliseconds)
throws AccessControlException,
InterruptedException
This causes the session to sleep for the specified number of milliseconds or until the session is terminated by a call to release().
NOTE: Use this method instead of Thread.sleep(). This is because a
session runs in platform User Threads. When this method is invoked,
the session sleeps, but the User Thread the session was running in is
re-used by the platform for other applications.
If Thread.sleep was used, it would cause the session AND its User Thread
to sleep and this thread could not be re-used by the platform.
milliseconds - The time to sleep.
InterruptedException - when the CCSession's interrupt method
is invoked.
CCAccessException - when CCSession is released.
BadThreadException - if the method is not called on the proper User
Thread.
CCBadParamsException - if milliseconds is < 0.
AccessControlExceptionpublic void interrupt()
public void setBridge(BridgeSpec aBridgeSpec)
throws AccessControlException
The Bridge can be a TDM bridge or a SoftDSP bridge, as specified by
BridgeSpec.
AccessControlException - if it cannot satisfy the BridgeSpec
timeslots.public abstract void newCCSession()
This form of the method is used when an oclet is started by direct invocation from the management system or when the oclet is instanciated by createNewService() method
public void newCCSession(Object anObject)
public abstract void newCCSession(CP aCP)
This form of the method is used when an incoming call whose called
address matches one of the addresses which have been configured for this
oclet.
When the platform initializes the session for this oclet, it creates
a CallParty object with a trunk leg which corresponds to the incoming
call.
This CallParty object is passed as a parameter.
aCP - The CallParty that has been created in the session for the
incoming call.public abstract void sessionStateUpdate(int aNewState)
Called by the framework to inform of a CCSession state change.
aNewState - The new session state. It can be Active, Idle or
Released.
public abstract void callPartyStateChange(CP aCP,
int aNewCPState)
Called by the framework to inform of a callParty state change.
aCP - The Call Party subject to the change.aNewCPState - The new Call Party state. It can be Bridged, Bridging,
Idle, Looped, Looping, Opened or Released.
public void addExternalEventListener(ExternalEventListener listener)
throws TooManyListenersException
ExternalEventSchedulerExternal events are generic events of type EventObject. They can be generated from Application Threads, that is any thread which is not a platform User Thread. For example a timer handler.
A listener object implementing the
NOTE: Only one listener is currently allowed.
ExternalEventListener
interface must be created in the application to receive external events
through onExternalEvent.CCSession for more details.
addExternalEventListener in interface ExternalEventScheduler
listener - The listener object.
TooManyListenersException
public void removeExternalEventListener(ExternalEventListener listener)
ExternalEventScheduler
removeExternalEventListener in interface ExternalEventSchedulerlistener - The listener object.public final void notifyExternalEvent(EventObject event)
ExternalEventSchedulerThis method must be used whenever an external event, such as a timer, has to be processed by the application. An external event is a generic event generated from any thread, i.e. a thread that has been explicetely or implicitely created by the application and which is not a platform User Thread.
The main purpose of this method is to ensure appropriate platform
synchronization for processing external events.
It will cause a previously registered listener (registered by
addExternalEventListener) to receive the event through invocation of
onExternalEvent (see ExternalEventListener) in a platform User
Thread. Since onExternalEvent is invoked in a User Thread, any
Call-control API method can be called then.
notifyExternalEvent in interface ExternalEventSchedulerevent - The external event that must be passed in the call to
onExternalEvent.
public static final CCSession createNewServiceSession(String serviceName,
Object newCCSessionParam)
This method can be called from any Application Thread to trigger the creation of a new CCSession.
Once the session has been created and initialized by the platform
newCCSessionParam - a service specific parameter to pass to
the new session when newCCSession(Object) is called
public static final CCSession createNewServiceSession(String serviceName)
This method can be called by any thread to trigger the creation of a CCSession for a given service.
This allows creation of service instances doing only outgoing calls
serviceName - a service specific parameter to pass to
the new session when newCCSession(Object) is called
public static void start()
This method may be overwrited by the user to execute service level operation at start of the service.
public static void stop()
This method may be overwrited by the user to execute service level operation at stop of the service
public void destroyed()
This method may be overwrited by the user to get the session ends and to access to private user CCSession data but cannot be used to execute any ccapi session operation.
As this method execution uses a single resource shared with CCSession creation mechanism, its body should stay light and restore the resource quickly.
public static boolean serviceControlsBackwardAck()
This method may be overwrited by the user to modify the way backward ack is controlled. This method is called only one time at service startup.
public static int getAndResetMaxLoopCPDuration()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||