Create a "factory" class that creates and returns instances of X. Example:
<blockquote>
<pre>
public class XFactoryImpl extends UnicastRemoteObject implements XFactory {
public static synchronized X createX() {
return new XImpl();
}
}
</pre>
</blockquote>
Remember...
- Register class XFactoryImpl
- Don't register XImpl
- Client does a lookup of XFactory and then invokes createX
Good Luck,
Avi.