package RTT.corba;
/**
* RTT/corba/_CSendHandleStub.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 class _CSendHandleStub extends org.omg.CORBA.portable.ObjectImpl implements RTT.corba.CSendHandle
{
public RTT.corba.CSendStatus collect (RTT.corba.CAnyArgumentsHolder args)
{
org.omg.CORBA.portable.InputStream $in = null;
try {
org.omg.CORBA.portable.OutputStream $out = _request ("collect", true);
$in = _invoke ($out);
RTT.corba.CSendStatus $result = RTT.corba.CSendStatusHelper.read ($in);
args.value = RTT.corba.CAnyArgumentsHelper.read ($in);
return $result;
} catch (org.omg.CORBA.portable.ApplicationException $ex) {
$in = $ex.getInputStream ();
String _id = $ex.getId ();
throw new org.omg.CORBA.MARSHAL (_id);
} catch (org.omg.CORBA.portable.RemarshalException $rm) {
return collect (args );
} finally {
_releaseReply ($in);
}
} // collect
public RTT.corba.CSendStatus collectIfDone (RTT.corba.CAnyArgumentsHolder args)
{
org.omg.CORBA.portable.InputStream $in = null;
try {
org.omg.CORBA.portable.OutputStream $out = _request ("collectIfDone", true);
$in = _invoke ($out);
RTT.corba.CSendStatus $result = RTT.corba.CSendStatusHelper.read ($in);
args.value = RTT.corba.CAnyArgumentsHelper.read ($in);
return $result;
} catch (org.omg.CORBA.portable.ApplicationException $ex) {
$in = $ex.getInputStream ();
String _id = $ex.getId ();
throw new org.omg.CORBA.MARSHAL (_id);
} catch (org.omg.CORBA.portable.RemarshalException $rm) {
return collectIfDone (args );
} finally {
_releaseReply ($in);
}
} // collectIfDone
/**
* Just checks what the status is.
*/
public RTT.corba.CSendStatus checkStatus ()
{
org.omg.CORBA.portable.InputStream $in = null;
try {
org.omg.CORBA.portable.OutputStream $out = _request ("checkStatus", true);
$in = _invoke ($out);
RTT.corba.CSendStatus $result = RTT.corba.CSendStatusHelper.read ($in);
return $result;
} catch (org.omg.CORBA.portable.ApplicationException $ex) {
$in = $ex.getInputStream ();
String _id = $ex.getId ();
throw new org.omg.CORBA.MARSHAL (_id);
} catch (org.omg.CORBA.portable.RemarshalException $rm) {
return checkStatus ( );
} finally {
_releaseReply ($in);
}
} // checkStatus
/**
* Returns only the return value, when checkStatus() returns CSendSuccess.
* Convenient if the sent method only returns a value.
*/
public org.omg.CORBA.Any ret ()
{
org.omg.CORBA.portable.InputStream $in = null;
try {
org.omg.CORBA.portable.OutputStream $out = _request ("ret", true);
$in = _invoke ($out);
org.omg.CORBA.Any $result = $in.read_any ();
return $result;
} catch (org.omg.CORBA.portable.ApplicationException $ex) {
$in = $ex.getInputStream ();
String _id = $ex.getId ();
throw new org.omg.CORBA.MARSHAL (_id);
} catch (org.omg.CORBA.portable.RemarshalException $rm) {
return ret ( );
} finally {
_releaseReply ($in);
}
} // ret
/**
* 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().
*/
public void checkArguments (org.omg.CORBA.Any[] args) throws RTT.corba.CWrongNumbArgException, RTT.corba.CWrongTypeArgException
{
org.omg.CORBA.portable.InputStream $in = null;
try {
org.omg.CORBA.portable.OutputStream $out = _request ("checkArguments", true);
RTT.corba.CAnyArgumentsHelper.write ($out, args);
$in = _invoke ($out);
return;
} catch (org.omg.CORBA.portable.ApplicationException $ex) {
$in = $ex.getInputStream ();
String _id = $ex.getId ();
if (_id.equals ("IDL:RTT/corba/CWrongNumbArgException:1.0"))
throw RTT.corba.CWrongNumbArgExceptionHelper.read ($in);
else if (_id.equals ("IDL:RTT/corba/CWrongTypeArgException:1.0"))
throw RTT.corba.CWrongTypeArgExceptionHelper.read ($in);
else
throw new org.omg.CORBA.MARSHAL (_id);
} catch (org.omg.CORBA.portable.RemarshalException $rm) {
checkArguments (args );
} finally {
_releaseReply ($in);
}
} // checkArguments
/**
* Clients need to call this after they have finished using this
* CSendHandle object. After dispose(), this object may no longer
* be used.
*/
public void dispose ()
{
org.omg.CORBA.portable.InputStream $in = null;
try {
org.omg.CORBA.portable.OutputStream $out = _request ("dispose", true);
$in = _invoke ($out);
return;
} catch (org.omg.CORBA.portable.ApplicationException $ex) {
$in = $ex.getInputStream ();
String _id = $ex.getId ();
throw new org.omg.CORBA.MARSHAL (_id);
} catch (org.omg.CORBA.portable.RemarshalException $rm) {
dispose ( );
} finally {
_releaseReply ($in);
}
} // dispose
// Type-specific CORBA::Object operations
private static String[] __ids = {
"IDL:RTT/corba/CSendHandle:1.0"};
public String[] _ids ()
{
return (String[])__ids.clone ();
}
private void readObject (java.io.ObjectInputStream s) throws java.io.IOException
{
String str = s.readUTF ();
String[] args = null;
java.util.Properties props = null;
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props);
try {
org.omg.CORBA.Object obj = orb.string_to_object (str);
org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate ();
_set_delegate (delegate);
} finally {
orb.destroy() ;
}
}
private void writeObject (java.io.ObjectOutputStream s) throws java.io.IOException
{
String[] args = null;
java.util.Properties props = null;
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props);
try {
String str = orb.object_to_string (this);
s.writeUTF (str);
} finally {
orb.destroy() ;
}
}
} // class _CSendHandleStub