org.sblim.cimclient.internal.http
Class HttpServerConnection

java.lang.Object
  extended by org.sblim.cimclient.internal.http.HttpServerConnection
All Implemented Interfaces:
java.lang.Runnable

public class HttpServerConnection
extends java.lang.Object
implements java.lang.Runnable

Class HttpServerConnection implements the outer shell of a HTTP server. It accepts incoming connections and puts them in a queue to be serviced by an independent thread


Constructor Summary
HttpServerConnection(HttpConnectionHandler pHandler, java.lang.String pLocalAddress, int pPort, boolean pSsl, WBEMConfiguration pProperties)
          Ctor.
 
Method Summary
 void close()
          Closes the socket and shuts down the listening threads
 java.lang.String getLocalHostName()
          Returns the local hostname the socket is bound to
 java.lang.String getLocalIp()
          Returns the local ip address the socket is bound to
 int getPort()
          Returns the port
 boolean isSSL()
          Return whether this connection is SSL secured
 void run()
           
 void setName(java.lang.String pName)
          Set the name of the thread
 void start()
          Starts a thread that waits for incoming connections
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpServerConnection

public HttpServerConnection(HttpConnectionHandler pHandler,
                            java.lang.String pLocalAddress,
                            int pPort,
                            boolean pSsl,
                            WBEMConfiguration pProperties)
                     throws java.io.IOException
Ctor.

Parameters:
pHandler - The connection handler
pLocalAddress - The local address to bind the port to. If null the port is bound to all local addresses. For use on multi-homed systems
pPort - The local port. If zero any free port will be chosen.
pSsl - SSL secured connection ?
pProperties - The configuration context
Throws:
java.io.IOException
Method Detail

setName

public void setName(java.lang.String pName)
Set the name of the thread

Parameters:
pName - The new value

getPort

public int getPort()
Returns the port

Returns:
The port

getLocalIp

public java.lang.String getLocalIp()
                            throws java.net.UnknownHostException
Returns the local ip address the socket is bound to

Returns:
The ip address
Throws:
java.net.UnknownHostException

getLocalHostName

public java.lang.String getLocalHostName()
                                  throws java.net.UnknownHostException
Returns the local hostname the socket is bound to

Returns:
The host name
Throws:
java.net.UnknownHostException

isSSL

public boolean isSSL()
Return whether this connection is SSL secured

Returns:
true if SSL is enabled, false otherwise

start

public void start()
Starts a thread that waits for incoming connections


run

public void run()
Specified by:
run in interface java.lang.Runnable

close

public void close()
Closes the socket and shuts down the listening threads



Copyright © 2005, 2009 IBM Corporation. All Rights Reserved.