com.caucho.server.dispatch
Class DispatchServer

java.lang.Object
  extended by com.caucho.server.dispatch.DispatchServer
All Implemented Interfaces:
Dependency
Direct Known Subclasses:
ProtocolDispatchServer

public class DispatchServer
extends java.lang.Object
implements Dependency

The dispatch server is responsible for building Invocations, specifically for creating the FilterChain for the invocation.


Constructor Summary
DispatchServer()
           
 
Method Summary
 void addServerListener(ServerListener listener)
          Adds a listener.
 Invocation buildInvocation(Invocation invocation)
          Builds the invocation.
 Invocation buildInvocation(java.lang.Object protocolKey, Invocation invocation)
          Builds the invocation, saving its value keyed by the protocol key.
 void clearCache()
          Clears the proxy cache.
 Invocation createInvocation()
          Creates an invocation.
 InvocationDecoder createInvocationDecoder()
          Returns the invocation decoder for configuration.
 void destroy()
          Closes the server.
 java.lang.Object getAttribute(java.lang.String key)
          Returns the named attribute.
 java.util.Iterator getAttributeNames()
          Returns an iteration of attribute names.
 java.lang.ClassLoader getClassLoader()
          Gets the class loader.
 DispatchBuilder getDispatchBuilder()
          Gets the dispatch builder.
 Invocation getInvocation(java.lang.Object protocolKey)
          Returns the cached invocation.
 long getInvocationCacheHitCount()
          Returns the invocation cache hit count.
 long getInvocationCacheMissCount()
          Returns the invocation cache hit count.
 InvocationDecoder getInvocationDecoder()
          Returns the InvocationDecoder.
 java.util.ArrayList<Invocation> getInvocations()
          Returns the invocations.
 java.lang.String getServerId()
          Gets the server's id.
 java.lang.String getURLCharacterEncoding()
          Sets URL encoding.
 void init()
          Initializes the server.
protected  void invalidateMatchingInvocations(InvocationMatcher matcher)
          Clears matching entries.
 boolean isDestroyed()
          Returns true if the server is destroyed.
 boolean isIgnoreClientDisconnect()
          Return true for ignoring client disconnect.
 boolean isModified()
          Returns true if the server has been modified and needs restarting.
 boolean logModified(java.util.logging.Logger log)
          Log the reason for modification.
 java.lang.Object removeAttribute(java.lang.String key)
          Removes the named attribute.
 void restart()
          Closes the server.
 java.lang.Object setAttribute(java.lang.String key, java.lang.Object value)
          Sets the named attribute.
 void setDispatchBuilder(DispatchBuilder builder)
          Sets the dispatch builder.
 void setInvocationCacheMaxURLLength(int length)
          Sets the max url length.
 void setInvocationCacheSize(int size)
          Sets the invocation cache size.
 void setServerId(java.lang.String serverId)
          Gets the server's id.
 void update()
          Closes the server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DispatchServer

public DispatchServer()
Method Detail

getServerId

public java.lang.String getServerId()
Gets the server's id.


setServerId

public void setServerId(java.lang.String serverId)
Gets the server's id.


getClassLoader

public java.lang.ClassLoader getClassLoader()
Gets the class loader.


setDispatchBuilder

public void setDispatchBuilder(DispatchBuilder builder)
Sets the dispatch builder.


getDispatchBuilder

public DispatchBuilder getDispatchBuilder()
Gets the dispatch builder.


isIgnoreClientDisconnect

public boolean isIgnoreClientDisconnect()
Return true for ignoring client disconnect.


setInvocationCacheSize

public void setInvocationCacheSize(int size)
Sets the invocation cache size.


setInvocationCacheMaxURLLength

public void setInvocationCacheMaxURLLength(int length)
Sets the max url length.


init

public void init()
Initializes the server.


getInvocationDecoder

public InvocationDecoder getInvocationDecoder()
Returns the InvocationDecoder.


getURLCharacterEncoding

public java.lang.String getURLCharacterEncoding()
Sets URL encoding.


createInvocationDecoder

public InvocationDecoder createInvocationDecoder()
Returns the invocation decoder for configuration.


getInvocation

public final Invocation getInvocation(java.lang.Object protocolKey)
Returns the cached invocation.


createInvocation

public Invocation createInvocation()
Creates an invocation.


buildInvocation

public Invocation buildInvocation(java.lang.Object protocolKey,
                                  Invocation invocation)
                           throws java.lang.Throwable
Builds the invocation, saving its value keyed by the protocol key.

Parameters:
protocolKey - protocol-specific key to save the invocation in
invocation - the invocation to build.
Throws:
java.lang.Throwable

buildInvocation

public Invocation buildInvocation(Invocation invocation)
                           throws java.lang.Throwable
Builds the invocation.

Throws:
java.lang.Throwable

clearCache

public void clearCache()
Clears the proxy cache.


invalidateMatchingInvocations

protected void invalidateMatchingInvocations(InvocationMatcher matcher)
Clears matching entries.


getInvocations

public java.util.ArrayList<Invocation> getInvocations()
Returns the invocations.


getInvocationCacheHitCount

public long getInvocationCacheHitCount()
Returns the invocation cache hit count.


getInvocationCacheMissCount

public long getInvocationCacheMissCount()
Returns the invocation cache hit count.


getAttribute

public java.lang.Object getAttribute(java.lang.String key)
Returns the named attribute.

Parameters:
key - the attribute key
Returns:
the attribute value

getAttributeNames

public java.util.Iterator getAttributeNames()
Returns an iteration of attribute names.

Returns:
the iteration of names

setAttribute

public java.lang.Object setAttribute(java.lang.String key,
                                     java.lang.Object value)
Sets the named attribute.

Parameters:
key - the attribute key
value - the attribute value
Returns:
the old attribute value

removeAttribute

public java.lang.Object removeAttribute(java.lang.String key)
Removes the named attribute.

Parameters:
key - the attribute key
Returns:
the old attribute value

isModified

public boolean isModified()
Returns true if the server has been modified and needs restarting.

Specified by:
isModified in interface Dependency

logModified

public boolean logModified(java.util.logging.Logger log)
Log the reason for modification.

Specified by:
logModified in interface Dependency

addServerListener

public void addServerListener(ServerListener listener)
Adds a listener.


isDestroyed

public boolean isDestroyed()
Returns true if the server is destroyed.


update

public void update()
Closes the server.


restart

public void restart()
Closes the server.


destroy

public void destroy()
Closes the server.