Package jadex.bridge.component.streams
Class AbstractConnection
- java.lang.Object
- 
- jadex.bridge.component.streams.AbstractConnection
 
- 
- All Implemented Interfaces:
- IConnection
 - Direct Known Subclasses:
- InputConnection,- OutputConnection
 
 public abstract class AbstractConnection extends java.lang.Object implements IConnection Abstract base class for connections. Connection code is called from connection users, i.e. active components, on their on thread. Calls from the connection handler occur on another thread so that these calls must be synchronized.
- 
- 
Field SummaryFields Modifier and Type Field Description protected IAbstractConnectionHandlerchThe abstract connection handler.protected booleanclosedprotected booleanclosingprotected intidThe connection id.protected booleaniniThe initiator flag.protected booleaninitedBoolean flag if connection is inited, closing, closed.protected IComponentIdentifierinitiatorThe connection initiator.protected booleaninputThe input flag.protected IComponentIdentifierparticipantThe participant.
 - 
Constructor SummaryConstructors Constructor Description AbstractConnection(IComponentIdentifier sender, IComponentIdentifier receiver, int id, boolean input, boolean initiator, IAbstractConnectionHandler ch)Create a new input connection.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the connection.IAbstractConnectionHandlergetConnectionHandler()Get the connection handler.intgetConnectionId()Get the id.IComponentIdentifiergetInitiator()Get the initiator.java.util.Map<java.lang.String,java.lang.Object>getNonFunctionalProperties()Get the non-functional properties of the connection.IComponentIdentifiergetParticipant()Get the participant.booleanisClosed()Get the closed.booleanisClosing()Get the closed.booleanisInited()Get the inited.booleanisInitiatorSide()Test if this connection is the initiator side.booleanisInputConnection()Test if this connection is an input connection.voidsetClosed()Set the connection to closed.voidsetClosing()Set the connection to closed.voidsetInited()Set the inited.
 
- 
- 
- 
Field Detail- 
initedprotected boolean inited Boolean flag if connection is inited, closing, closed.
 - 
closedprotected boolean closed 
 - 
closingprotected boolean closing 
 - 
idprotected int id The connection id.
 - 
initiatorprotected IComponentIdentifier initiator The connection initiator.
 - 
participantprotected IComponentIdentifier participant The participant.
 - 
inputprotected boolean input The input flag.
 - 
iniprotected boolean ini The initiator flag.
 - 
chprotected IAbstractConnectionHandler ch The abstract connection handler.
 
- 
 - 
Constructor Detail- 
AbstractConnectionpublic AbstractConnection(IComponentIdentifier sender, IComponentIdentifier receiver, int id, boolean input, boolean initiator, IAbstractConnectionHandler ch) Create a new input connection.
 
- 
 - 
Method Detail- 
getConnectionIdpublic int getConnectionId() Get the id.- Specified by:
- getConnectionIdin interface- IConnection
- Returns:
- the id.
 
 - 
getInitiatorpublic IComponentIdentifier getInitiator() Get the initiator.- Specified by:
- getInitiatorin interface- IConnection
- Returns:
- The initiator.
 
 - 
getParticipantpublic IComponentIdentifier getParticipant() Get the participant.- Specified by:
- getParticipantin interface- IConnection
- Returns:
- The participant.
 
 - 
isInitedpublic boolean isInited() Get the inited.- Returns:
- the inited.
 
 - 
setInitedpublic void setInited() Set the inited.- Parameters:
- inited- The inited to set.
 
 - 
setClosingpublic void setClosing() Set the connection to closed.
 - 
setClosedpublic void setClosed() Set the connection to closed.
 - 
isClosingpublic boolean isClosing() Get the closed.- Returns:
- The closed.
 
 - 
isClosedpublic boolean isClosed() Get the closed.- Returns:
- The closed.
 
 - 
closepublic void close() Close the connection. Notifies the other side that the connection has been closed.- Specified by:
- closein interface- IConnection
 
 - 
isInitiatorSidepublic boolean isInitiatorSide() Test if this connection is the initiator side.- Returns:
- True if is initiator.
 
 - 
isInputConnectionpublic boolean isInputConnection() Test if this connection is an input connection.- Returns:
- True if is initiator.
 
 - 
getNonFunctionalPropertiespublic java.util.Map<java.lang.String,java.lang.Object> getNonFunctionalProperties() Get the non-functional properties of the connection.- Specified by:
- getNonFunctionalPropertiesin interface- IConnection
 
 - 
getConnectionHandlerpublic IAbstractConnectionHandler getConnectionHandler() Get the connection handler.
 
- 
 
-