|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.globus.wsrf.container.ServiceDispatcher
public class ServiceDispatcher
Dispatcher reading requests off the socket and putting them into a request queue.
| Field Summary | |
|---|---|
private java.lang.String |
configDir
|
private java.lang.String |
configProfile
|
protected org.apache.axis.server.AxisServer |
engine
|
private java.lang.String |
homeDir
|
(package private) static org.globus.util.I18n |
i18n
|
protected java.lang.ClassLoader |
loader
|
(package private) static org.apache.commons.logging.Log |
logger
|
protected org.apache.axis.MessageContext |
msgContext
|
protected java.util.Map |
properties
|
protected ServiceRequestQueue |
queue
|
private java.util.LinkedList |
registerQueue
|
protected Semaphore |
reloadLock
|
private java.nio.channels.Selector |
selector
|
private Semaphore |
semaphore
|
private java.net.ServerSocket |
serverSocket
|
private boolean |
stopped
|
protected ServiceThreadPool |
threadPool
|
private UsageConfig |
usageConfig
|
private java.lang.Thread |
worker
|
| Constructor Summary | |
|---|---|
protected |
ServiceDispatcher()
|
|
ServiceDispatcher(java.util.Map properties)
|
| Method Summary | |
|---|---|
protected void |
addRegisterRequest(ServiceRequest request)
|
private int |
addThread()
|
private void |
bindServerSocket(java.lang.String bindAddress,
int port)
|
protected static void |
cleanCaches(java.lang.ClassLoader loader)
|
protected void |
clearRegisterRequests()
|
private static void |
clearSoftCache(java.lang.Class clazz,
java.lang.String fieldName)
Workaround for a bug related to: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6232010 |
private void |
closeServerSocket()
|
protected org.apache.axis.MessageContext |
createMessageContext()
|
private java.lang.ClassLoader |
createServiceClassLoader()
|
org.apache.axis.AxisEngine |
getAxisEngine()
|
private static int |
getOptionAsInt(ContainerConfig config,
java.lang.String property,
int defaultValue)
|
java.net.ServerSocket |
getServerSocket()
|
protected java.lang.ClassLoader |
getServiceClassLoader()
|
ServiceRequestQueue |
getServiceRequestQueue()
|
ServiceThreadPool |
getServiceThreadPool()
|
protected boolean |
hasServiceThread(java.lang.Thread thread)
|
protected void |
init()
|
private void |
initialize()
|
protected void |
initServerSocket()
|
boolean |
isReloadable()
Returns true if container reloading is enabled, false otherwise. |
boolean |
isReloading()
Returns true if container is currently reloading, false otherwise. |
boolean |
isStopped()
|
protected void |
preformReload(ReloadAction action,
int timeout)
|
private void |
processRegisterRequests()
|
void |
reload(ReloadAction action,
int timeout)
Tells the container to reload its services. |
private void |
removeThread()
|
void |
run()
|
protected void |
setupThreadPool()
|
void |
start(boolean daemon)
Start this dispatcher. |
private void |
startServices()
|
void |
stop()
|
private void |
stopServices()
|
void |
waitForInit()
|
void |
waitForStop()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
static org.apache.commons.logging.Log logger
static org.globus.util.I18n i18n
private volatile java.lang.Thread worker
private volatile boolean stopped
private java.net.ServerSocket serverSocket
private java.nio.channels.Selector selector
private Semaphore semaphore
private java.util.LinkedList registerQueue
protected ServiceRequestQueue queue
protected ServiceThreadPool threadPool
protected org.apache.axis.server.AxisServer engine
protected org.apache.axis.MessageContext msgContext
protected java.util.Map properties
protected java.lang.ClassLoader loader
protected Semaphore reloadLock
private java.lang.String homeDir
private java.lang.String configDir
private java.lang.String configProfile
private UsageConfig usageConfig
| Constructor Detail |
|---|
protected ServiceDispatcher()
public ServiceDispatcher(java.util.Map properties)
throws java.lang.Exception
java.lang.Exception| Method Detail |
|---|
private void initialize()
throws org.apache.axis.ConfigurationException,
java.io.IOException
org.apache.axis.ConfigurationException
java.io.IOExceptionprotected org.apache.axis.MessageContext createMessageContext()
protected java.lang.ClassLoader getServiceClassLoader()
private java.lang.ClassLoader createServiceClassLoader()
throws java.io.IOException
java.io.IOExceptionpublic boolean isReloadable()
public boolean isReloading()
public void reload(ReloadAction action,
int timeout)
throws ContainerException
action - an action to perform after the services are shutdown but
before a new services classloader is obtained.timeout - the maximum amount of time to wait for each
service thread to finish processing its request (if any)
before reloading.
ContainerException - if reloading is not supported or reloading
fails.
ReloadActionException - if reload action fails
AlreadyReloadingException - if reloading is already under way.protected static void cleanCaches(java.lang.ClassLoader loader)
private static void clearSoftCache(java.lang.Class clazz,
java.lang.String fieldName)
protected void preformReload(ReloadAction action,
int timeout)
throws ContainerException
ContainerException
protected void initServerSocket()
throws java.io.IOException
java.io.IOException
protected void init()
throws java.lang.Exception
java.lang.Exception
protected void setupThreadPool()
throws java.lang.Exception
java.lang.Exceptionprotected void addRegisterRequest(ServiceRequest request)
protected void clearRegisterRequests()
private void processRegisterRequests()
public org.apache.axis.AxisEngine getAxisEngine()
public java.net.ServerSocket getServerSocket()
public ServiceThreadPool getServiceThreadPool()
public ServiceRequestQueue getServiceRequestQueue()
private static int getOptionAsInt(ContainerConfig config,
java.lang.String property,
int defaultValue)
public void run()
run in interface java.lang.Runnable
public void waitForInit()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void waitForStop()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionprivate int addThread()
private void removeThread()
protected boolean hasServiceThread(java.lang.Thread thread)
public void stop()
throws java.io.IOException
java.io.IOExceptionpublic boolean isStopped()
private void stopServices()
private void startServices()
throws java.lang.Exception
java.lang.Exception
private void closeServerSocket()
throws java.io.IOException
java.io.IOException
private void bindServerSocket(java.lang.String bindAddress,
int port)
throws java.io.IOException
java.io.IOExceptionpublic void start(boolean daemon)
daemon - a boolean indicating if the thread should be a daemon.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||