My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Links

Allow to pass a huge List over the network using lazy loading.

Consider having a remote server object with an interface like this:

public Server implements Remote{
     List<Foo> getFoos() throws RemoteException;
}

According to the the RMI specification calling this method will cause that the resulting List is serialized and passed back over the network to the client. Consider the case when the resulting list is huge and you don't want pass such a big thing over the network or consider the case when the list is not serializable.

The remoted-list library will address these problems replacing a the actual list with a remoted version that lazily load the elements.

The usage of remote-list is simple. Consider the getFoos() implementation:

List<Foo> getFoos() {
    List<Foo> actualList = ... // create or get a list according your business logic
    List<Foo> remotedList = Remotizer.remotize(actualList);

    return remotedList;
}

Instead to returning the actualList the method returns a remotedList which reflects the contents of the actualList without containing all its elements.

When the client call remoteList.get(index) the remoteList acts like a proxy and call through RMI the get(index) method on the actualList which was left on the server JVM.

Powered by Google Project Hosting