// Tie class generated by rmic, do not edit.
// Contents subject to change without notice.
package gnu.testlet.javax.rmi.CORBA.Tie;
import gnu.testlet.org.omg.CORBA_2_3.ORB.Valtype.Info;
import gnu.testlet.org.omg.CORBA_2_3.ORB.Valtype.cmInfo;
import java.rmi.Remote;
//Not a test, required by RMI_IIOP.java.
//Copyright (C) 2005 Audrius Meskauskas (AudriusA@Bioinformatics.org)
//Mauve is free software; you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation; either version 2, or (at your option)
//any later version.
//Mauve is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//GNU General Public License for more details.
//You should have received a copy of the GNU General Public License
//along with Mauve; see the file COPYING. If not, write to
//the Free Software Foundation, 59 Temple Place - Suite 330,
//Boston, MA 02111-1307, USA. */
import java.util.Collection;
import javax.rmi.PortableRemoteObject;
import javax.rmi.CORBA.Tie;
import javax.rmi.CORBA.Util;
import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.ORB;
import org.omg.CORBA.SystemException;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;
import org.omg.CORBA.portable.ResponseHandler;
import org.omg.CORBA.portable.UnknownException;
import org.omg.PortableServer.Servant;
/**
* This file is part of the CORBA RMI over IIOP the test executable
* class being gnu.testlet.javax.rmi.CORBA.Tie.RMI_IIOP.
*
* @author Audrius Meskauskas (AudriusA@bluewin.ch)
*/
public class _RMI_testImpl_Tie
extends Servant
implements Tie
{
private RMI_testImpl target = null;
static final String[] _type_ids = { "RMI:" + RMI_test.class.getName()
+ ":0000000000000000" };
public void setTarget(Remote target)
{
this.target = (RMI_testImpl) target;
}
public Remote getTarget()
{
return target;
}
public org.omg.CORBA.Object thisObject()
{
return _this_object();
}
public void deactivate()
{
try
{
_poa().deactivate_object(_poa().servant_to_id(this));
}
catch (org.omg.PortableServer.POAPackage.WrongPolicy exception)
{
}
catch (org.omg.PortableServer.POAPackage.ObjectNotActive exception)
{
}
catch (org.omg.PortableServer.POAPackage.ServantNotActive exception)
{
}
}
public ORB orb()
{
return _orb();
}
public void orb(ORB orb)
{
try
{
((org.omg.CORBA_2_3.ORB) orb).set_delegate(this);
}
catch (ClassCastException e)
{
throw new org.omg.CORBA.BAD_PARAM(
"POA Servant requires an instance of org.omg.CORBA_2_3.ORB");
}
}
public String[] _all_interfaces(org.omg.PortableServer.POA poa,
byte[] objectId)
{
return _type_ids;
}
public OutputStream _invoke(String method, InputStream _in,
ResponseHandler reply)
throws SystemException
{
try
{
org.omg.CORBA_2_3.portable.InputStream in = (org.omg.CORBA_2_3.portable.InputStream) _in;
switch (method.length())
{
case 8:
if (method.equals("multiply"))
{
byte arg0 = in.read_octet();
long arg1 = in.read_longlong();
long result = target.multiply(arg0, arg1);
OutputStream out = reply.createReply();
out.write_longlong(result);
return out;
}
else if (method.equals("_get_ego"))
{
String result = target.getEgo();
org.omg.CORBA_2_3.portable.OutputStream out = (org.omg.CORBA_2_3.portable.OutputStream) reply.createReply();
out.write_value(result, String.class);
return out;
}
else if (method.equals("sayHello"))
{
RMI_test arg0 = (RMI_test) PortableRemoteObject.narrow(
in.read_Object(), RMI_test.class);
String result = target.sayHello(arg0);
org.omg.CORBA_2_3.portable.OutputStream out = (org.omg.CORBA_2_3.portable.OutputStream) reply.createReply();
out.write_value(result, String.class);
return out;
}
case 9:
if (method.equals("passArray"))
{
int[] arg0 = (int[]) in.read_value(int[].class);
int result = target.passArray(arg0);
OutputStream out = reply.createReply();
out.write_long(result);
return out;
}
case 11:
if (method.equals("joinStrings"))
{
String arg0 = (String) in.read_value(String.class);
String arg1 = (String) in.read_value(String.class);
String result = target.joinStrings(arg0, arg1);
org.omg.CORBA_2_3.portable.OutputStream out = (org.omg.CORBA_2_3.portable.OutputStream) reply.createReply();
out.write_value(result, String.class);
return out;
}
case 13:
if (method.equals("passStructure"))
{
myStructure arg0 = (myStructure) in.read_value(myStructure.class);
String result = target.passStructure(arg0);
org.omg.CORBA_2_3.portable.OutputStream out = (org.omg.CORBA_2_3.portable.OutputStream) reply.createReply();
out.write_value(result, String.class);
return out;
}
case 14:
if (method.equals("passPrimitives"))
{
byte arg0 = in.read_octet();
double arg1 = in.read_double();
int arg2 = in.read_long();
String arg3 = (String) in.read_value(String.class);
float arg4 = in.read_float();
char arg5 = in.read_wchar();
short arg6 = in.read_short();
String result = target.passPrimitives(arg0, arg1, arg2, arg3,
arg4, arg5, arg6);
org.omg.CORBA_2_3.portable.OutputStream out = (org.omg.CORBA_2_3.portable.OutputStream) reply.createReply();
out.write_value(result, String.class);
return out;
}
else if (method.equals("passCollection"))
{
Collection arg0 = (Collection) in.read_value(Collection.class);
String result = target.passCollection(arg0);
org.omg.CORBA_2_3.portable.OutputStream out = (org.omg.CORBA_2_3.portable.OutputStream) reply.createReply();
out.write_value(result, String.class);
return out;
}
case 15:
if (method.equals("passStringArray"))
{
String[] arg0 = (String[]) in.read_value(String[].class);
String result = target.passStringArray(arg0);
org.omg.CORBA_2_3.portable.OutputStream out = (org.omg.CORBA_2_3.portable.OutputStream) reply.createReply();
out.write_value(result, String.class);
return out;
}
else if (method.equals("passCorbaObject"))
{
org.omg.CORBA.Object arg0 = (org.omg.CORBA.Object) in.read_Object();
String result = target.passCorbaObject(arg0);
org.omg.CORBA_2_3.portable.OutputStream out = (org.omg.CORBA_2_3.portable.OutputStream) reply.createReply();
out.write_value(result, String.class);
return out;
}
case 16:
if (method.equals("passReturnRemote"))
{
RMI_test arg0 = (RMI_test) PortableRemoteObject.narrow(
in.read_Object(), RMI_test.class);
RMI_test result = target.passReturnRemote(arg0);
OutputStream out = reply.createReply();
Util.writeRemoteObject(out, result);
return out;
}
case 18:
if (method.equals("passStructureArray"))
{
myStructure[] arg0 = (myStructure[]) in.read_value(myStructure[].class);
String result = target.passStructureArray(arg0);
org.omg.CORBA_2_3.portable.OutputStream out = (org.omg.CORBA_2_3.portable.OutputStream) reply.createReply();
out.write_value(result, String.class);
return out;
}
else if (method.equals("passCorbaValueType"))
{
Info arg0 = (Info) in.read_value(Info.class);
String result = target.passCorbaValueType(arg0);
org.omg.CORBA_2_3.portable.OutputStream out = (org.omg.CORBA_2_3.portable.OutputStream) reply.createReply();
out.write_value(result, String.class);
return out;
}
else if (method.equals("exchangeNodeObject"))
{
NodeObject arg0 = (NodeObject) in.read_value(NodeObject.class);
NodeObject result = target.exchangeNodeObject(arg0);
org.omg.CORBA_2_3.portable.OutputStream out = (org.omg.CORBA_2_3.portable.OutputStream) reply.createReply();
out.write_value(result, NodeObject.class);
return out;
}
else if (method.equals("passArrayOfRemotes"))
{
RMI_test[] arg0 = (RMI_test[]) in.read_value(RMI_test[].class);
String result = target.passArrayOfRemotes(arg0);
org.omg.CORBA_2_3.portable.OutputStream out = (org.omg.CORBA_2_3.portable.OutputStream) reply.createReply();
out.write_value(result, String.class);
return out;
}
case 20:
if (method.equals("passCorbaCMValueType"))
{
cmInfo arg0 = (cmInfo) in.read_value(cmInfo.class);
String result = target.passCorbaCMValueType(arg0);
org.omg.CORBA_2_3.portable.OutputStream out = (org.omg.CORBA_2_3.portable.OutputStream) reply.createReply();
out.write_value(result, String.class);
return out;
}
case 23:
if (method.equals("passCorbaValueTypeArray"))
{
Info[] arg0 = (Info[]) in.read_value(Info[].class);
String result = target.passCorbaValueTypeArray(arg0);
org.omg.CORBA_2_3.portable.OutputStream out = (org.omg.CORBA_2_3.portable.OutputStream) reply.createReply();
out.write_value(result, String.class);
return out;
}
}
throw new BAD_OPERATION();
}
catch (SystemException ex)
{
throw ex;
}
catch (Throwable ex)
{
throw new UnknownException(ex);
}
}
}