My need is to hide some specific code to the client.
The fact is that I have a SessionBean using RemoteInputStream. To use this SessionBean, the client needs to use the rmiio API to generate a compliant RemoteInputStream. What I want to do it something like replacing the SessionBean interface with an abstract class to include in this interface the code needed to generate the RemoteInputStream. In this way, when the client will use the SessionBean interface, it will hide the code to generate this RemoteInputStream for him and avoid him importing rmiio and using it...
The actual interface is :
@Remote
public interface FileManager {
public void putFile(RemoteInputStream ris);
}
I'd like to include the code in the interface to avoid user from importing rmiio library and write specific code ; somthing like :
@Remote
public abstract class FileManager {
public abstract void putFile(RemoteInputStream ris);
public void putFile(InputStream is) {
RemoteInputStream ris = RemoteInputStreamServer.export(is);
this.putFile(ris);
}
}
I've try the abstract class tips but it seems that the client is no longer able to cast the Proxy anymore...
If somebody have an idea ? Thanks, jérôme.