Package gov.cca

Interface Services


public interface Services
This is the framework/container services interface, through which the component accesses the framework and (indirectly) other components.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addProvidesPort(Port inPort, PortInfo name_type_and_props)
    Exports a Port implemented by this component to the framework.
    createPortInfo(String name, String type, String[] properties)
    Creates a PortInfo to be used in subsequent calls to describe a Port.
    Get a reference interface for the component to which this Services object belongs.
    Fetch a previously registered Port (defined by either addProvide or registerUses).
    Fetch a previously registered Port (defined by either addProvide or registerUses) and return that Port if it is available immediately or return null otherwise.
    UNADOPTED: Return the Ports this component currently provides.
    UNADOPTED: Return the Ports this component currently wants.
    void
    registerUsesPort(PortInfo name_and_type)
    Register a request for a Port that will be retrieved subsequently with a call to getPort().
    void
    Notifies the framework that this component is finished using this previously fetched Port.
    void
    Notifies the framework that a previously exported Port is no longer available for use.
    void
    Notify the framework that a Port, previously registered by this component, is no longer desired.
  • Method Details

    • getPort

      Port getPort(String name) throws Exception
      Fetch a previously registered Port (defined by either addProvide or registerUses).
      Returns:
      Will return the Port (possibly waiting forever to acquire it) or return null. There is an implied contract that the port will remain valid for use by the component until the port is released via releasePort(), or a DisconnectingConnectionEvent is dispatched to the component.
      Throws:
      Exception - if named port is not known.
    • getPortNonblocking

      Port getPortNonblocking(String name) throws Exception
      Fetch a previously registered Port (defined by either addProvide or registerUses) and return that Port if it is available immediately or return null otherwise. There is an implied contract that the port will remain valid for use by the component until the port is released via releasePort().
      Throws:
      Exception
    • releasePort

      void releasePort(String name)
      Notifies the framework that this component is finished using this previously fetched Port. releasePort() method calls should exactly match getPort() method calls; however, an extra call to releasePort() is not an error.
    • createPortInfo

      PortInfo createPortInfo(String name, String type, String[] properties)
      Creates a PortInfo to be used in subsequent calls to describe a Port.
      See Also:
    • registerUsesPort

      void registerUsesPort(PortInfo name_and_type) throws Exception
      Register a request for a Port that will be retrieved subsequently with a call to getPort().
      Throws:
      Exception - Registering the same name twice is an error, regardless of the associated type or properties in the PortInfo.
    • unregisterUsesPort

      void unregisterUsesPort(String name) throws Exception
      Notify the framework that a Port, previously registered by this component, is no longer desired.
      Throws:
      Exception - Unregistering a port which is currently in use (i.e. an unreleased getPort() being outstanding) is an error.
    • addProvidesPort

      void addProvidesPort(Port inPort, PortInfo name_type_and_props) throws Exception
      Exports a Port implemented by this component to the framework. This Port is now available for the framework to connect to other components.
      Throws:
      Exception - Adding an already defined port name (registered or provided) is an error.
    • removeProvidesPort

      void removeProvidesPort(String name)
      Notifies the framework that a previously exported Port is no longer available for use.
    • getProvidedPorts

      PortInfo[] getProvidedPorts()
      UNADOPTED: Return the Ports this component currently provides.
    • getRegisteredPorts

      PortInfo[] getRegisteredPorts()
      UNADOPTED: Return the Ports this component currently wants.
    • getComponentID

      ComponentID getComponentID()
      Get a reference interface for the component to which this Services object belongs.