Re: code mobility

Mark Zaini <[email protected]>
Newsgroups gmane.comp.java.sun.jini
Message-ID <LISTSERV%[email protected]>
I would use a classloader which can solve the hierarchy between two or more
classes:
If the class A (local) extends the class B(this class could be
on a remote repository at the moment I'm doing my test with Apache)
I don't want ClassnotFoundException...
I would use the class A 's remote method without doing override but
solving the hierarchy.


Thanks a lot Niclas and everyone.
Mark



On Wed, 20 Dec 2006 11:43:41 +0800, Niclas Hedhman <[email protected]>
wrote:

>>My gut feeling says that you are probably going in the wrong direction.
Why
>don't you try to explain what you are trying to do?
>
>If it is just a matter of;
>
>public class MyRemote extends Remote
>{
>    void doSomethingRemotely() throws RemoteException;
>}
>
>public class MyLocal extends MyRemote
>{
>    void doSomethingLocally();
>}
>
>public class MyRemoteServer
>    implements MyRemote
>{
>    public void doSomethingRemotely() throws RemoteException
>    {
>        System.out.println( "This comes on server..." );
>    }
>}
>
>
>public class MyLocalClass extends MyRemoteServer
>    implements MyLocal
>{
>    /// OVERRIDES!!!!
>    public void doSomethingRemotely() throws RemoteException
>    {
>        System.out.println( "This comes on client!!!" );
>    }
>}
>
>then that will work. (Provided that the MyRemoteServer doesn't export
itself
>by default during construction (very common), in which case I think there
>will be all kinds of problems when it is the superclass of MyLocalClass).
>
>
>But if you exepct that the MyLocalClass.doSomethingRemotely() would
happen on
>the server side, you are totally out of luck. You can't have a class split
>across JVMs with parts of the instances on each JVM. I suspect that you
are
>looking for something else. In particular, I think you are struggling
between
>inheritence vs delegation patterns.
>
>
>Cheers
>Niclas

--------------------------------------------------------------------------
Getting Started:     http://www.jini.org/wiki/Category:Getting_Started
Community Web Site:  http://jini.org
jini-users Archive:  http://archives.java.sun.com/archives/jini-users.html
Unsubscribing:       email "signoff JINI-USERS"  to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.