ch.ethz.iks.r_osgi.channels
Interface NetworkChannel


public interface NetworkChannel

Interface for all transport channel classes. Implementations of this interface are typically returned by services that offer the TransportChannelFactory service.

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

Method Summary
 void bind(ChannelEndpoint endpoint)
          bind the network channel to a channel endpoint.
 void close()
          close the network channel.
 URI getLocalAddress()
          get the URI of the local address.
 java.lang.String getProtocol()
          get the protocol that this channel uses on the transport layer.
 URI getRemoteAddress()
          get the URI of the remote address.
 void sendMessage(RemoteOSGiMessage message)
          send a message through the channel.
 

Method Detail

getProtocol

java.lang.String getProtocol()
get the protocol that this channel uses on the transport layer.

Returns:
the protocol identifier as String. Should be in lowercase.
Since:
0.6

getRemoteAddress

URI getRemoteAddress()
get the URI of the remote address.

Returns:
the ID.

getLocalAddress

URI getLocalAddress()
get the URI of the local address.

Returns:
the ID.

bind

void bind(ChannelEndpoint endpoint)
bind the network channel to a channel endpoint.

Parameters:
endpoint - the channel endpoint.

close

void close()
           throws java.io.IOException
close the network channel.

Throws:
java.io.IOException - if something goes wrong.

sendMessage

void sendMessage(RemoteOSGiMessage message)
                 throws java.io.IOException
send a message through the channel.

Parameters:
message - the message to be sent.
Throws:
java.io.IOException - if the transport fails.
Since:
0.6


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