01: package org.enhydra.spi.webxml;
02:
03: // rmi import
04: import java.rmi.NoSuchObjectException;
05: import java.rmi.Remote;
06: import java.rmi.RemoteException;
07:
08: import javax.rmi.CORBA.PortableRemoteObjectDelegate;
09:
10: /**
11: * Class <code>WebXmlPRODelegate</code> is a fake PortableRemoteObject for
12: * local methods call.
13: */
14: public class WebXmlPRODelegate implements PortableRemoteObjectDelegate {
15:
16: /**
17: * Exports a Remote Object.
18: * @param obj Remote object to export.
19: * @exception RemoteException If problem in exporting remote object problem
20: * occures.
21: */
22: public void exportObject(Remote obj) throws RemoteException {
23: }
24:
25: /**
26: * Method for unexport object.
27: * @param obj Object to unexport.
28: * @exception NoSuchObjectException If the object is not currently exported.
29: */
30: public void unexportObject(Remote obj) throws NoSuchObjectException {
31: }
32:
33: /**
34: * Connection method.
35: * @param target Target remote object.
36: * @param source Another remote object.
37: * @exception RemoteException If the connection fails.
38: */
39: public void connect(Remote target, Remote source)
40: throws RemoteException {
41: }
42:
43: /**
44: * Narrow method.
45: * @param obj Object to narrow.
46: * @param newClass Expected type of the result.
47: * @return Object of type newClass.
48: * @exception ClassCastException If the obj class is not compatible with a
49: * newClass cast.
50: */
51: public Object narrow(Object obj, Class newClass)
52: throws ClassCastException {
53: if (newClass.isAssignableFrom(obj.getClass())) {
54: return obj;
55: } else {
56: throw new ClassCastException("Can't cast "
57: + obj.getClass().getName() + " in "
58: + newClass.getName());
59: }
60: }
61:
62: /**
63: * toStub method.
64: * @param obj Remote object to unexport.
65: * @return The stub object.
66: * @exception NoSuchObjectException If the object is not currently exported.
67: */
68: public Remote toStub(Remote obj) throws NoSuchObjectException {
69: return obj;
70: }
71: }
|