Interesting RT.
Would it be possible to have a InvocationContextProvider
object:
public interface InvocationContextProvider {
public Context getContext ();
}
public interface InvocationContextAware {
public void setInvocationContextProvider (
InvocationContextProvider provider);
}
Now, the idea is that the object returned by the
InvocationContextProvider is dependent on the current service
method invocation. The proxy would, before invoking the target
method, set the InvocationContextProvider to return the
current InvocationContext (by storing it in a thread-local variable).
To be servlet-specific:
public interface RequestContextProvider {
public Request getRequest ();
public Session getSession ();
}
public interface RequestContextAware {
public void setRequestContextProvider (
RequestContextProvider provider);
}
So you get this:
1. Incoming call to component proxy.
2. Component proxy knows request & session, since container knows.
3. Component proxy knows the RequestContextProvider for component.
4. Proxy tells RequestContextProvider about current request and
session.
5. RequestContextProvider puts the request and session info into
a ThreadLocal variable.
6. Proxy invokes target method on component.
7. Component uses RequestContextProvider.getRequest() and .getSession()
to get at the request and session.
/LS
> From: Berin Loritsch [mailto:[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]