fulmine.distribution.connection
Interface IConnection

All Superinterfaces:
IAddressable, IConnectionParameters, IDescriptor, IDestroyable, IEventSource, ILifeCycle
All Known Implementing Classes:
AbstractSocketChannelConnection, TcpConnection

public interface IConnection
extends IEventSource, ILifeCycle, IConnectionParameters

Encapsulates the I/O connection between a local IFrameworkContext and a remote context. When the I/O connection is created and is available, a ConnectionAvailableEvent is raised. When the I/O connection is closed or suffers a disconnect, a ConnectionDestroyedEvent is raised.

Data is sent to the remote context using the send(byte[]) method. When data is received from the remote context a MessageEvent is raised.

Author:
Ramon Servadei

Method Summary
 boolean isOutbound()
          Indicates if this connection was initiated by the local context.
 void send(byte[] data)
          Send the data to the remote IFrameworkContext.
 
Methods inherited from interface fulmine.event.IEventSource
addEvent, addListener, getEventSourceGroupId, getListeners, removeListener, removeListeners
 
Methods inherited from interface fulmine.IDescriptor
toDetailedString, toIdentityString
 
Methods inherited from interface fulmine.ILifeCycle
isActive, start
 
Methods inherited from interface fulmine.IDestroyable
destroy
 
Methods inherited from interface fulmine.IAddressable
getAddress, getDomain, getIdentity, getType
 
Methods inherited from interface fulmine.distribution.connection.IConnectionParameters
getRemoteContextHashCode, getRemoteContextIdentity, isEqual
 

Method Detail

send

void send(byte[] data)
Send the data to the remote IFrameworkContext. This may not be a synchronous action; the implementation may queue the data.

Parameters:
data - the data to send

isOutbound

boolean isOutbound()
Indicates if this connection was initiated by the local context. This can only occur via a call to IConnectionBroker.connect(IConnectionParameters).

Returns:
true if the local context initiated this connection, false if the connection was created by accepting the connection request from a remote context.


Copyright © 2007-2009. All Rights Reserved.