|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.platform.symphony.soam.ServiceContainer
public abstract class ServiceContainer
The application developer must extend this class to create their own service.
The developer must implement the desired methods to allow the middleware to
interact with the Service Instance:
onInvoke
(mandatory)onCreateService
(optional)onDestroyService
(optional)onSessionEnter
(optional)onSessionLeave
(optional)onServiceInterrupt
(optional)onSessionUpdate
(optional)
NOTE: If any of the methods of this class are called after the main(...) method exits,
the client or service process may behave in an undefined manner (for example,
hang or terminate abnormally).
Constructor Summary | |
---|---|
ServiceContainer()
Default Constructor |
Method Summary | |
---|---|
void |
onCreateService(ServiceContext serviceContext)
The middleware triggers the invocation of this handler just after a Service Instance is started. |
void |
onDestroyService()
The middleware triggers the invocation of this handler just before a Service Instance is destroyed. |
abstract void |
onInvoke(TaskContext taskContext)
The middleware triggers the invocation of this handler every time a task input is sent to the service to be processed. |
void |
onServiceInterrupt(ServiceContext serviceContext)
The middleware triggers the invocation of this handler every time an interrupt arrives. |
void |
onSessionEnter(SessionContext sessionContext)
The middleware triggers the invocation of this handler to bind the Service Instance to its owning Session when common data is provided by
the Client. |
void |
onSessionLeave()
The middleware triggers the invocation of this handler to unbind the Service Instance from its owning Session . |
void |
onSessionUpdate(SessionContext sessionContext)
Update this service instance with an update for the binding session. |
int |
run()
Runs the service. |
int |
run(java.lang.String[] args)
Deprecated. As of Symphony 3.0.1, replaced by run() |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ServiceContainer()
Method Detail |
---|
public abstract void onInvoke(TaskContext taskContext) throws SoamException
taskContext
- Context for the task passed from the client application
to the service.
SoamException
- The application developer can throw SoamException
(or subclassed exceptions: FailureException or FatalException) from this
method to indicate that an error occurred during task processing.TaskContext
public void onServiceInterrupt(ServiceContext serviceContext) throws SoamException
serviceContext
- [IN] - The context contains the information about the service
interrupt. This interrupt contains the interrupt type (InterruptTaskKilled or InterruptTaskSuspended)
and the task grace period.
Any
- exception thrown in this method would be ignored.
SoamException
ServiceContext
public void onCreateService(ServiceContext serviceContext) throws SoamException
serviceContext
- The context contains the information about the service
that is required to create a service instance, and all of the functionality that
a service will require throughout its lifetime.
SoamException
- The application developer can throw SoamException
(or subclassed exceptions: FailureException or FatalException) from this
method to indicate that an error occurred during the creation/initializion
of the service instance.ServiceContext
public void onDestroyService() throws SoamException
onCreateService()
method. Exceptions that are thrown in
onDestroyService are not returned to the client, they are logged in the SIM log file.
Default implementation does nothing.
SoamException
- The application developer can throw SoamException
(or subclassed exceptions: FailureException or FatalException) from this
method to indicate that an error occurred during the destruction/uninitializion
of the service instance.onCreateService(com.platform.symphony.soam.ServiceContext)
public void onSessionEnter(SessionContext sessionContext) throws SoamException
Session
when common data is provided by
the Client.
Session
, it
should be accessed in the developer's implementation of this method.
Default implementation of this handler does nothing.
sessionContext
- The context contains information about the binding Session
SoamException
- The application developer can throw SoamException
(or subclassed exceptions: FailureException or FatalException) from this
method to indicate that an error occurred during session-specific initialization
or during common data processing.SessionContext
,
onSessionLeave()
public void onSessionUpdate(SessionContext sessionContext) throws SoamException
sessionContext
- The context of the binding session
SoamException
SessionContext
public void onSessionLeave() throws SoamException
Session
.
onSessionEnter()
method. Exceptions that are thrown in
onSessionLeave are not returned to the client, they are logged in the SIM log file.
Default implementation does nothing.
SoamException
- The application developer can throw SoamException
(or subclassed exceptions: FailureException or FatalException) from this
method to indicate that an error occurred while executing the logic to
unbind the service instance from its binding session.onSessionEnter(com.platform.symphony.soam.SessionContext)
public final int run() throws SoamException
SoamException
public final int run(java.lang.String[] args) throws SoamException
run()
args
- The command line arguments passed to the service program
SoamException
|
Version 5.1 Date Modified: -DREL_DATE=Apr 28 2011 Platform Computing. Accelerating Intelligence(TM). Copyright (C) 2001-2009 Platform Computing Corporation. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |