package RTT.corba;
/**
* RTT/corba/CDataFlowInterfacePOA.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from DataFlow.idl
* Wednesday, July 11, 2012 5:26:42 PM CEST
*/
/**
* An interface to access the dataflow
* of a CControlTask object. Data ports are exported as
* assignable expressions (Set/Get). Buffer ports are
* exported as buffer channels.
* @ingroup CompIDL
*/
public abstract class CDataFlowInterfacePOA extends org.omg.PortableServer.Servant
implements RTT.corba.CDataFlowInterfaceOperations, org.omg.CORBA.portable.InvokeHandler
{
// Constructors
private static java.util.Hashtable _methods = new java.util.Hashtable ();
static
{
_methods.put ("getPorts", new java.lang.Integer (0));
_methods.put ("getPortDescriptions", new java.lang.Integer (1));
_methods.put ("getPortType", new java.lang.Integer (2));
_methods.put ("getDataType", new java.lang.Integer (3));
_methods.put ("isConnected", new java.lang.Integer (4));
_methods.put ("disconnectPort", new java.lang.Integer (5));
_methods.put ("buildChannelOutput", new java.lang.Integer (6));
_methods.put ("buildChannelInput", new java.lang.Integer (7));
_methods.put ("createConnection", new java.lang.Integer (8));
_methods.put ("removeConnection", new java.lang.Integer (9));
_methods.put ("createStream", new java.lang.Integer (10));
_methods.put ("removeStream", new java.lang.Integer (11));
_methods.put ("channelReady", new java.lang.Integer (12));
}
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 ())
{
/**
* Returns the names of the ports of this component.
*/
case 0: // RTT/corba/CDataFlowInterface/getPorts
{
String $result[] = null;
$result = this.getPorts ();
out = $rh.createReply();
RTT.corba.CDataFlowInterfacePackage.CPortNamesHelper.write (out, $result);
break;
}
/**
* Returns the names of the ports of this component.
*/
case 1: // RTT/corba/CDataFlowInterface/getPortDescriptions
{
RTT.corba.CPortDescription $result[] = null;
$result = this.getPortDescriptions ();
out = $rh.createReply();
RTT.corba.CDataFlowInterfacePackage.CPortDescriptionsHelper.write (out, $result);
break;
}
/**
* Returns the type of the given port
*/
case 2: // RTT/corba/CDataFlowInterface/getPortType
{
try {
String port_name = in.read_string ();
RTT.corba.CPortType $result = null;
$result = this.getPortType (port_name);
out = $rh.createReply();
RTT.corba.CPortTypeHelper.write (out, $result);
} catch (RTT.corba.CNoSuchPortException $ex) {
out = $rh.createExceptionReply ();
RTT.corba.CNoSuchPortExceptionHelper.write (out, $ex);
}
break;
}
/**
* Returns the data type for the given port
*/
case 3: // RTT/corba/CDataFlowInterface/getDataType
{
try {
String port_name = in.read_string ();
String $result = null;
$result = this.getDataType (port_name);
out = $rh.createReply();
out.write_string ($result);
} catch (RTT.corba.CNoSuchPortException $ex) {
out = $rh.createExceptionReply ();
RTT.corba.CNoSuchPortExceptionHelper.write (out, $ex);
}
break;
}
/**
* Check if the given port is already connected to something
*/
case 4: // RTT/corba/CDataFlowInterface/isConnected
{
try {
String port_name = in.read_string ();
boolean $result = false;
$result = this.isConnected (port_name);
out = $rh.createReply();
out.write_boolean ($result);
} catch (RTT.corba.CNoSuchPortException $ex) {
out = $rh.createExceptionReply ();
RTT.corba.CNoSuchPortExceptionHelper.write (out, $ex);
}
break;
}
/**
* Disconnects this port from all connections it is part of.
* @see CChannelElement::disconnect() to disconnect a single Channel.
*/
case 5: // RTT/corba/CDataFlowInterface/disconnectPort
{
try {
String port_name = in.read_string ();
this.disconnectPort (port_name);
out = $rh.createReply();
} catch (RTT.corba.CNoSuchPortException $ex) {
out = $rh.createExceptionReply ();
RTT.corba.CNoSuchPortExceptionHelper.write (out, $ex);
}
break;
}
/**
* Use this to write to an input port with
* the given policy.
* Some protocols may adjust the policy, or pass additional information
* into the policy, such as the name of the newly created connection.
*
* The returned channel element will not be functional until
* channelReady() has been called for it
*/
case 6: // RTT/corba/CDataFlowInterface/buildChannelOutput
{
try {
String input_port = in.read_string ();
RTT.corba.CConnPolicyHolder policy = new RTT.corba.CConnPolicyHolder ();
policy.value = RTT.corba.CConnPolicyHelper.read (in);
RTT.corba.CChannelElement $result = null;
$result = this.buildChannelOutput (input_port, policy);
out = $rh.createReply();
RTT.corba.CChannelElementHelper.write (out, $result);
RTT.corba.CConnPolicyHelper.write (out, policy.value);
} catch (RTT.corba.CNoCorbaTransport $ex) {
out = $rh.createExceptionReply ();
RTT.corba.CNoCorbaTransportHelper.write (out, $ex);
} catch (RTT.corba.CNoSuchPortException $ex) {
out = $rh.createExceptionReply ();
RTT.corba.CNoSuchPortExceptionHelper.write (out, $ex);
}
break;
}
/**
* Use this to read from an output port with
* the given policy.
* Some protocols may adjust the policy, or pass additional information
* into the policy, such as the name of the newly created connection.
*/
case 7: // RTT/corba/CDataFlowInterface/buildChannelInput
{
try {
String output_port = in.read_string ();
RTT.corba.CConnPolicyHolder policy = new RTT.corba.CConnPolicyHolder ();
policy.value = RTT.corba.CConnPolicyHelper.read (in);
RTT.corba.CChannelElement $result = null;
$result = this.buildChannelInput (output_port, policy);
out = $rh.createReply();
RTT.corba.CChannelElementHelper.write (out, $result);
RTT.corba.CConnPolicyHelper.write (out, policy.value);
} catch (RTT.corba.CNoCorbaTransport $ex) {
out = $rh.createExceptionReply ();
RTT.corba.CNoCorbaTransportHelper.write (out, $ex);
} catch (RTT.corba.CNoSuchPortException $ex) {
out = $rh.createExceptionReply ();
RTT.corba.CNoSuchPortExceptionHelper.write (out, $ex);
}
break;
}
/**
* Connect the given named port to the given remote port.
* Use this method to connect two Orocos data flow ports.
*
* The local port needs to be the output, while the remote port is the
* input. In case you only want to write a port without using this function,
* use buildChannelOutput. For only reading a port, use buildChannelInput.
*
* This method combines both buildChannelOutput() and buildChannelInput() and is
* generally better in setting up and checking a data flow connection between
* two ports than the separate methods.
*
* This method will call the \a remote_ports interface back to orchestrate
* the connection building.
*
* @see removeConnection() to remove this connection again.
*/
case 8: // RTT/corba/CDataFlowInterface/createConnection
{
try {
String local_port = in.read_string ();
RTT.corba.CDataFlowInterface remote_ports = RTT.corba.CDataFlowInterfaceHelper.read (in);
String remote_port = in.read_string ();
RTT.corba.CConnPolicyHolder policy = new RTT.corba.CConnPolicyHolder ();
policy.value = RTT.corba.CConnPolicyHelper.read (in);
boolean $result = false;
$result = this.createConnection (local_port, remote_ports, remote_port, policy);
out = $rh.createReply();
out.write_boolean ($result);
RTT.corba.CConnPolicyHelper.write (out, policy.value);
} catch (RTT.corba.CNoSuchPortException $ex) {
out = $rh.createExceptionReply ();
RTT.corba.CNoSuchPortExceptionHelper.write (out, $ex);
}
break;
}
/**
* Removes the specified connection created with createConnection.
*/
case 9: // RTT/corba/CDataFlowInterface/removeConnection
{
try {
String local_port = in.read_string ();
RTT.corba.CDataFlowInterface remote_ports = RTT.corba.CDataFlowInterfaceHelper.read (in);
String remote_port = in.read_string ();
boolean $result = false;
$result = this.removeConnection (local_port, remote_ports, remote_port);
out = $rh.createReply();
out.write_boolean ($result);
} catch (RTT.corba.CNoSuchPortException $ex) {
out = $rh.createExceptionReply ();
RTT.corba.CNoSuchPortExceptionHelper.write (out, $ex);
}
break;
}
/**
* Create an out-of-band data stream with a given policy.
* You may specify a name_id in the policy object, or if left empty,
* a name will be chosen for you.
*/
case 10: // RTT/corba/CDataFlowInterface/createStream
{
try {
String local_port = in.read_string ();
RTT.corba.CConnPolicyHolder policy = new RTT.corba.CConnPolicyHolder ();
policy.value = RTT.corba.CConnPolicyHelper.read (in);
boolean $result = false;
$result = this.createStream (local_port, policy);
out = $rh.createReply();
out.write_boolean ($result);
RTT.corba.CConnPolicyHelper.write (out, policy.value);
} catch (RTT.corba.CNoSuchPortException $ex) {
out = $rh.createExceptionReply ();
RTT.corba.CNoSuchPortExceptionHelper.write (out, $ex);
}
break;
}
/**
* Removes a stream added with createStream.
* @param local_port The port to remove the stream from.
* @param stream_name The name_id returned in the CConnPolicy object
* after the call to createStream.
*/
case 11: // RTT/corba/CDataFlowInterface/removeStream
{
try {
String local_port = in.read_string ();
String stream_name = in.read_string ();
this.removeStream (local_port, stream_name);
out = $rh.createReply();
} catch (RTT.corba.CNoSuchPortException $ex) {
out = $rh.createExceptionReply ();
RTT.corba.CNoSuchPortExceptionHelper.write (out, $ex);
}
break;
}
/**
* Checks if the connection channel elements are ready for a given
* input port.
* This is typically called by the createConnection setup logic to see
* if the input side agrees with the connection and can use it.
* For example, the input port can use this opportunity to check the
*
* @throw CNoSuchPortException if input_port is not an input port
* or not present in this interface.
* @return false if the connection could not be used.
*/
case 12: // RTT/corba/CDataFlowInterface/channelReady
{
try {
String input_port = in.read_string ();
RTT.corba.CChannelElement channel = RTT.corba.CChannelElementHelper.read (in);
boolean $result = false;
$result = this.channelReady (input_port, channel);
out = $rh.createReply();
out.write_boolean ($result);
} catch (RTT.corba.CNoSuchPortException $ex) {
out = $rh.createExceptionReply ();
RTT.corba.CNoSuchPortExceptionHelper.write (out, $ex);
}
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/CDataFlowInterface:1.0"};
public String[] _all_interfaces (org.omg.PortableServer.POA poa, byte[] objectId)
{
return (String[])__ids.clone ();
}
public CDataFlowInterface _this()
{
return CDataFlowInterfaceHelper.narrow(
super._this_object());
}
public CDataFlowInterface _this(org.omg.CORBA.ORB orb)
{
return CDataFlowInterfaceHelper.narrow(
super._this_object(orb));
}
} // class CDataFlowInterfacePOA