scs.core
Class Receptacle

java.lang.Object
  extended by scs.core.Receptacle

public class Receptacle
extends Object

This class holds all the metadata pertinent to a receptacle, and represents it locally. It doesn't maintain a ReceptacleDescription directly because the ReceptacleDescription is an automatically generated class. The generated code sets all of its fields as public but these fields should not be manipulated freely.


Method Summary
 int addConnection(Object obj)
          Connects a remote facet to this receptacle.
 void clearConnections()
          Removes all connections.
 boolean equals(Object obj)
           
 List<ConnectionDescription> getConnections()
          Provides a list with metadata about all active connections to this receptacle.
 int getConnectionsSize()
          Provides the current number of connections.
 ReceptacleDescription getDescription()
          Provides the IDL structure ReceptacleDescription of this receptacle.
 String getInterfaceName()
          Provides the interface that this receptacle expects.
 String getName()
          Provides the name of this receptacle.
 int hashCode()
           
 boolean isMultiplex()
          Indicates whether this receptacle accepts more than one connection.
 boolean removeConnection(int id)
          Disconnects a remote facet from this receptacle.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getName

public String getName()
Provides the name of this receptacle.

Returns:
The receptacle name.

getInterfaceName

public String getInterfaceName()
Provides the interface that this receptacle expects. Remote facets must implement this interface to be connected to this receptacle.

Returns:
The receptacle interface.

isMultiplex

public boolean isMultiplex()
Indicates whether this receptacle accepts more than one connection.

Returns:
True if the receptacle accepts more than one connection, false otherwise.

getDescription

public ReceptacleDescription getDescription()
Provides the IDL structure ReceptacleDescription of this receptacle.

Returns:
ReceptacleDescription The description.

getConnections

public List<ConnectionDescription> getConnections()
Provides a list with metadata about all active connections to this receptacle.

Returns:
List with the connections metadata.

getConnectionsSize

public int getConnectionsSize()
Provides the current number of connections.

Returns:
The current number of connections.

clearConnections

public void clearConnections()
Removes all connections.


addConnection

public int addConnection(Object obj)
                  throws AlreadyConnected,
                         ExceededConnectionLimit,
                         InvalidConnection
Connects a remote facet to this receptacle. The facet must implement the interface specified.

Parameters:
obj - The remote facet reference.
Returns:
The connection identifier. It's valid for the entire component, not for this specific receptacle.
Throws:
InvalidConnection - If the facet object does not implement this receptacle's specified interface.
AlreadyConnected - If this receptacle supports only one connection and is already connected.
ExceededConnectionLimit - If the receptacle is multiplex and the maximum number of connections was already reached.

removeConnection

public boolean removeConnection(int id)
Disconnects a remote facet from this receptacle.

Parameters:
id - The connection identifier.
Returns:
True if the connection was removed, false otherwise.

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2014. All Rights Reserved.