4 import java.rmi.Remote;
5 import javax.rmi.PortableRemoteObject;
6 import javax.rmi.CORBA.Tie;
8 import org.omg.CORBA.BAD_OPERATION;
9 import org.omg.CORBA.ORB;
10 import org.omg.CORBA.SystemException;
11 import org.omg.CORBA.portable.OutputStream;
12 import org.omg.CORBA.portable.ResponseHandler;
13 import org.omg.CORBA.portable.UnknownException;
14 import org.omg.PortableServer.Servant;
16 import org.omg.CORBA_2_3.portable.ObjectImpl;
17 import org.omg.CORBA_2_3.portable.InputStream;
19 // This Tie type is obsolete. Use the POA - based tie (key -poa).
22 * This class accepts remote calls to the served GIOP object and delegates them
23 * to the enclosed implementing class. Being derived from the ObjectImpl,
24 * it directly implements the GIOP Object.
26 * It is normally generated with grmic -impl
28 public class _#nameImpl_Tie extends ObjectImpl implements Tie
31 * All decoded remote calls are forwarded to this target.
36 * The array of repository ids, supported by this GIOP Object
38 private static final String[] type_ids =
44 * Get an array of all interfaces (repository ids),
45 * supported by this Object.
47 * @return the array of Ids.
49 public String[] _ids()
55 * Set the invocation target, where all received calls are finally
58 * @param a_target the forwarding target
60 * @throws ClassCastException if the target is not an instance of
63 public void setTarget(Remote a_target)
65 this.target = (#implName) a_target;
69 * Get the invocation target, where all received calls are finally
72 * @return the target, an instance of
75 public Remote getTarget()
81 * Return the actual GIOP object that would handle this request.
83 * @return <code>this</code>, always.
85 public org.omg.CORBA.Object thisObject()
91 * Deactivates this object, disconnecting it from the orb.
93 public void deactivate()
95 _orb().disconnect(this);
101 * Get the {@link ORB} where this {@link Servant} is connected.
111 * Connect this servant to the given ORB.
113 public void orb(ORB orb)
119 * This method is invoked by ORB in response to the remote call. It redirects
120 * the call to one of the methods in the target.
122 * @param method the name of the method to call.
123 * @param parameter_stream the input stream, from where the parameters must be
125 * @param reply the response hander, providing methods to return the result.
127 * @return the output stream, created by the response handler
129 * @throws SystemException if one occurs during method invocation.
131 public OutputStream _invoke(String method,
132 org.omg.CORBA.portable.InputStream parameter_stream,
133 ResponseHandler reply)
137 InputStream in =(InputStream) parameter_stream;
141 throw new BAD_OPERATION("No such method: '"+method+"'");
143 catch (SystemException ex)
149 throw new UnknownException(ex);