org.exolab.core.http
Class HttpClient

java.lang.Object
  extended by org.exolab.core.http.HttpClient
All Implemented Interfaces:
IpcIfc

public class HttpClient
extends java.lang.Object
implements IpcIfc


Constructor Summary
HttpClient(java.lang.String url, java.lang.String label)
          Creates an HttpClient Object.
 
Method Summary
 void close()
          Implementation of IpcIfc.close the channel.
 java.net.URL getURL()
          Return the server URL
 java.lang.Object receive()
          Return the value of any send reply.
 void send(java.io.Serializable ob)
          Send the specified object.
 void send(java.io.Serializable ob, java.lang.String host, java.lang.String port)
          Send the specified object.
 void sendWithoutResponse(java.io.Serializable ob)
          Send the specified object.
 void sendWithoutResponse(java.io.Serializable ob, java.lang.String host, java.lang.String port)
          Send the specified object.
 java.lang.String toString()
          Returns a unique id for this connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HttpClient

public HttpClient(java.lang.String url,
                  java.lang.String label)
           throws java.net.MalformedURLException
Creates an HttpClient Object. No connection occurs at this point, just some initialisation.

Parameters:
url - The URL of the server hosting the OpenJMS servlet.
label - An id for this client.
Throws:
java.net.MalformedURLException - if url syntax is incorrect.
Method Detail

close

public void close()
           throws java.io.IOException
Implementation of IpcIfc.close the channel.

Specified by:
close in interface IpcIfc
Throws:
java.io.IOException

send

public void send(java.io.Serializable ob,
                 java.lang.String host,
                 java.lang.String port)
          throws java.io.IOException
Send the specified object.

Parameters:
ob - The object to send. Must be serializable.
Throws:
java.io.IOException - If the data fails to write to the output stream.

send

public void send(java.io.Serializable ob)
          throws java.io.IOException
Send the specified object.

Specified by:
send in interface IpcIfc
Parameters:
ob - The object to send. Must be serializable.
Throws:
java.io.IOException - If the data fails to write to the output stream.

sendWithoutResponse

public void sendWithoutResponse(java.io.Serializable ob)
                         throws java.io.IOException
Send the specified object. No response is expected by the client.

Parameters:
ob - The object to send. Must be serializable.
Throws:
java.io.IOException - If the data fails to write to the output stream.

sendWithoutResponse

public void sendWithoutResponse(java.io.Serializable ob,
                                java.lang.String host,
                                java.lang.String port)
                         throws java.io.IOException
Send the specified object. No response is expected by the client.

Parameters:
ob - The object to send. Must be serializable.
Throws:
java.io.IOException - If the data fails to write to the output stream.

receive

public java.lang.Object receive()
Return the value of any send reply.

Specified by:
receive in interface IpcIfc
Returns:
the response

getURL

public java.net.URL getURL()
Return the server URL


toString

public java.lang.String toString()
Returns a unique id for this connection.

Specified by:
toString in interface IpcIfc
Overrides:
toString in class java.lang.Object
Returns:
the id of this connection


Copyright © 1999-2012 The Exolab Group. All Rights Reserved.