Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ecf-dev] RemoteService + Context

Hi Franky,

See my comments bellow.

Regards,
Radostin


On 29.10.2010 г. 15:37, Franky Bridelance wrote:
Hi Radostin, Scott,
 
The only problem I see with Radostin's approach is the binding to implementation specific code (RemoteCallImpl, RemoteServiceRegistrationImpl) which could be a maintainability issue if those implementation changes.
Absolutely, this is a problem. It would be great if this could be done into an abstract layer.
 
Scott, concerning following question:
>> Interesting.   I take it from your description that you are able to implement this by extending relevant classes and by overriding methods in RegistrySharedObject (in ECF 3.4)...is that correct?
I don't think Radostin's approach needs to extend any relevant class or override any method in RegistrySharedObject as he's using aspect weaving... although I'm not an AOP expert...
Yes, you are correct. We are weaving org.eclipse.ecf.provider.remoteservice bundle.
 
Maybe there's a need for an API to be able to add some extra data to a RemoteCall ?
I didn't have time to look at the latest 3.4 changes, I'll try to have a look this weekend.
 
Franky

2010/10/28 Scott Lewis <slewis@xxxxxxxxxxxxx>
Hi Radostin,

Thanks for the description of your work. 

A couple of comments below.


On 10/28/2010 1:50 AM, Radostin Surilov wrote:
Hi Scott,

Thank you for the comments.

I suppose this approach is quite specific to our use case. The actual aspect is:

import org.eclipse.ecf.provider.remoteservice.generic.RemoteCallImpl;
import org.eclipse.ecf.provider.remoteservice.generic.Request;
import org.eclipse.ecf.provider.remoteservice.generic.RemoteServiceRegistrationImpl;

public aspect ECFRequestExtAspect {
   
    private ISecurityToken RemoteCallImpl.mSecurityToken; //serializable parameter to pass (security token in this case)
   
    //advice executed after a new request object has been created
    after(Request request) returning : initialization(Request+.new(..)) && this(request) {
        //put the (local) security context in the RemoteCallImpl instance of the request
        request.getCall().mSecurityToken = SecurityContextHolder.getContext().getToken();
    }
   
    //advice executed before the remote service method invocation
    before(RemoteCallImpl remoteCall) : execution(* RemoteServiceRegistrationImpl.callService(RemoteCallImpl)) && args(remoteCall) {
        //get the security context from the RemoteCallImpl instance and put it in a thread local
        SecurityContextHolder.getContext().setToken(remoteCall.mSecurityToken);       
    }
}

Regards,
Radostin

Interesting.   I take it from your description that you are able to implement this by extending relevant classes and by overriding methods in RegistrySharedObject (in ECF 3.4)...is that correct?

Based upon this use case, do you have any desired API additions/changes...that might accomodate this use case and others more easily/gracefully (e.g. without having to extend classes).

Scott



_______________________________________________
ecf-dev mailing list
ecf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ecf-dev


_______________________________________________ ecf-dev mailing list ecf-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/ecf-dev


Back to the top