org.exolab.jms.net.socket
Class SocketEndpoint

java.lang.Object
  |
  +--org.exolab.jms.net.socket.SocketEndpoint
All Implemented Interfaces:
Endpoint

public class SocketEndpoint
extends java.lang.Object
implements Endpoint

Adapts a Socket to the Endpoint interface.

Version:
$Revision: 1.2 $ $Date: 2005/03/18 04:11:33 $
Author:
Tim Anderson

Constructor Summary
SocketEndpoint(java.lang.String scheme, java.net.Socket socket)
          Construct a new SocketEndpoint.
 
Method Summary
 void close()
          Closes the endpoint
 java.io.InputStream getInputStream()
          Returns an input stream that reads from this endpoint
 java.io.OutputStream getOutputStream()
          Returns an output stream that writes to this endpoint
 URI getURI()
          Returns the URI that the endpoint is connected to
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SocketEndpoint

public SocketEndpoint(java.lang.String scheme,
                      java.net.Socket socket)
               throws java.io.IOException
Construct a new SocketEndpoint.
Parameters:
scheme - the URI scheme
socket - the underlying socket
Throws:
java.io.IOException - for any I/O error
Method Detail

getURI

public URI getURI()
Returns the URI that the endpoint is connected to
Specified by:
getURI in interface Endpoint
Returns:
the URI that the endpoint is connected to

getInputStream

public java.io.InputStream getInputStream()
Returns an input stream that reads from this endpoint
Specified by:
getInputStream in interface Endpoint
Returns:
an input stream that reads from this endpoint

getOutputStream

public java.io.OutputStream getOutputStream()
Returns an output stream that writes to this endpoint
Specified by:
getOutputStream in interface Endpoint
Returns:
an output stream that writes to this endpoint

close

public void close()
           throws java.io.IOException
Closes the endpoint
Specified by:
close in interface Endpoint
Throws:
java.io.IOException - if an I/O error occurs while closing the endpoint


Copyright © 1999-2007 The OpenJMS Group. All Rights Reserved.