Dynamic Proxies over RMI

We've written an application which provides remote EJB clients a factory class. The
factory class builds dynamic proxy [java.lang.reflect.Proxy] instances which implement
a series of appliaction specific interfaces. When the proxy arrives at the server
(WLS 6.1) the server tries to re-build the instance, but is unable to locate the
application interfaces. We're pretty sure this is due to the default ObjectInputStream.resolveProxyClass()
implementation using the wrong classloader (the application interfaces are in the
EAR file of the app). This can be fixed by putting the interfaces on the system classpath.
Is there anyway to get the server to pick up the interfaces from the EAR file, and
avoid changing the system classpath?

I had pretty much the same problem - it appears that 1.3 doesn't resolve ProxyClasses quite right.
The only workaround I was able to come up with was to do my own deserialization (sending a 'holder'
object across the wire).
I'm curious, did you try it with 1.4 yet?
John Glass <[email protected]> wrote:
We've written an application which provides remote EJB clients a factory class. The
factory class builds dynamic proxy [java.lang.reflect.Proxy] instances which implement
a series of appliaction specific interfaces. When the proxy arrives at the server
(WLS 6.1) the server tries to re-build the instance, but is unable to locate the
application interfaces. We're pretty sure this is due to the default ObjectInputStream.resolveProxyClass()
implementation using the wrong classloader (the application interfaces are in the
EAR file of the app). This can be fixed by putting the interfaces on the system classpath.
Is there anyway to get the server to pick up the interfaces from the EAR file, and
avoid changing the system classpath?--
Dimitri

Similar Messages

  • Dynamic proxies and RMI

    Hi -
    We are having a problem with JDK 1.3.1. We are trying to use dynamic proxies on an object that is bound to an RMI registry.
    We find that the proxy works when the object is called from within the same JVM.
    When RMI method invocations come in from outside the JVM, the dynamic proxy does not get called.
    This seems like a bug. Is it? Is it going to be fixed?
    I suppose a way around it for now is to have the RMI implementation simply delegate to another object that has a dynamic proxy attached to it, but that seems ugly.
    Thanks
    Peter Mularien
    Deploy Solutions, Inc.

    The problem is, that the java runtime environment currently does not supply stubs for dynamic proxy classes. As far as I know this will not be addressed in 1.4. So you cannot create remote objects as dynamic proxies for now.

  • Any example of dynamic proxy with RMI?

    Hi, are there any good example of dynamic proxy with RMI, using the new RemoteObjectInvocationHandler class?
    I am currently implementing a Registry, and want to use dynamic proxy to wrap around the registry stub, to pass extra information to the client.
    I've tried it, but the program will hang and get this exception:
    Exception in thread "RMI TCP Connection(1616)-192.168.1.23" java.lang.OutOfMemoryError: Java heap space
    My implementation looks like this:
    public RegistryImpl extends RemoteServer Implements Registry {
        public RegistryImpl(int port, Properties... properties) throws RemoteException, ChannelException {
             // Create a reference for the registry.
         LiveRef liveref = new LiveRef(id, port);
            ref = new UnicastServerRef(liveref);
             Registry proxy = (Registry)RegistryProxy.newProxyInstance(
                  this.getClass().getClassLoader(),
                  this.getClass().getInterfaces(),
                  new RemoteObjectInvocationHandler(this.getRef()));
             /* Using dynamic proxy */
             usref.exportObject(proxy, null, true);
    public class RegistryProxy extends Proxy implements Registry {
         private InvocationHandler handler;
         public RegistryProxy(InvocationHandler handler) {
              super(handler);
              this.handler = handler;
         public Remote lookup(String name) throws RemoteException, NotBoundException, AccessException {
              Remote result;
              try {
                   Method m = Registry.class.getMethod("lookup", new Class[]{String.class});
                   result = (Remote)handler.invoke(this, m, new Object[]{name});
              } catch (SecurityException e) {
                   throw new UndeclaredThrowableException(e);
              } catch (NoSuchMethodException e) {
                   throw new UndeclaredThrowableException(e);
              } catch (Throwable e) {
                   throw new UndeclaredThrowableException(e);
              return result;
         public void bind(String name, Remote remoteObj) throws RemoteException, AlreadyBoundException, AccessException {
         public void unbind(String name) throws RemoteException, NotBoundException, AccessException {
         public void rebind(String name, Remote remoteObj) throws RemoteException, AccessException {
         public String[] list() throws RemoteException, AccessException {
    }I am new to Java programming, any help is appriciated.
    Regards
    Eddie

    Hi Eddie,
    Perhaps you might like this one:
    http://wiki.java.net/bin/view/Communications/TransparentProxy
    it uses dynamic proxies to achieve complete RMI transparency.
    Something to consider, good luck.
    John

  • Attempting to use SSL over RMI from a web application to a RMI server

    Hi,
    I am attempting to use SSL over RMI to a server. The client is the web
    application that is hosted on WebLogic and that attempts to connect to the
    server. There is no client or server verification at either the client or
    the server end. The code works outside of WebLogic 7/8 but has the following
    issues when running the web application inside weblogic:
    java.rmi.ConnectException: Connection refused to host: gkhanna1; nested
    exception is:
    java.net.ConnectException: Connection refused: connect
    java.net.ConnectException: Connection refused: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:350)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:137)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:124)
    at java.net.Socket.<init>(Socket.java:268)
    at java.net.Socket.<init>(Socket.java:95)
    at
    sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketF
    actory.java:20)
    at
    sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketF
    actory.java:115)
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:494)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:169)
    at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:313)
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
    at java.rmi.Naming.lookup(Naming.java:79)
    at
    com.hyperion.css.spi.impl.ntlm.NTLMConnectionClient.initConnection(NTLMConne
    ctionClient.java:59)
    at
    com.hyperion.css.spi.impl.ntlm.NTLMConnectionClient.getUsers(NTLMConnectionC
    lient.java:197)
    at com.hyperion.css.CSSAPIImpl.getUsers(Unknown Source)
    at com.hyperion.css.CSSAPIImpl.initialize(Unknown Source)
    at com.hyperion.css.CSSAPIImpl.initialize(Unknown Source)
    at jsp_servlet._jsp._app1.__app1signin._jspService(__app1signin.java:133)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at
    weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Servle
    tStubImpl.java:1058)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :401)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :445)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :306)
    at
    weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(W
    ebAppServletContext.java:5445)
    at
    weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
    r.java:780)
    at
    weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
    ntext.java:3105)
    at
    weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
    :2588)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
    The code at the client that initiates the connection:
    socketFactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
    SSLSocket socket = (SSLSocket) socketFactory.createSocket(host, port);
    socket.setEnabledCipherSuites(CIPHERS);
    socket.setEnableSessionCreation(true);
    Any ideas?
    Thanks

    I don't see anything that indicates SSL was directly a factor in the
    failure.
    From the exception stack it looks like a more basic connectivity issue,
    maybe the URL for the
    RMI server is incorrect for some reason or the server was down.
    It looks like you are doing something like this:
    SSL client -> WLS server with servletA, servletA RMI client
    (com.hyperion.css) -> RMI server
    The connection failure appears to be the connection from servletA RMI client
    to the RMI server.
    Is that a correct picture?
    Tony
    "Gaurav Khanna" <[email protected]> wrote in message
    news:[email protected]...
    Hi,
    I am attempting to use SSL over RMI to a server. The client is the web
    application that is hosted on WebLogic and that attempts to connect to the
    server. There is no client or server verification at either the client or
    the server end. The code works outside of WebLogic 7/8 but has thefollowing
    issues when running the web application inside weblogic:
    java.rmi.ConnectException: Connection refused to host: gkhanna1; nested
    exception is:
    java.net.ConnectException: Connection refused: connect
    java.net.ConnectException: Connection refused: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:350)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:137)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:124)
    at java.net.Socket.<init>(Socket.java:268)
    at java.net.Socket.<init>(Socket.java:95)
    at
    sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketF
    actory.java:20)
    at
    sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketF
    actory.java:115)
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:494)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:169)
    at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:313)
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
    at java.rmi.Naming.lookup(Naming.java:79)
    at
    com.hyperion.css.spi.impl.ntlm.NTLMConnectionClient.initConnection(NTLMConne
    ctionClient.java:59)
    at
    com.hyperion.css.spi.impl.ntlm.NTLMConnectionClient.getUsers(NTLMConnectionC
    lient.java:197)
    at com.hyperion.css.CSSAPIImpl.getUsers(Unknown Source)
    at com.hyperion.css.CSSAPIImpl.initialize(Unknown Source)
    at com.hyperion.css.CSSAPIImpl.initialize(Unknown Source)
    at jsp_servlet._jsp._app1.__app1signin._jspService(__app1signin.java:133)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at
    weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Servle
    tStubImpl.java:1058)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :401)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :445)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :306)
    at
    weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(W
    ebAppServletContext.java:5445)
    at
    weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
    r.java:780)
    at
    weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
    ntext.java:3105)
    at
    weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
    :2588)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
    The code at the client that initiates the connection:
    socketFactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
    SSLSocket socket = (SSLSocket) socketFactory.createSocket(host, port);
    socket.setEnabledCipherSuites(CIPHERS);
    socket.setEnableSessionCreation(true);
    Any ideas?
    Thanks

  • A Listener solution based on Generics and Dynamic Proxies

    Listeners are common in the java world, espacially in swing. It is easy to implement a listener, and it is easy to call an existing method that notifies all registered listeners, but it's laborious to implement this notification code itself.
    I present a small, typesafe solution called GenericListeners based on Dynamic Proxies and Generics that reduces the notification code to just a single line of code:
    IGenericListeners<FooListener> fooListeners = GenericListeners.create(FooListener.class);If FooListener looks like
    public interface FooListener {
      public onEnter(int id);
      public onExit();
    }then you can register and call Listeners with
    fooListeners.addListener(foo);
    fooListeners.call().onEnter(1);If you are interested, please have a look at
    http://www.sebastian-baltes.de/SebWiki/Wiki.jsp?page=GenericListeners
    What do you think about this?
    Message was edited by:
    Sebastian_Baltes

    Interesting point, and so I've done some tests:
    0:00:01.391 - plainest implementation
    0:00:02.469 - GenericListeners
    0:00:03.422 - javax.swing.event.EventListenerListI used a test that registers a listener and calls it 10,000,000 times in a for loop on Java 6, AMD Athlon 3000.
    I would say that GenericListeners performs well, especially compared to the EventListenerList that is used in all swing components. The problem with EventListenerList is that it stores different classes of listeners at once and has to find the right ones every time you raise an event. For my tests, I only stored one single listener into the list.
    You can imagine how bad the performance of the swing implementation would be if you have a real life example with a lot of different listener classes.

  • Dynamic Proxies

    I'm trying to implement a way of monitoring method calls on certain objects so that I am able of enforcing security constraints on these calls.
    Considering the functionality provided by the reflection API, I thought that dynamic proxies would be a viable solution.
    But they have one major restriction:
    A dynamic proxy implements interfaces and thus can only be casted to one of these interfaces.
    So what can I do if I need a proxy on class instances which do not implement any interface?
    I have read a few older threads dealing with this problem, but I couldn't find any satisfying solution.
    There where some ideas of runtime creation of byte code and creating classes from it.
    Another way would possibly be runtime compilation of dynamically created code.
    But aren't there any less cumbersome ways for implementation?
    Regards,
    Volker.

    The idea with the class loader sounds interesting. Although I would have to implement it in a way so that it creates proxies for all classes ever loaded into the JVM. What I am trying to prevent is the following:
    Let's say there is an object "secure" which needs access control and there is another object "caller"with a reference to a "proxy" object monitoring the "secure" instance.
    The initial creation of proxies would be no problem since the critical objects are stored in a object database where they can only be retrieved from by explicit query calls. Implementing my own query method allows me to exchange the result of the query with proxy objects which then are returned to the caller.
    Now "caller" invokes a method on proxy, let's say proxy.doSomething(this) and passes itself as a parameter to the call. Now let's assume "caller" is granted access to the method and the call is delegated to "secure".
    In the process of method execution a method of "caller" is invoked (e.g. the equals method to check if the passed parameter is contained in a Collection) which is possible since "caller" has been passed in as a parameter.
    Now the caller.equals(Object o) method could possibly recieve an unprotected instance of the secure object or any other unprotected object which requires access control via the parameter o.
    Thus I need some way to dynamically generate a proxy class for "caller" which monitors access to its methods and checks if there are any unprotected instances passed as parameters to it and then exchange these instances with another proxy object.
    This is exactly the reason why I need to generate proxies for arbitrary classes (not interfaces) dynamically.
    Trying to solve the problem with my own class loader would require me to create proxy objects for all classes, even those from the Java API. I am not sure if this effort pays. Anyway it would probably cause severe performance problems.
    Another solution would be dynamically subclassing objects and overwriting each method to perform security checks. But this is inconvenient since it is not guaranteed that i can subclass a given class and furthermore I couldn't prevent access to public fields which may exist.
    Perhaps there is another solution to the problem.

  • Load balancing over rmi requests

    On a cluster of ias10g (9041), Is it possible that all requests over RMI use a "virtual" hostname and port which directs them to a load balancing mechanism which then determines which of the operational OC4J instances should process this request?

    Does anyone know anything on this question?

  • Replace dynamic proxies and reflection with invokedynamic

    I have an application that extensively uses reflection and dynamic proxies. It was built on Java 6. Now, I rebuilt it on Java 7, and I am thinking of replacing all reflection and proxies with new invokedynamic.
    Can anybody tell me if it's worth the trouble? I mean, will I get any significant performance boost, and will it complicate or simplify my source code?
    Also, can you recommend some good tutorials or articles to get me started? I found some, but they confuse me more then they help :-). I think I have an idea how to replace reflection calls, but can't really figure out how to replace dynamic proxies (is there a replacement for InvocationHandler, or something like that?).
    Thanks for any help.

    the MethodHandle javadocs have pretty straightforward examples on usage http://docs.oracle.com/javase/7/docs/api/java/lang/invoke/MethodHandle.html . It looks like you can use Lookup.unreflect to convert a Method to a MethodHandle (this seems like the most straightforward conversion for existing code): http://docs.oracle.com/javase/7/docs/api/java/lang/invoke/MethodHandles.Lookup.html#unreflect(java.lang.reflect.Method) .

  • Dynamic Proxies vs. Generated Code

    I've seen reference a couple times here about stub serialization issues in
    WebLogic implementations that use dynamic proxies for the stubs. It sounds
    like recent WebLogic versions have switched back to generated code. Is this
    the case?
    If so, I thought dynamic proxies were Serializable. So long as your
    InvocationHandler is serializable, isn't this the case?
    Thanks,
    Bob

    "Bob Lee" <[email protected]> writes:
    I've seen reference a couple times here about stub serialization issues in
    WebLogic implementations that use dynamic proxies for the stubs. It sounds
    like recent WebLogic versions have switched back to generated code. Is this
    the case?WLS 7.0 now uses generated code, but it is bytecode generated by the
    server or client on the fly (not as a result of rmic).
    If so, I thought dynamic proxies were Serializable. So long as your
    InvocationHandler is serializable, isn't this the case?Not necessarily and indeed in order to preserve wire compatibility we
    can't. Note that we switched back to generated code for performance
    reasons. Generated code is faster than dynamic proxies.
    andy

  • Connection Aborted over RMI

    Hi All,
    I am sending some data over an RMI call to store it in to a File.
    i.e client sends an objcet over RMI and server saves this object in to a File.
    but some time the this call is terminated before it reaches the server and socket conncetion is closed.
    The stack Trace of this exception is :
    at $Proxy5.storeInitialCondition(Unknown Source)
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                    at java.lang.reflect.Method.invoke(Unknown Source)
                    at com.pg.orion.basic.rmiservlet.DynamicProxy.invoke(DynamicProxy.java:346)
                    at $Proxy6.storeInitialCondition(Unknown Source)
                    at com.pg.orion.basic.simulation.adapter.SimulationAdapter.saveSnapshot(SimulationAdapter.java:1054)
                    at com.pg.orion.basic.simulation.adapter.SimulationAdapter.processSimulationEvent(SimulationAdapter.java:573)
                    at com.pg.orion.basic.simulation.adapter.SimulationAdapter.access$100(SimulationAdapter.java:44)
                    at com.pg.orion.basic.simulation.adapter.SimulationAdapter$1.run(SimulationAdapter.java:192)
                    at com.pg.orion.basic.threads.DefaultLoopThread.run(DefaultLoopThread.java:206)
                    at java.lang.Thread.run(Unknown Source)
    Caused by: java.net.SocketException: Software caused connection abort: socket write error
                    at java.net.SocketOutputStream.socketWrite0(Native Method)
                    at java.net.SocketOutputStream.socketWrite(Unknown Source)
                    at java.net.SocketOutputStream.write(Unknown Source)
                    at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
                    at java.io.BufferedOutputStream.write(Unknown Source)
                    at java.io.ObjectOutputStream$BlockDataOutputStream.drain(Unknown Source)
                    at java.io.ObjectOutputStream$BlockDataOutputStream.writeByte(Unknown Source)
                    at java.io.ObjectOutputStream.writeFatalException(Unknown Source)
                    at java.io.ObjectOutputStream.writeObject(Unknown Source)
                    at sun.rmi.server.UnicastRef.marshalValue(Unknown Source)
                    ... 16 moreI thought that this is because of the size of the data,but in my testing some times i am able to store big size data.
    Is there any Threshold of RMI or socket to write data?
    If any of You have any idea pls Lat me know.
    Thanks

    It is likely that the other end has closed the connection for some reason.
    I would check if the server side has thrown an exception or closed the connection.
    The main limit for RMI is the max memory the server process. Anything you send needs to fit comfortably into memory. (from all the client requests combined)

  • What is the preferred dynamic routing over l2l/ipsec?

    what is the preferred dynamic routing over l2l/ipsec?
    Sent from Cisco Technical Support iPhone App

    Disclaimer
    The  Author of this posting offers the information contained within this  posting without consideration and with the reader's understanding that  there's no implied or expressed suitability or fitness for any purpose.  Information provided is for informational purposes only and should not  be construed as rendering professional advice of any kind. Usage of this  posting's information is solely at reader's own risk.
    Liability Disclaimer
    In  no event shall Author be liable for any damages whatsoever (including,  without limitation, damages for loss of use, data or profit) arising out  of the use or inability to use the posting's information even if Author  has been advised of the possibility of such damage.
    Posting
    Pretty much what you might use if not IPSec.
    Do you have some reason why IPSec should have a preferred routing protocol or are you just wondering if there is a preferred routing protocol for IPSec?

  • Dynamic Proxies - being forced to recompile client if server changes

    all,
    I am using WLS 6.1 sp 2.
    I have a bean deployed on a particular instance of Weblogic.
    This bean is being accessed by a bean from a different instance.
    The calling applications ear contains a jar containing the Interface classes, Helper Classes, Stub classes (included since I have read server does not allow dynamic download of stubs), XML (I guess from 6.1 onwards weblogic uses dynamic proxies).
    The problem is that every time my server implementation changes just replacing and redploying the client jar doesn't work. I have to recompile my calling application with the new client jar.
    Regards
    Ashish

    ejp wrote:
    What's that test for? That method only returns null if you write a null. Are you doing that? or are you expecting a null at EOS? You won't get that, you will get an EOFException.The tutorial that I read from said that if the server closes before the client that the client will read a null before it can close. So it throws a EOFException instead of a null at the EOS? How should I modify it then so that it checks for end of file yet still reads the input?
    ejp wrote:
    That should work unless there is something else you haven't shown us. Only other things that I can think of is that both the server and the client are on thier own threads because it is a multi-client server, that is not my actual code from my program (I just removed the parts that won't effect whats going on and are fluff), and that this would be the second time that I am sending that Object to the client. Once when my program starts and then the next in the code example I gave you. But thats pretty much it. I pass other Objects fine between the server and clients, I am just having trouble with this guy. Also, this Object implements Serializable and all Objects contained within it also do as well.
    Edited by: ShadowAssassain on Jul 24, 2008 7:43 AM

  • How do I do data compression when message is sent over RMI-IIOP

    Hi,
    Is there a way one can do data compression/de-compression when message is sent over RMI-IIOP ?
    Regards,
    Sourav

    To elaborate on Tammy's idea, you could use for instance C:\Users\Public at the place where you initially put your Excel file to make sure this is found on the target computer. I would consider this a workaround though.
    Or for Lumira documents that you already designed, change the location of the Excel file and use Data/Edit from your computer, then save the Lumira documents before sending them to the target audience. 
    From my humble opinion, the product should allow to use Data/Edit and change the source file even if the initial file path is no longer found. This should be possible for your target audience.
    Antoine

  • Transferring object graph over RMI

    Hi all,
    I'm designing a client-server thingy, and am intending it to communicate over RMI. I'm currently designing a filter mechanism to let the client see a certain subset of the state (essentially an object graph), manipulate this, and transfer updates of it back to the server, which then are propagated to the other clients and so on.
    Any tips and tricks to take into account when transfering interconnected objects over RMI? (They don't need remove references, apart from the state transfer process, all local references are sufficient.) Also, I'd like to not transfer the entire "graph", only updates to it as they happen.
    I have a couple of ideas, I'd just like to hear your input before I dwelve more into the mechanics of them..
    Thanks!
    /C

    Go for it.
    Just think clearly about where the objects exist, and what get's transferred:
    o What objects are on the clients?.
    o What is a shared remote object?
    o What objects get passed from client to server? What objects are returned to clients?

  • Objects passed over RMI?

    When passing a serializable object over RMI (such as an ArrayList) which contains other objects, do the objects contained within this object (e.g. within the ArrayList) need to be serializable also?

    RMI server is very easy, if you want to make clear
    about this problem .
    you must read two interface . RemoteCall , RemoteRef
    Socket clientSecket = new Socket(RemoteHost ,port);
    OutputStream outputStream = clientSecket
    .getoutputStream();
    ObjectOutputStream out = new
    ObjectOutputStream(outputStream)
    out.write(Object);//
    then send a Object to server. if the object not be
    implements java.io.Serialisize , Exception will
    throw.
    are you clear ????? Sha BI ! !!!!!!Are you clear? RMI servers are much simpler than this, and you certainly don't need to know anything about either the RemoteCall or the RemoteRef interface. All this is done behind the scenes for you in RMI, just do call and return. Everyything passed or returned must be serializable, otherwise you get a NotSerializableException.

Maybe you are looking for