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 TypeMethodDescriptionvoidaddProvidesPort(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).getPortNonblocking(String name) Fetch a previously registered Port (defined by either addProvide or registerUses) and return that Port if it is available immediately or return null otherwise.PortInfo[]UNADOPTED: Return the Ports this component currently provides.PortInfo[]UNADOPTED: Return the Ports this component currently wants.voidregisterUsesPort(PortInfo name_and_type) Register a request for a Port that will be retrieved subsequently with a call to getPort().voidreleasePort(String name) Notifies the framework that this component is finished using this previously fetched Port.voidremoveProvidesPort(String name) Notifies the framework that a previously exported Port is no longer available for use.voidunregisterUsesPort(String name) Notify the framework that a Port, previously registered by this component, is no longer desired.
-
Method Details
-
getPort
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
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
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
Creates a PortInfo to be used in subsequent calls to describe a Port.- See Also:
-
registerUsesPort
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
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
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
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.
-