Results 1 to 6 of 6

Thread: How remote invocation works?

  1. #1

    Question How remote invocation works?

    Am using acegi's ContextPropagatingRemoteInvocationFactory to propagate context from client to server. Just out of curiosity I would like to know how this context is propagated? Basically the function of remote invocation factory is not clear to me. I have noticed that if my service extends the Remote interface, the custom invocation factory is not called and in my case context is not propagated from client to server.
    Thanks,
    Kapil

  2. #2
    Join Date
    Feb 2005
    Location
    Boston, MA
    Posts
    1,142

    Default

    What are you using to invoke the remote service? RmiProxyFactoryBean has a remoteInvocationFactory property which you set to an instance of ContextPropagatingRemoteInvocationFactory.
    Bill

  3. #3

    Default

    Yes, am using the remoteInvocationFactory property of RmiProxyFactoryBean and assigning it an instance of ContextPropagatingRemoteInvocation Factory.

    My question was how the context is propagated? Does it make two remote calls, first to set the context and then the original method call.
    My second query was if my service extends the Remote interface, then the context is not propagated infact the property remoteInvocationFactory has no effect, may be because there is a check in the RmiClientInterceptor class for the type of stub
    Code:
    if (stub instanceof RmiInvocationHandler) {
    			// RMI invoker
    	try {
    		return doInvoke(invocation, (RmiInvocationHandler) stub);
    	}...
            else {
               try {
    	      return RmiClientInterceptorUtils.doInvoke(invocation, stub);
             }
    }

  4. #4
    Join Date
    Aug 2006
    Posts
    382

    Default You may need to just download the source and read it yourself

    This is what I like about open source! You can just download the source code and read the guts of it yourself.

    I was very interested in subclassing SecurityContext so I could embed my own custom attributes and pass them through remote procedure calls to the server. I had to download their source code to understood how this mechanism works. Once I saw, I realized it isn't that complicated.

    P.S. No, it doesn't make two remote calls. That would be too expensive!

  5. #5

    Post

    Could you please elaborate a bit on how context is passed from one JVM to other?
    Thanks,
    Kapil

  6. #6
    Join Date
    Aug 2006
    Posts
    382

    Default Which part of "download the source code" do you not understand?

    1. Download the source
    Code:
    svn co https://svn.sourceforge.net/svnroot/acegisecurity/trunk/acegisecurity
    2. Find the class you are curious about
    Code:
    find . -name 'ContextPropagatingRemoteMethodInvocationFactory.java' -print
    3. Read it!

    4. And then find who else uses either the class or the interface, to see where this gets "plugged in". (Another hint, read the test cases to see how it is utilized).
    Code:
    find . -name '*.java' -exec grep ContextPropagatingRemoteMethodInvocationFactory {} \; -print
    find . -name '*.java' -exec grep RemoteInvocationFactory {} \; -print
    BTW: Shouldn't this really be on Acegi's forum (like the other time you brought up this issue?)
    BTW2: Have you searched this site using the keyword "ContextPropagatingRemoteMethodInvocationFacto ry"?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •