ch.ethz.iks.r_osgi.channels
Interface NetworkChannelFactory


public interface NetworkChannelFactory

Interface for services that create transport channel implementations. Must not necessarily be an OSGi service factory, since this service is only used by the R-OSGi bundle.

Since:
0.6
Author:
Jan S. Rellermeyer, ETH Zurich

Field Summary
static java.lang.String PROTOCOL_PROPERTY
          this constant should be set in the properties.
 
Method Summary
 void activate(Remoting remoting)
          activate the network channel factory.
 void deactivate(Remoting remoting)
          deactivate the network channel factory.
 NetworkChannel getConnection(ChannelEndpoint endpoint, URI endpointURI)
          get a new connection to a remote OSGi framework.
 int getListeningPort(java.lang.String protocol)
          return the port number on which the factory listens for incoming connections.
 

Field Detail

PROTOCOL_PROPERTY

static final java.lang.String PROTOCOL_PROPERTY
this constant should be set in the properties. The String set to this property is matched with the protocol argument that client bundles requesting for connections. Can also be a String[].

See Also:
Constant Field Values
Method Detail

getConnection

NetworkChannel getConnection(ChannelEndpoint endpoint,
                             URI endpointURI)
                             throws java.io.IOException
get a new connection to a remote OSGi framework.

Parameters:
endpoint - the channel endpoint.
endpointURI - the endpoint to connect to.
Returns:
a new transport channel that is typically already connected to the endpoint and ready to send messages.
Throws:
java.io.IOException - in case of connection errors.

activate

void activate(Remoting remoting)
              throws java.io.IOException
activate the network channel factory. Called by R-OSGi.

Parameters:
remoting -
Throws:
java.io.IOException

deactivate

void deactivate(Remoting remoting)
                throws java.io.IOException
deactivate the network channel factory. Called by R-OSGi.

Parameters:
remoting -
Throws:
java.io.IOException

getListeningPort

int getListeningPort(java.lang.String protocol)
return the port number on which the factory listens for incoming connections.

Parameters:
protocol - the protocol, important if the factory can create channels for multiple protocols, e.g., "http" and "https".
Returns:
the port number.


Copyright © 2009 IKS, ETH Zurich. All Rights Reserved.