package RTT.corba;
/**
* RTT/corba/CSendHandlePOA.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from OperationInterface.idl
* Wednesday, July 11, 2012 5:26:50 PM CEST
*/
/**
* A handler object that allows us to collect the results
* of a send. Due to memory restrictions, a server may choose
* to cleanup a CSendHandle before or during collect() was called.
* This is equivalent to having a SendError.
*/
public abstract class CSendHandlePOA extends org.omg.PortableServer.Servant
implements RTT.corba.CSendHandleOperations, org.omg.CORBA.portable.InvokeHandler
{
// Constructors
private static java.util.Hashtable _methods = new java.util.Hashtable ();
static
{
_methods.put ("collect", new java.lang.Integer (0));
_methods.put ("collectIfDone", new java.lang.Integer (1));
_methods.put ("checkStatus", new java.lang.Integer (2));
_methods.put ("ret", new java.lang.Integer (3));
_methods.put ("checkArguments", new java.lang.Integer (4));
_methods.put ("dispose", new java.lang.Integer (5));
}
public org.omg.CORBA.portable.OutputStream _invoke (String $method,
org.omg.CORBA.portable.InputStream in,
org.omg.CORBA.portable.ResponseHandler $rh)
{
org.omg.CORBA.portable.OutputStream out = null;
java.lang.Integer __method = (java.lang.Integer)_methods.get ($method);
if (__method == null)
throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
switch (__method.intValue ())
{
case 0: // RTT/corba/CSendHandle/collect
{
RTT.corba.CAnyArgumentsHolder args = new RTT.corba.CAnyArgumentsHolder ();
RTT.corba.CSendStatus $result = null;
$result = this.collect (args);
out = $rh.createReply();
RTT.corba.CSendStatusHelper.write (out, $result);
RTT.corba.CAnyArgumentsHelper.write (out, args.value);
break;
}
case 1: // RTT/corba/CSendHandle/collectIfDone
{
RTT.corba.CAnyArgumentsHolder args = new RTT.corba.CAnyArgumentsHolder ();
RTT.corba.CSendStatus $result = null;
$result = this.collectIfDone (args);
out = $rh.createReply();
RTT.corba.CSendStatusHelper.write (out, $result);
RTT.corba.CAnyArgumentsHelper.write (out, args.value);
break;
}
/**
* Just checks what the status is.
*/
case 2: // RTT/corba/CSendHandle/checkStatus
{
RTT.corba.CSendStatus $result = null;
$result = this.checkStatus ();
out = $rh.createReply();
RTT.corba.CSendStatusHelper.write (out, $result);
break;
}
/**
* Returns only the return value, when checkStatus() returns CSendSuccess.
* Convenient if the sent method only returns a value.
*/
case 3: // RTT/corba/CSendHandle/ret
{
org.omg.CORBA.Any $result = null;
$result = this.ret ();
out = $rh.createReply();
out.write_any ($result);
break;
}
/**
* Checks if this handle returns these arguments in collect() and collectIfDone().
* You can use this to check if collect() or collectIfDone() return what you expect.
* If no exception is thrown, the arguments are of the correct number
* and type. The values in \a args are ignored and not stored, only the types of the anys are checked.
* One could obtain the same information by using COperationInterface::getCollectType()
* for 1..COperationInterface::getCollectArity().
*/
case 4: // RTT/corba/CSendHandle/checkArguments
{
try {
org.omg.CORBA.Any args[] = RTT.corba.CAnyArgumentsHelper.read (in);
this.checkArguments (args);
out = $rh.createReply();
} catch (RTT.corba.CWrongNumbArgException $ex) {
out = $rh.createExceptionReply ();
RTT.corba.CWrongNumbArgExceptionHelper.write (out, $ex);
} catch (RTT.corba.CWrongTypeArgException $ex) {
out = $rh.createExceptionReply ();
RTT.corba.CWrongTypeArgExceptionHelper.write (out, $ex);
}
break;
}
/**
* Clients need to call this after they have finished using this
* CSendHandle object. After dispose(), this object may no longer
* be used.
*/
case 5: // RTT/corba/CSendHandle/dispose
{
this.dispose ();
out = $rh.createReply();
break;
}
default:
throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
}
return out;
} // _invoke
// Type-specific CORBA::Object operations
private static String[] __ids = {
"IDL:RTT/corba/CSendHandle:1.0"};
public String[] _all_interfaces (org.omg.PortableServer.POA poa, byte[] objectId)
{
return (String[])__ids.clone ();
}
public CSendHandle _this()
{
return CSendHandleHelper.narrow(
super._this_object());
}
public CSendHandle _this(org.omg.CORBA.ORB orb)
{
return CSendHandleHelper.narrow(
super._this_object(orb));
}
} // class CSendHandlePOA