jp.go.aist.rtm.RTC.port
Class CorbaPort

java.lang.Object
  extended by org.omg.PortableServer.Servant
      extended by RTC.PortServicePOA
          extended by jp.go.aist.rtm.RTC.port.PortBase
              extended by jp.go.aist.rtm.RTC.port.CorbaPort
All Implemented Interfaces:
SDOServiceOperations, org.omg.CORBA.portable.InvokeHandler, PortServiceOperations

public class CorbaPort
extends PortBase

CORBAを通信手段とするPortクラスです。


Nested Class Summary
 
Nested classes/interfaces inherited from class jp.go.aist.rtm.RTC.port.PortBase
PortBase.connect_func, PortBase.disconnect_all_func, PortBase.disconnect_func, PortBase.find_conn_id, PortBase.find_interface, PortBase.find_port_ref
 
Field Summary
(package private)  java.util.Vector<jp.go.aist.rtm.RTC.port.CorbaPort.CorbaConsumerHolder> m_consumers
           
protected  Properties m_properties
           Properties
(package private)  java.util.Vector<jp.go.aist.rtm.RTC.port.CorbaPort.CorbaProviderHolder> m_providers
           vector to stored Providers' information
protected  Logbuf rtcout
          Logging用フォーマットオブジェクト
 
Fields inherited from class jp.go.aist.rtm.RTC.port.PortBase
m_connectionLimit, m_connectorsMutex, m_objref, m_onConnected, m_onConnectionLost, m_onDisconnected, m_onPublishInterfaces, m_onSubscribeInterfaces, m_onUnsubscribeInterfaces, m_ownerInstanceName, m_profile, m_profile_mutex
 
Constructor Summary
CorbaPort(java.lang.String name)
          コンストラクタです。
 
Method Summary
 void activateInterfaces()
           Activate all Port interfaces
 void deactivateInterfaces()
           Deactivate all Port interfaces
 void init(Properties prop)
           Initializing properties
protected  ReturnCode_t publishInterfaces(ConnectorProfileHolder connector_profile)
           Publish information about interfaces
 boolean registerConsumer(java.lang.String instance_name, java.lang.String type_name, CorbaConsumerBase consumer)
           
 boolean registerProvider(java.lang.String instance_name, java.lang.String type_name, org.omg.PortableServer.Servant provider)
           brief Register the provider
protected  ReturnCode_t subscribeInterfaces(ConnectorProfileHolder connector_profile)
           Subscribe to interface
protected  void unsubscribeInterfaces(ConnectorProfile connector_profile)
           Unsubscribe interfaces
 
Methods inherited from class jp.go.aist.rtm.RTC.port.PortBase
_publishInterfaces, _this, addProperty, appendInterface, appendProperty, checkPorts, connect, connectNext, deleteInterface, disconnect_all, disconnect, disconnectNext, eraseConnectorProfile, findConnProfile, findConnProfileIndex, get_connector_profile, get_connector_profiles, get_port_profile, getName, getPortProfile, getPortRef, getProfile, getUUID, isEmptyId, isExistingConnId, notify_connect, notify_disconnect, setConnectionLimit, setName, setOnConnected, setOnConnectionLost, setOnDisconnected, setOnPublishInterfaces, setOnSubscribeInterfaces, setOnUnsubscribeInterfaces, setOwner, setPortRef, setUUID, updateConnectorProfile, updateConnectors
 
Methods inherited from class RTC.PortServicePOA
_all_interfaces, _invoke, _this
 
Methods inherited from class org.omg.PortableServer.Servant
_default_POA, _get_delegate, _get_interface_def, _is_a, _non_existent, _object_id, _orb, _poa, _set_delegate, _this_object, _this_object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_providers

java.util.Vector<jp.go.aist.rtm.RTC.port.CorbaPort.CorbaProviderHolder> m_providers
vector to stored Providers' information


m_consumers

java.util.Vector<jp.go.aist.rtm.RTC.port.CorbaPort.CorbaConsumerHolder> m_consumers

rtcout

protected Logbuf rtcout

Logging用フォーマットオブジェクト


m_properties

protected Properties m_properties

Properties

Constructor Detail

CorbaPort

public CorbaPort(java.lang.String name)

コンストラクタです。

Parameters:
name - Port名称
Method Detail

init

public void init(Properties prop)

Initializing properties

This operation initializes outport's properties. If a property "connection_limit" is set and appropriate value is set to this property value, the number of maximum connection is set as this value. If the property does not exist or invalid value is set to this property, the maximum number of connection will be set unlimited.

Parameters:
prop - properties of the CorbaPort

registerProvider

public boolean registerProvider(java.lang.String instance_name,
                                java.lang.String type_name,
                                org.omg.PortableServer.Servant provider)
                         throws org.omg.PortableServer.POAPackage.ServantAlreadyActive,
                                org.omg.PortableServer.POAPackage.WrongPolicy,
                                org.omg.PortableServer.POAPackage.ObjectNotActive
brief Register the provider

This operation registers a servant, which is provided in this Port, to the Port. The servant is associated with "instance_name" and "type_name" as the instance name of the servant and as the type name of the servant. A given servant will be stored in the CorbaPort, and this is registered as RTC::PROVIDED interface into the PortInterfaceProfile.

Parameters:
instance_name - Instance name of servant
type_name - Type name of the servant
provider - CORBA servant
Returns:
Return false if the same name of instance_name is already registered.
Throws:
org.omg.PortableServer.POAPackage.ServantAlreadyActive
org.omg.PortableServer.POAPackage.WrongPolicy
org.omg.PortableServer.POAPackage.ObjectNotActive

registerConsumer

public boolean registerConsumer(java.lang.String instance_name,
                                java.lang.String type_name,
                                CorbaConsumerBase consumer)

activateInterfaces

public void activateInterfaces()
Activate all Port interfaces

This operation activate all interfaces that is registered in the ports.

Specified by:
activateInterfaces in class PortBase

deactivateInterfaces

public void deactivateInterfaces()
Deactivate all Port interfaces

This operation deactivate all interfaces that is registered in the ports.

Specified by:
deactivateInterfaces in class PortBase

publishInterfaces

protected ReturnCode_t publishInterfaces(ConnectorProfileHolder connector_profile)
Publish information about interfaces

This operation publishes Provider interfaces information, which is owned by this port, to the other Ports via ConnectorProfile::properties. Now it is assumed RTC instance name and other information is as follows,

the following values are stored as the "name" and the "value" of the NameValue typee element in ConnectorProfile::properties. In addition, although the following NameValue values are also stored for the backward compatibility, this will be deleted in the future version. These values are stored in the ConnectorProfile::properties and are propagated to the other Ports. If the Consumer interface exists that requires this Provider interface, it will retrieve reference from the ConnectorProfile and utilize it.

Specified by:
publishInterfaces in class PortBase
Parameters:
connector_profile - Connector profile
Returns:
The return code of ReturnCode_t type

subscribeInterfaces

protected ReturnCode_t subscribeInterfaces(ConnectorProfileHolder connector_profile)
Subscribe to interface

Retrieve information associated with Provider matches Consumer owned by this port and set the object reference to Consumer. Now, Consumer is registered as the following:

  PortInterfaceProfile
  {
    instance_name = "PA10_0";
    type_name     = "Manipulator";
    polarity      = REQUIRED;
  }
 
Find the object reference of Serivce Provider that is registered as the following of other ports:
  PortInterfaceProfile
  {
    instance_name = "PA10_0";
    type_name     = "Manipulator";
    polarity      = PROVIDED;
  }
 
and set to Consumer. In fact, find NameValue that is registered as the following to ConnectorProfile::properties:
 NameValue = { "port.Manipulator.PA10_0":  }
 
 and set the object reference to Consumer.
 

Specified by:
subscribeInterfaces in class PortBase
Parameters:
connector_profile - Connector profile
Returns:
The return code of ReturnCode_t type

unsubscribeInterfaces

protected void unsubscribeInterfaces(ConnectorProfile connector_profile)
Unsubscribe interfaces

Release all Objects that was set in Consumer associated with the given ConnectorProfile.

Specified by:
unsubscribeInterfaces in class PortBase
Parameters:
connector_profile - Connector profile