Interface SessionOwnershipProvider
-
@Library(id=@ComponentId(name="SessionOwnership",vendor="OpenCloud",version="1.0")) @ResourceAdaptorType(id=@ComponentId(name="SessionOwnership",vendor="OpenCloud",version="1.0"),libraryRefs=@LibraryReference(library=@ComponentId(name="SessionOwnership",vendor="OpenCloud",version="1.0")),eventTypeRefs={@EventTypeReference(eventType=@ComponentId(name="com.opencloud.rhino.resources.sessionownership.SessionOwnershipReadResultEvent",vendor="OpenCloud",version="1.0")),@EventTypeReference(eventType=@ComponentId(name="com.opencloud.rhino.resources.sessionownership.SessionOwnershipWriteResultEvent",vendor="OpenCloud",version="1.0"))},raTypeClasses=@ResourceAdaptorTypeClasses(activityTypes=@ActivityType(activityTypeName="com.opencloud.rhino.resources.sessionownership.SessionOwnershipActivity"),acInterfaceFactoryInterface=@ActivityContextInterfaceFactoryInterface(aciFactoryInterfaceName="com.opencloud.rhino.resources.sessionownership.SessionOwnershipActivityContextInterfaceFactory"),resourceAdaptorInterface=@ResourceAdaptorInterface(resourceAdaptorInterfaceName="com.opencloud.rhino.resources.sessionownership.SessionOwnershipProvider"))) public interface SessionOwnershipProvider
Resource adaptor interface for the Session Ownership resource adaptor type.
This resource adaptor type provides an SBB interface to the
SessionOwnershipFacility
.- Since:
- Rhino 2.6.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SessionOwnershipActivity
createSessionOwnershipActivity()
Create a new session ownership activity.long
getDefaultTTL()
Get the default time-to-live for records stored in this session ownership resource adaptor.boolean
isAvailable()
Determine whether or not session ownership functionality is actually available in the namespace where the calling SBB or SBB part is deployed.SessionOwnershipRecord
peekRecord(String primaryKey)
Retrieve a locally cached copy of the session ownership record for the specified primary key.Set<SessionOwnershipRecord>
peekRecordsByAdditionalKey(String additionalKey)
Retrieve locally cached copies of session ownership records with the specified additional key.
-
-
-
Field Detail
-
JNDI_NAME
static final String JNDI_NAME
Constant declaring the JNDI name where a
SessionOwnershipProvider
object is bound into the JNDI environment of SBBs and SBB parts.The Session Ownership Resource Adaptor Type implementation is provided internally within Rhino, thus it cannot be referenced by SBBs and SBB parts using a normal resource adaptor entity link binding. Instead, an implementation of this interface is made available at this fixed JNDI location.
The value of this constant is "java:comp/env/rhino/sessionownership/provider".
- Since:
- Rhino 2.6.1
- See Also:
- Constant Field Values
-
-
Method Detail
-
isAvailable
boolean isAvailable()
Determine whether or not session ownership functionality is actually available in the namespace where the calling SBB or SBB part is deployed.
Other methods in this interface are only usable if this method returns
true
.- Returns:
true
if session ownership functionality is available to the caller,false
otherwise.- Since:
- Rhino 2.6.1
-
createSessionOwnershipActivity
SessionOwnershipActivity createSessionOwnershipActivity() throws IllegalStateException
Create a new session ownership activity. The activity will be started in the SLEE before this method returns so that an SBB may attach to it.
- Returns:
- the new session ownership activity object.
- Throws:
IllegalStateException
- if session ownership functionality isn’t available in the namespace the SBB is deployed in.- Since:
- Rhino 2.6.1
-
peekRecord
SessionOwnershipRecord peekRecord(String primaryKey) throws IllegalStateException
Retrieve a locally cached copy of the session ownership record for the specified primary key. A record will only be returned if it is present in the cache, ie. remote backend lookup are not performed.
- Parameters:
primaryKey
- the primary key of the record to retrieve.- Returns:
- the record with the given primary key if it is in the local cache, or null otherwise.
- Throws:
IllegalStateException
- if session ownership functionality isn’t available in the namespace the SBB is deployed in.- Since:
- Rhino 2.6.1
-
peekRecordsByAdditionalKey
Set<SessionOwnershipRecord> peekRecordsByAdditionalKey(String additionalKey) throws IllegalStateException
Retrieve locally cached copies of session ownership records with the specified additional key. Only records present in the cache will be included in the result, ie. remote backend lookups are not performed.
- Parameters:
additionalKey
- the additional key of the records to retrieve.- Returns:
- the set of all of the locally cached records with the specified additional key.
- Throws:
IllegalStateException
- if session ownership functionality isn’t available in the namespace the SBB is deployed in.- Since:
- Rhino 2.6.1
-
getDefaultTTL
long getDefaultTTL() throws IllegalStateException
Get the default time-to-live for records stored in this session ownership resource adaptor. Units are in milliseconds.
- Returns:
- the default time-to-live.
- Throws:
IllegalStateException
- if session ownership functionality isn’t available in the namespace the SBB is deployed in.- Since:
- Rhino 2.6.1
-
-