org.mobicents.slee.resource.lab.ra
Class MessageResourceAdaptor
java.lang.Object
org.mobicents.slee.resource.lab.ra.MessageResourceAdaptor
- All Implemented Interfaces:
- java.io.Serializable, javax.slee.resource.ResourceAdaptor, RAFStackListener
public class MessageResourceAdaptor
- extends java.lang.Object
- implements RAFStackListener, javax.slee.resource.ResourceAdaptor, java.io.Serializable
RAFrameResourceAdaptor wraps the RAFrameStack and controls its lifecycle
according to the lifecycle of a resource adaptor. For more information on the
lifecycle of a resource adaptor, please refer to JSLEE v1.1 Specification
Early Draft Review Page 297.
The resource adaptor class is referenced in the deployment descriptor file
"resource-adaptor-jar.xml" in the tag , sub-tag
, sub-tag :
com.maretzke.raframe.ra.RAFrameResourceAdaptor For further Information please
refer to JAIN SLEE 1.0 Specification, Final Release Page 243 and JSLEE v1.1
Specification, Early Draft Review Page 292
- Author:
- Michael Maretzke, amit bhayani
- See Also:
- Serialized Form
| Fields inherited from interface javax.slee.resource.ResourceAdaptor |
SBB_PROCESSED_EVENT |
|
Constructor Summary |
MessageResourceAdaptor()
Creates a new instance of RAFrameResourceAdaptor and leaves the default
values for the resource adaptor configuration untouched. |
MessageResourceAdaptor(java.util.Properties properties)
Constructor which accepts a Property object for further configuration of
the resource adaptor. |
MessageResourceAdaptor(java.lang.String stackName,
int port,
java.lang.String remotehost,
int remoteport)
Constructor with the following parameters: |
|
Method Summary |
void |
activityEnded(javax.slee.resource.ActivityHandle activityHandle)
implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1
Specification, Early Draft Review Page 301 for further information. |
void |
activityUnreferenced(javax.slee.resource.ActivityHandle activityHandle)
implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1
Specification, Early Draft Review Page 301 for further information. |
void |
entityActivated()
implements javax.slee.resource.ResourceAdaptor The JSLEE v1.1
Specification does not include entityActivated(). |
void |
entityCreated(javax.slee.resource.BootstrapContext bootstrapContext)
implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1
Specification, Early Draft Review Page 298 for further information. |
void |
entityDeactivated()
implements javax.slee.resource.ResourceAdaptor The JSLEE v1.1
Specification does not include entityDeactivated(). |
void |
entityDeactivating()
implements javax.slee.resource.ResourceAdaptor The JSLEE v1.1
Specification does not include entityDeactivating(). |
void |
entityRemoved()
implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1
Specification, Early Draft Review Page 299 for further information. |
void |
eventProcessingFailed(javax.slee.resource.ActivityHandle activityHandle,
java.lang.Object obj,
int param,
javax.slee.Address address,
int flags,
javax.slee.resource.FailureReason failureReason)
implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1
Specification, Early Draft Review Page 300 for further information. |
void |
eventProcessingSuccessful(javax.slee.resource.ActivityHandle activityHandle,
java.lang.Object obj,
int param,
javax.slee.Address address,
int flags)
implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1
Specification, Early Draft Review Page 300 for further information. |
java.lang.Object |
getActivity(javax.slee.resource.ActivityHandle activityHandle)
implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1
Specification, Early Draft Review Page 301 for further information. |
javax.slee.resource.ActivityHandle |
getActivityHandle(java.lang.Object obj)
implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1
Specification, Early Draft Review Page 301 for further information. |
javax.slee.resource.Marshaler |
getMarshaler()
implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1
Specification, Early Draft Review Page 302 for further information. |
java.lang.Object |
getSBBResourceAdaptorInterface(java.lang.String str)
implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1
Specification, Early Draft Review Page 302 for further information. |
void |
onEvent(java.lang.String incomingData)
implements com.maretzke.raframe.stack.RAFStackListener This method is
invoked by the underlying RAFStack whenever incoming data is received. |
void |
queryLiveness(javax.slee.resource.ActivityHandle activityHandle)
implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1
Specification, Early Draft Review Page 301 for further information. |
void |
send(java.lang.String message)
|
void |
serviceActivated(java.lang.String str)
implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1
Specification, Early Draft Review Page 303 for further information. |
void |
serviceDeactivated(java.lang.String str)
implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1
Specification, Early Draft Review Page 304 for further information. |
void |
serviceInstalled(java.lang.String str,
int[] values,
java.lang.String[] str2)
implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1
Specification, Early Draft Review Page 302 for further information. |
void |
serviceUninstalled(java.lang.String str)
implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1
Specification, Early Draft Review Page 303 for further information. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MessageResourceAdaptor
public MessageResourceAdaptor(java.util.Properties properties)
- Constructor which accepts a Property object for further configuration of
the resource adaptor. The following properties have a meaning:
com.maretzke.raframe.stack.PORT sets the local port to listen on
(serverport) (int) com.maretzke.raframe.stack.REMOTEPORT sets the remote
port to which information is send to (int)
com.maretzke.raframe.stack.REMOTEHOST is the remote computers' name to
send information to (String) com.maretzke.raframe.stack.STACK_NAME is the
stack's name (String)
- Parameters:
properties - a Property object containing further information to configure
the resource adaptor
MessageResourceAdaptor
public MessageResourceAdaptor(java.lang.String stackName,
int port,
java.lang.String remotehost,
int remoteport)
- Constructor with the following parameters:
- Parameters:
stackName - sets the name of the stackport - sets the local port to listen on (serversocket)remotehost - sets the remote computers' name to which information should be
sendremoteport - sets the remote computers' port to which information should be
send
MessageResourceAdaptor
public MessageResourceAdaptor()
- Creates a new instance of RAFrameResourceAdaptor and leaves the default
values for the resource adaptor configuration untouched. The default
configuration looks like: the local port to listen on - initial default
value: 40000 the remote port to send information to - initial default
value: 40001 the remote host to send information to - initial default
value: localhost the name of the resource adaptor entity - initial
default value: RAFrameResourceAdaptor
onEvent
public void onEvent(java.lang.String incomingData)
- implements com.maretzke.raframe.stack.RAFStackListener This method is
invoked by the underlying RAFStack whenever incoming data is received.
- Specified by:
onEvent in interface RAFStackListener
entityCreated
public void entityCreated(javax.slee.resource.BootstrapContext bootstrapContext)
throws javax.slee.resource.ResourceException
- implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1
Specification, Early Draft Review Page 298 for further information.
This method is called by the SLEE when a resource adaptor object instance
is bootstrapped, either when a resource adaptor entity is created or
during SLEE startup. The SLEE implementation will construct the resource
adaptor object and then invoke the entityCreated method before any other
operations can be invoked on the resource adaptor object.
- Specified by:
entityCreated in interface javax.slee.resource.ResourceAdaptor
- Throws:
javax.slee.resource.ResourceException
entityRemoved
public void entityRemoved()
- implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1
Specification, Early Draft Review Page 299 for further information.
This method is called by the SLEE when a resource adaptor object instance
is being removed, either when a resource adaptor entity is deleted or
during SLEE shutdown. When receiving this invocation the resource adaptor
object is expected to close any system resources it has allocated.
- Specified by:
entityRemoved in interface javax.slee.resource.ResourceAdaptor
eventProcessingSuccessful
public void eventProcessingSuccessful(javax.slee.resource.ActivityHandle activityHandle,
java.lang.Object obj,
int param,
javax.slee.Address address,
int flags)
- implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1
Specification, Early Draft Review Page 300 for further information.
The SLEE calls this method to inform the resource adaptor object that the
specified event was processed successfully by the SLEE. An event is
considered to be processed successfully if the SLEE has attempted to
deliver the event to all interested SBBs.
- Specified by:
eventProcessingSuccessful in interface javax.slee.resource.ResourceAdaptor
eventProcessingFailed
public void eventProcessingFailed(javax.slee.resource.ActivityHandle activityHandle,
java.lang.Object obj,
int param,
javax.slee.Address address,
int flags,
javax.slee.resource.FailureReason failureReason)
- implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1
Specification, Early Draft Review Page 300 for further information.
The SLEE calls this method to inform the resource adaptor object that the
specified event was processed unsuccessfully by the SLEE. Event
processing can fail if, for example, the SLEE doesn�t have enough
resource to process the event, a SLEE node fails during event processing
or a system level failure prevents the SLEE from committing transactions.
- Specified by:
eventProcessingFailed in interface javax.slee.resource.ResourceAdaptor
activityEnded
public void activityEnded(javax.slee.resource.ActivityHandle activityHandle)
- implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1
Specification, Early Draft Review Page 301 for further information.
The SLEE calls this method to inform the resource adaptor that the SLEE
has completed activity end processing for the activity represented by the
activity handle. The resource adaptor should release any resource related
to this activity as the SLEE will not ask for it again.
- Specified by:
activityEnded in interface javax.slee.resource.ResourceAdaptor
activityUnreferenced
public void activityUnreferenced(javax.slee.resource.ActivityHandle activityHandle)
- implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1
Specification, Early Draft Review Page 301 for further information.
The SLEE calls this method to inform the resource adaptor that the
activity�s Activity Context object is no longer attached to any SBB
entities and is no longer referenced by any SLEE Facilities. This enables
the resource adaptor to implicitly end the Activity object.
- Specified by:
activityUnreferenced in interface javax.slee.resource.ResourceAdaptor
queryLiveness
public void queryLiveness(javax.slee.resource.ActivityHandle activityHandle)
- implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1
Specification, Early Draft Review Page 301 for further information.
The SLEE calls this method to query if a specific activity belonging to
this resource adaptor object is alive.
- Specified by:
queryLiveness in interface javax.slee.resource.ResourceAdaptor
getActivity
public java.lang.Object getActivity(javax.slee.resource.ActivityHandle activityHandle)
- implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1
Specification, Early Draft Review Page 301 for further information.
The SLEE calls this method to get access to the underlying activity for
an activity handle. The resource adaptor is expected to pass back a
non-null object.
- Specified by:
getActivity in interface javax.slee.resource.ResourceAdaptor
getActivityHandle
public javax.slee.resource.ActivityHandle getActivityHandle(java.lang.Object obj)
- implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1
Specification, Early Draft Review Page 301 for further information.
The SLEE calls this method to get an activity handle for an activity
created by the underlying resource. This method is invoked by the SLEE
when it needs to construct an activity context for an activity via an
activity context interface factory method invoked by an SBB.
- Specified by:
getActivityHandle in interface javax.slee.resource.ResourceAdaptor
getSBBResourceAdaptorInterface
public java.lang.Object getSBBResourceAdaptorInterface(java.lang.String str)
- implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1
Specification, Early Draft Review Page 302 for further information.
The SLEE calls this method to get access to the underlying resource
adaptor interface that enables the SBB to invoke the resource adaptor, to
send messages for example.
- Specified by:
getSBBResourceAdaptorInterface in interface javax.slee.resource.ResourceAdaptor
getMarshaler
public javax.slee.resource.Marshaler getMarshaler()
- implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1
Specification, Early Draft Review Page 302 for further information.
The SLEE calls this method to get reference to the Marshaler object. The
resource adaptor implements the Marshaler interface. The Marshaler is
used by the SLEE to convert between object and distributable forms of
events and event handles.
- Specified by:
getMarshaler in interface javax.slee.resource.ResourceAdaptor
serviceInstalled
public void serviceInstalled(java.lang.String str,
int[] values,
java.lang.String[] str2)
- implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1
Specification, Early Draft Review Page 302 for further information.
The SLEE calls this method to signify to the resource adaptor that a
service has been installed and is interested in a specific set of events.
The SLEE passes an event filter which identifies a set of event types
that services in the SLEE are interested in. The SLEE calls this method
once a service is installed.
- Specified by:
serviceInstalled in interface javax.slee.resource.ResourceAdaptor
serviceUninstalled
public void serviceUninstalled(java.lang.String str)
- implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1
Specification, Early Draft Review Page 303 for further information.
The SLEE calls this method to signify that a service has been
un-installed in the SLEE. The event types associated to the service key
are no longer of interest to a particular application.
- Specified by:
serviceUninstalled in interface javax.slee.resource.ResourceAdaptor
serviceActivated
public void serviceActivated(java.lang.String str)
- implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1
Specification, Early Draft Review Page 303 for further information.
The SLEE calls this method to inform the resource adaptor that a service
has been activated and is interested in the event types associated to the
service key. The service must be installed with the resource adaptor via
the serviceInstalled method before it can be activated.
- Specified by:
serviceActivated in interface javax.slee.resource.ResourceAdaptor
serviceDeactivated
public void serviceDeactivated(java.lang.String str)
- implements javax.slee.resource.ResourceAdaptor Please refer to JSLEE v1.1
Specification, Early Draft Review Page 304 for further information.
The SLEE calls this method to inform the SLEE that a service has been
deactivated and is no longer interested in the event types associated to
the service key.
- Specified by:
serviceDeactivated in interface javax.slee.resource.ResourceAdaptor
entityActivated
public void entityActivated()
throws javax.slee.resource.ResourceException
- implements javax.slee.resource.ResourceAdaptor The JSLEE v1.1
Specification does not include entityActivated(). However, the API
description of JSLEE v1.1 does include this method already. So, the
documentation follows the code.
This method is called in context of project Mobicents in context of
resource adaptor activation. More precisely,
org.mobicents.slee.resource.ResourceAdaptorEntity.activate() calls this
method entityActivated(). This method signals the resource adaptor the
transition from state "INACTIVE" to state "ACTIVE".
- Specified by:
entityActivated in interface javax.slee.resource.ResourceAdaptor
- Throws:
javax.slee.resource.ResourceException
entityDeactivated
public void entityDeactivated()
- implements javax.slee.resource.ResourceAdaptor The JSLEE v1.1
Specification does not include entityDeactivated(). However, the API
description of JSLEE v1.1 does include this method already. So, the
documentation follows the code.
This method is called in context of project Mobicents in context of
resource adaptor deactivation. More precisely,
org.mobicents.slee.resource.ResourceAdaptorEntity.deactivate() calls this
method entityDeactivated(). The method call is done AFTER the call to
entityDeactivating(). This method signals the resource adaptor the
transition from state "STOPPING" to state "INACTIVE".
- Specified by:
entityDeactivated in interface javax.slee.resource.ResourceAdaptor
entityDeactivating
public void entityDeactivating()
- implements javax.slee.resource.ResourceAdaptor The JSLEE v1.1
Specification does not include entityDeactivating(). However, the API
description of JSLEE v1.1 does include this method already. So, the
documentation follows the code.
This method is called in context of project Mobicents in context of
resource adaptor deactivation. More precisely,
org.mobicents.slee.resource.ResourceAdaptorEntity.deactivate() calls this
method entityDeactivating() PRIOR to invoking entityDeactivated(). This
method signals the resource adaptor the transition from state "ACTIVE" to
state "STOPPING".
- Specified by:
entityDeactivating in interface javax.slee.resource.ResourceAdaptor
send
public void send(java.lang.String message)
Copyright © 2008. All Rights Reserved.