fulmine.distribution.connection
Interface IConnectionParameters

All Known Subinterfaces:
IConnection
All Known Implementing Classes:
AbstractSocketChannelConnection, TcpConnection, TcpConnectionParameters

public interface IConnectionParameters

Encapsulates the parameters required to create an IConnection. The parameters are used as the argument for the IConnectionBroker#connect(IConnection) method.

Implementations must define the #equals(Object) method to compare connection parameters with another instance.

Author:
Ramon Servadei

Method Summary
 int getRemoteContextHashCode()
          Get a unique integer for the remote context.
 String getRemoteContextIdentity()
          Get the identity of the IFrameworkContext at the remote end of the connection
 boolean isEqual(IConnectionParameters connectionParameters)
          Checks the connection parameters for equality.
 

Method Detail

getRemoteContextIdentity

String getRemoteContextIdentity()
Get the identity of the IFrameworkContext at the remote end of the connection

Returns:
the String identity of the remote context

getRemoteContextHashCode

int getRemoteContextHashCode()
Get a unique integer for the remote context. This must be constant for any connection to the same remote context. This must be completely unique for a remote context instance, regardless of the context identity.

Returns:
a unique integer for the remote context

isEqual

boolean isEqual(IConnectionParameters connectionParameters)
Checks the connection parameters for equality. The implementation should not make any class match checks in this method because an IConnection instance extends this.

It is a requirement that, if a connection is outbound ( IConnection.isOutbound()) and based on these parameters, parameters.isEqual(connection) is true.

 IConnectionParameters parameters = ...
 broker.connect(parameters);
 IConnection connection = ... // connection created by the broker 
 // this will be true
 parameters.isEqual(connection);
 

Parameters:
connectionParameters - the other set of connection parameters to compare with this
Returns:
true if the two parameters represent the same connection attributes


Copyright © 2007-2009. All Rights Reserved.