package RTT.corba;
/**
* RTT/corba/_CServiceRequesterStub.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from ServiceRequester.idl
* Wednesday, July 11, 2012 5:27:05 PM CEST
*/
/**
* An Orocos Required Service.
* Exposes that this component requires certain services.
* @ingroup CompIDL
*/
public class _CServiceRequesterStub extends org.omg.CORBA.portable.ObjectImpl implements RTT.corba.CServiceRequester
{
/**
* Return the name of this service.
*/
public String getRequestName ()
{
org.omg.CORBA.portable.InputStream $in = null;
try {
org.omg.CORBA.portable.OutputStream $out = _request ("getRequestName", true);
$in = _invoke ($out);
String $result = $in.read_string ();
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 getRequestName ( );
} finally {
_releaseReply ($in);
}
} // getRequestName
/**
* Get a list of all the child requests this request offers.
*/
public String[] getRequestNames ()
{
org.omg.CORBA.portable.InputStream $in = null;
try {
org.omg.CORBA.portable.OutputStream $out = _request ("getRequestNames", true);
$in = _invoke ($out);
String $result[] = RTT.corba.CRequestNamesHelper.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 getRequestNames ( );
} finally {
_releaseReply ($in);
}
} // getRequestNames
/**
* Returns the methods required by this requester.
*/
public String[] getOperationCallerNames ()
{
org.omg.CORBA.portable.InputStream $in = null;
try {
org.omg.CORBA.portable.OutputStream $out = _request ("getOperationCallerNames", true);
$in = _invoke ($out);
String $result[] = RTT.corba.COperationCallerNamesHelper.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 getOperationCallerNames ( );
} finally {
_releaseReply ($in);
}
} // getOperationCallerNames
/**
* Get a child request this request provides.
*/
public RTT.corba.CServiceRequester getRequest (String name)
{
org.omg.CORBA.portable.InputStream $in = null;
try {
org.omg.CORBA.portable.OutputStream $out = _request ("getRequest", true);
$out.write_string (name);
$in = _invoke ($out);
RTT.corba.CServiceRequester $result = RTT.corba.CServiceRequesterHelper.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 getRequest (name );
} finally {
_releaseReply ($in);
}
} // getRequest
/**
* Has this request a child request with given name ?
*/
public boolean hasRequest (String name)
{
org.omg.CORBA.portable.InputStream $in = null;
try {
org.omg.CORBA.portable.OutputStream $out = _request ("hasRequest", true);
$out.write_string (name);
$in = _invoke ($out);
boolean $result = $in.read_boolean ();
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 hasRequest (name );
} finally {
_releaseReply ($in);
}
} // hasRequest
/**
* Connects the whole interface to a remote service.
*/
public boolean connectTo (RTT.corba.CService svc)
{
org.omg.CORBA.portable.InputStream $in = null;
try {
org.omg.CORBA.portable.OutputStream $out = _request ("connectTo", true);
RTT.corba.CServiceHelper.write ($out, svc);
$in = _invoke ($out);
boolean $result = $in.read_boolean ();
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 connectTo (svc );
} finally {
_releaseReply ($in);
}
} // connectTo
/**
* Connets a single operation caller from this interface to
* one with the same name in a remote service.
*/
public boolean connectCallerTo (String name, RTT.corba.CService svc)
{
org.omg.CORBA.portable.InputStream $in = null;
try {
org.omg.CORBA.portable.OutputStream $out = _request ("connectCallerTo", true);
$out.write_string (name);
RTT.corba.CServiceHelper.write ($out, svc);
$in = _invoke ($out);
boolean $result = $in.read_boolean ();
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 connectCallerTo (name, svc );
} finally {
_releaseReply ($in);
}
} // connectCallerTo
/**
* Returns true if all operation callers are connected to
* the operations of a service.
*/
public boolean ready ()
{
org.omg.CORBA.portable.InputStream $in = null;
try {
org.omg.CORBA.portable.OutputStream $out = _request ("ready", true);
$in = _invoke ($out);
boolean $result = $in.read_boolean ();
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 ready ( );
} finally {
_releaseReply ($in);
}
} // ready
/**
* Disconnects a caller.
* @return false if name dit not exist.
*/
public boolean disconnectCaller (String name)
{
org.omg.CORBA.portable.InputStream $in = null;
try {
org.omg.CORBA.portable.OutputStream $out = _request ("disconnectCaller", true);
$out.write_string (name);
$in = _invoke ($out);
boolean $result = $in.read_boolean ();
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 disconnectCaller (name );
} finally {
_releaseReply ($in);
}
} // disconnectCaller
/**
* Checks if a caller is ready.
* @return false if name dit not exist or not ready.
*/
public boolean callerReady (String name)
{
org.omg.CORBA.portable.InputStream $in = null;
try {
org.omg.CORBA.portable.OutputStream $out = _request ("callerReady", true);
$out.write_string (name);
$in = _invoke ($out);
boolean $result = $in.read_boolean ();
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 callerReady (name );
} finally {
_releaseReply ($in);
}
} // callerReady
/**
* Disconnects all operation callers.
*/
public void disconnect ()
{
org.omg.CORBA.portable.InputStream $in = null;
try {
org.omg.CORBA.portable.OutputStream $out = _request ("disconnect", 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) {
disconnect ( );
} finally {
_releaseReply ($in);
}
} // disconnect
// Type-specific CORBA::Object operations
private static String[] __ids = {
"IDL:RTT/corba/CServiceRequester: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 _CServiceRequesterStub