javax.slee.resource
Interface ResourceAdaptorContext


public interface ResourceAdaptorContext

The ResourceAdaptorContext interface provides a resource adaptor object with access to SLEE Facilities and other capabilities and objects implemented by the SLEE on behalf of a Resource Adaptor.

A ResourceAdaptorContext object is given to a resource adaptor object after it is created via the setResourceAdaptorContext method. The ResourceAdaptorContext object remains associated with the resource adaptor object for the lifetime of that resource adaptor object.

Since:
SLEE 1.1

Method Summary
 AlarmFacility getAlarmFacility()
          Get the alarm facility used to raise, update, and clear alarms in the SLEE.
 java.lang.Object getDefaultUsageParameterSet()
          Get the unnamed usage parameter set for the resource adaptor entity.
 java.lang.String getEntityName()
          Get the name of the resource adaptor entity the resource adaptor object was created for.
 EventLookupFacility getEventLookupFacility()
          Get the event lookup facility used to obtain the FireableEventType objects required for the resource adaptor to fire events to the SLEE.
 ServiceID getInvokingService()
          Get the service component identifier of the service currently being invoked by the SLEE in the current thread.
 ProfileTable getProfileTable(java.lang.String profileTableName)
          Get a ProfileTable object for a profile table.
 ResourceAdaptorID getResourceAdaptor()
          Get the component identifier for this resource adaptor.
 ResourceAdaptorTypeID[] getResourceAdaptorTypes()
          Get the component identifiers of the resource adaptor types implemented by this resource adaptor.
 ServiceLookupFacility getServiceLookupFacility()
          Get the service lookup facility used obtain information about the event types that may be received by SBBs in a service.
 SleeEndpoint getSleeEndpoint()
          Get the SLEE Endpoint object used to notify the SLEE about activities that are starting and ending, and to fire events on those activities to the SLEE.
 SleeTransactionManager getSleeTransactionManager()
          Get the SLEE transaction manager that allows a resource adaptor to demarcate transaction boundaries.
 java.util.Timer getTimer()
          Get the shared Java timer that can be used to schedule timer tasks.
 Tracer getTracer(java.lang.String tracerName)
          Get a tracer for the specified tracer name.
 java.lang.Object getUsageParameterSet(java.lang.String paramSetName)
          Get a named usage parameter set for the resource adaptor entity.
 

Method Detail

getResourceAdaptor

ResourceAdaptorID getResourceAdaptor()
Get the component identifier for this resource adaptor.

This method is a non-transactional method.

Returns:
the component identifier for the resource adaptor.

getResourceAdaptorTypes

ResourceAdaptorTypeID[] getResourceAdaptorTypes()
Get the component identifiers of the resource adaptor types implemented by this resource adaptor.

This method is a non-transactional method.

Returns:
the component identifiers of the resource adaptor types implemented by this resource adaptor. This will always be a non-null value.

getEntityName

java.lang.String getEntityName()
Get the name of the resource adaptor entity the resource adaptor object was created for.

This method is a non-transactional method.

Returns:
the name of the resource adaptor entity.

getSleeEndpoint

SleeEndpoint getSleeEndpoint()
Get the SLEE Endpoint object used to notify the SLEE about activities that are starting and ending, and to fire events on those activities to the SLEE.

This method is a non-transactional method.


getAlarmFacility

AlarmFacility getAlarmFacility()
Get the alarm facility used to raise, update, and clear alarms in the SLEE. The notification source used by this alarm facility is a ResourceAdaptorEntityNotification that contains the name of the resource adaptor entity as identified by getEntityName().

Alarm notifications generated by this alarm facility are of the type ResourceAdaptorEntityNotification.ALARM_NOTIFICATION_TYPE.

This method is a non-transactional method.

Returns:
the alarm facility.

getTracer

Tracer getTracer(java.lang.String tracerName)
                 throws java.lang.NullPointerException,
                        java.lang.IllegalArgumentException,
                        SLEEException
Get a tracer for the specified tracer name. The notification source used by the tracer is a ResourceAdaptorEntityNotification that contains the name of the resource adaptor entity as identified by getEntityName().

Refer Tracer for a complete discussion on tracers and tracer names.

Trace notifications generated by a tracer obtained using this method are of the type ResourceAdaptorEntityNotification.TRACE_NOTIFICATION_TYPE.

This method is a non-transactional method.

Parameters:
tracerName - the name of the tracer.
Returns:
a tracer for the specified tracer name. Trace messages generated by this tracer will contain a notification source that is a ResourceAdaptorEntityNotification object containing a resource adaptor entity name equal to that obtained from the getEntityName() method on this ResourceAdaptorContext.
Throws:
java.lang.NullPointerException - if tracerName is null.
java.lang.IllegalArgumentException - if tracerName is an invalid name. Name components within a tracer name must have at least one character. For example, "com.mycompany" is a valid tracer name, whereas "com..mycompany" is not.
SLEEException - if the tracer could not be obtained due to a system-level failure.

getEventLookupFacility

EventLookupFacility getEventLookupFacility()
Get the event lookup facility used to obtain the FireableEventType objects required for the resource adaptor to fire events to the SLEE.

This method is a non-transactional method.

Returns:
the event lookup facility.

getServiceLookupFacility

ServiceLookupFacility getServiceLookupFacility()
Get the service lookup facility used obtain information about the event types that may be received by SBBs in a service.

This method is a non-transactional method.

Returns:
the service lookup facility.

getSleeTransactionManager

SleeTransactionManager getSleeTransactionManager()
Get the SLEE transaction manager that allows a resource adaptor to demarcate transaction boundaries.

This method is a non-transactional method.

Returns:
the SLEE transaction manager.

getTimer

java.util.Timer getTimer()
Get the shared Java timer that can be used to schedule timer tasks.

A Resource Adaptor is not permitted to use the Timer.cancel() method on the Timer object returned from this method. Attempting to do so will cause a java.lang.UnsupportedOperationException to be thrown.

This method is a non-transactional method.

Returns:
the shared Java timer.

getProfileTable

ProfileTable getProfileTable(java.lang.String profileTableName)
                             throws java.lang.NullPointerException,
                                    UnrecognizedProfileTableNameException,
                                    SLEEException
Get a ProfileTable object for a profile table. The object returned by this method may be safely typecast to the Profile Table interface defined by the profile specification of the profile table if the resource adaptor has the appropriate classes in its classloader to do so, for example by declaring a profile-spec-ref in its deployment descriptor for the profile specification of the Profile Table.

This method is a non-transactional method.

Parameters:
profileTableName - the name of the profile table.
Returns:
a ProfileTable object for the profile table.
Throws:
java.lang.NullPointerException - if profileTableName is null.
UnrecognizedProfileTableNameException - if a profile table with the specified name does not exist.
SLEEException - if the ProfileTable object could not be obtained due to a system-level-failure.

getDefaultUsageParameterSet

java.lang.Object getDefaultUsageParameterSet()
                                             throws NoUsageParametersInterfaceDefinedException,
                                                    SLEEException
Get the unnamed usage parameter set for the resource adaptor entity. The object returned by this method may be safely typecast to the Usage Parameters Interface defined by the Resource Adaptor.

This method can only be invoked by resource adaptor entities of a Resource Adaptor that defines a Usage Parameters Interface. If a resource adaptor entity of a Resource Adaptor that doesn't define a Usage Parameters Interface attempts to invoke this method, a NoUsageParametersInterfaceDefinedException is thrown.

This method is a non-transactional method.

Returns:
an object that implements the Usage Parameters Interface of the Resource Adaptor that represents the unnamed usage parameter set for the resource adaptor entity.
Throws:
NoUsageParametersInterfaceDefinedException - if the Resource Adaptor did not define a Usage Parameters Interface.
SLEEException - if the usage parameter set could not be obtained due to a system-level failure.

getUsageParameterSet

java.lang.Object getUsageParameterSet(java.lang.String paramSetName)
                                      throws java.lang.NullPointerException,
                                             NoUsageParametersInterfaceDefinedException,
                                             UnrecognizedUsageParameterSetNameException,
                                             SLEEException
Get a named usage parameter set for the resource adaptor entity. The object returned by this method may be safely typecast to the Usage Parameters Interface defined by the Resource Adaptor.

This method can only be invoked by resource adaptor entities of a Resource Adaptor that defines a Usage Parameters Interface. If a resource adaptor entity of a Resource Adaptor that doesn't define a Usage Parameters Interface attempts to invoke this method, a NoUsageParametersInterfaceDefinedException is thrown.

This method is a non-transactional method.

Parameters:
paramSetName - the name of the usage parameter set to return.
Returns:
an object that implements the Usage Parameters Interface of the Resource Adaptor that represents the specified named usage parameter set for the resource adaptor entity.
Throws:
java.lang.NullPointerException - if paramSetName is null.
NoUsageParametersInterfaceDefinedException - if the Resource Adaptor did not define a Usage Parameters Interface.
UnrecognizedUsageParameterSetNameException - if the name does not identify a usage parameter set that has been created for the resource adaptor entity.
SLEEException - if the usage parameter set could not be obtained due to a system-level failure.

getInvokingService

ServiceID getInvokingService()
Get the service component identifier of the service currently being invoked by the SLEE in the current thread. The purpose of this method is to allow resource adaptors to determine which service an SBB belongs to when that SBB invokes a downcall on the resource adaptor, for example by invoking a method on the resource adaptor interface or on an activity object.

Returns:
the service component identifier of the service currently being invoked by the SLEE in the current thread, or null if there is no such service.


Copyright © 2008. All Rights Reserved.