com.sun.jmx.remote.generic
Interface SynchroMessageConnection

All Known Subinterfaces:
ClientSynchroMessageConnection, ServerSynchroMessageConnection
All Known Implementing Classes:
ClientSynchroMessageConnectionImpl, ServerSynchroMessageConnectionImpl

public interface SynchroMessageConnection

This interface specifies a set of common methods for sychronized connection between a client and a server.


Method Summary
 void close()
          Closes this connection.
 void connect(Map env)
          Establish the connection.
 String getConnectionId()
          Returns this connection identifier.
 void sendOneWay(Message msg)
          Sends a message to the remote side and does not need a response.
 

Method Detail

connect

void connect(Map env)
             throws IOException

Establish the connection. This method must be called before any other method of this interface. The behavior is unspecified if not.

Parameters:
env - the properties of the connection.
Throws:
IOException - if the connection cannot be made.

sendOneWay

void sendOneWay(Message msg)
                throws IOException,
                       UnsupportedOperationException
Sends a message to the remote side and does not need a response. This method can be implemented in different ways:

1) sends out the message and gets return at once. For example, if the underlying protocol is asynchronous.

2) sends out the message and is blocked until arrival of a response. For example, if the underlying protocol supports only synchronous communication.

3) throws UnsupportedOperationException to tell the caller that it is not supported by the implementation. For example, if the object is used on a server side and it is not mandatory for the server to send a request spontaneously.

Throws:
UnsupportedOperationException - thrown if the operation is not supported by an implementation.
IOException - if a message could not be sent because of a communication problem.

getConnectionId

String getConnectionId()
Returns this connection identifier.


close

void close()
           throws IOException
Closes this connection.

Throws:
IOException


Copyright © 2014 Terracotta, Inc.. All rights reserved.