[SIPSERVLET_SPEC-38] Add the ability to create a contextual proxy which includes a specified SipApplicationSession in its context Created: 05/Feb/14 Updated: 26/Mar/14 Resolved: 26/Mar/14
|Remaining Estimate:||Not Specified|
|Time Spent:||Not Specified|
|Original Estimate:||Not Specified|
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.
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.
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.
|Comment by keith-lewis [ 05/Feb/14 ]|
One possible implementation of this feature would be to provide the following method on SipApplicationSession
The returned context service implements the interface defined in JSR236 which could then be used to create a contextual proxy e.g.
MyService proxy = contextService.createContextualProxy(svcObject, MyService.class);
In addition to setting up the appropriate thread context the proxy would apply the application's concurrency mode. If this is set to APPLICATIONSESSION then calls to any method on the proxy would block until no other thread is executing in the context of the specified SAS.
|Comment by binod [ 05/Feb/14 ]|
Section 188.8.131.52 (and the example 184.108.40.206) explains a way to create contextual proxies by specifying the application session ids
|Comment by keith-lewis [ 12/Feb/14 ]|
The proposed 2.0 spec does now have this facility so it would be possible to use that mechanism.
The spec currently only discusses the facility in the context of submitting asynchronous tasks.
It should discuss the concurrency control implications in the case where SAS level locking is used.
In addition the current mechanism uses the SAS-id which is only unique to a SAR/WAR.
Using a method on the SipApplicationSession object would seem a more direct way of providing the functionality.
If we want to avoid including any concurrency classes in the SIP API then we can provide the following method on SipApplicationSession as suggested previously.
<T> T createSipContextualProxy(T instance, Class<T> intf);
|Comment by binod [ 13/Feb/14 ]|
In the current mechanism that uses SAS-id or key, doesnt require the SipApplicationSession to be looked
Yes, I agree that we can add some text describing usage of contextual proxy directly from a thread. Eg: from a webservlet
|Comment by binod [ 26/Mar/14 ]|
Please refer to section 220.127.116.11 for a description about ContextService.