Type: New Feature
Affects Version/s: None
Fix Version/s: 2.0-pr
When a SIP container is included as part of a JEE 7 platform it should make available one or more implementations of the ContextService as described in "Concurrency Utilities for Java EE v1.0" (JSR236).
This service can be used to create a contextual proxy from a supplied Java object.
Any method called on the proxy executes in the thread context of the SIP thread that created the proxy.
In particular it will share the same the SipApplicationSession (SAS) context as the original thread.
This facility is very useful when registering callback objects with components that will execute the callback from a thread that is not a SIP container managed thread. The contextual proxy will set up the appropriate context for the method call.
In the case of a callback the context to use is taken from the original SIP thread so the caller does not specify the SAS to use.
It would also useful to be able to create a contextual proxy where the SAS is explicitly specified when the proxy is created.
This allows the SIP application to provide a service that can be called by non-SIP containers and unmanaged threads.
These service can make use of SIP container facilities that rely on the SAS context such as SipApplicationSession scoped CDI beans and SAS level concurrency guarantees.
The caller can choose to use a new SAS or an existing SAS looked up using a SAS-id that is known to the caller.
An example of its use would be an application which exposes a Web service that provides call origination and call control methods.