xmlBlaster 2.1.0 API

org.xmlBlaster.util.http
Class HttpIORServer

java.lang.Object
  extended by java.lang.Thread
      extended by org.xmlBlaster.util.http.HttpIORServer
All Implemented Interfaces:
java.lang.Runnable, I_HttpRequest

public class HttpIORServer
extends java.lang.Thread
implements I_HttpRequest

Delivering the Authentication Service IOR over HTTP.

This tiny HTTP server is always running in the xmlBlaster server on the default bootstrapPort 3412.
Clients may access through this bootstrap port the AuthServer IOR if they don't want to use a naming service

You may specify on command line -bootstrapPort and -bootstrapHostname to choose another bootstrap port or to choose a server IP address on multi homed hosts.

Change code to be a generic HTTP server, not only for CORBA bootstrapping

Version:
$Revision: 1.31 $
Author:
$Author: ruff $

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
private  java.lang.String fishMimeType
           
private  java.lang.String fishRequestFile
           
private  java.lang.String fishRequestUrlPath
           
private  Global glob
           
private  int HTTP_PORT
           
private  java.lang.String icoMimeType
           
private  java.lang.String icoRequestFile
           
private  java.lang.String icoRequestUrlPath
           
private  java.lang.String ip_addr
           
private  java.util.Hashtable knownRequests
           
private  java.net.ServerSocket listen
           
private static java.util.logging.Logger log
           
private  java.lang.String ME
           
private  boolean running
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
HttpIORServer(Global glob, java.lang.String ip_addr, int port)
          Create a little web server.
 
Method Summary
 java.lang.String getSocketInfo()
          Access the server settings for logging.
 void registerRequest(java.lang.String urlPath, I_HttpRequest cb)
          If you want to provide some information over http, register it here.
 void registerRequest(java.lang.String urlPath, java.lang.String data)
          If you want to provide some information over http, register it here.
 void removeRequest(I_HttpRequest cb)
          Unregister your http listener.
 void removeRequest(java.lang.String urlPath)
          Unregister your http listener.
 void run()
           
 HttpResponse service(java.lang.String urlPath, java.util.Map properties)
          A HTTP request needs to be processed
 void shutdown()
          Close the listener port
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ME

private java.lang.String ME

glob

private final Global glob

log

private static java.util.logging.Logger log

ip_addr

private java.lang.String ip_addr

HTTP_PORT

private final int HTTP_PORT

listen

private java.net.ServerSocket listen

running

private boolean running

icoMimeType

private java.lang.String icoMimeType

icoRequestFile

private java.lang.String icoRequestFile

icoRequestUrlPath

private java.lang.String icoRequestUrlPath

fishMimeType

private java.lang.String fishMimeType

fishRequestFile

private java.lang.String fishRequestFile

fishRequestUrlPath

private java.lang.String fishRequestUrlPath

knownRequests

private java.util.Hashtable knownRequests
Constructor Detail

HttpIORServer

public HttpIORServer(Global glob,
                     java.lang.String ip_addr,
                     int port)
Create a little web server.

Parameters:
ip_addr - The string representation like "192.168.1.1", useful if multihomed computer
bootstrapPort - The bootstrap port where we publish the IOR
Method Detail

registerRequest

public void registerRequest(java.lang.String urlPath,
                            java.lang.String data)
If you want to provide some information over http, register it here.

Parameters:
urlPath - The access path which the client uses to access your data, for example "/AuthenticationService.ior"
data - The data you want to deliver to the client e.g. the CORBA IOR string

registerRequest

public void registerRequest(java.lang.String urlPath,
                            I_HttpRequest cb)
If you want to provide some information over http, register it here.

Parameters:
urlPath - The access path which the client uses to access your data, for example "/monitor/index.html" or "/favicon.ico"
data - The data you want to deliver to the client e.g. the CORBA IOR string

removeRequest

public void removeRequest(java.lang.String urlPath)
Unregister your http listener.

Parameters:
urlPath - The access path which the client uses to access your data for example "/monitor/index.html" or "/favicon.ico"

removeRequest

public void removeRequest(I_HttpRequest cb)
Unregister your http listener.

Parameters:
cb - Remove all registered pathes of this registrar. for example "/monitor/index.html" or "/favicon.ico"

run

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

shutdown

public void shutdown()
Close the listener port


service

public HttpResponse service(java.lang.String urlPath,
                            java.util.Map properties)
A HTTP request needs to be processed

Specified by:
service in interface I_HttpRequest
Parameters:
urlPath - The url path like "/monitor" which triggered this call
properties - The key values from the browser
Returns:
The HTML page to return

getSocketInfo

public java.lang.String getSocketInfo()
Access the server settings for logging.

Returns:
The socket :, for example "server.xmlBlaster.org:3412"

xmlBlaster 2.1.0 API

Copyright © 1999-2011 The xmlBlaster.org contributers.