org.jboss.remoting.transport.coyote
Class CoyoteInvoker

java.lang.Object
  extended byorg.jboss.remoting.AbstractInvoker
      extended byorg.jboss.remoting.ServerInvoker
          extended byorg.jboss.remoting.transport.web.WebServerInvoker
              extended byorg.jboss.remoting.transport.coyote.CoyoteInvoker
All Implemented Interfaces:
org.apache.coyote.Adapter, Invoker, ServerInvokerMBean

public class CoyoteInvoker
extends WebServerInvoker
implements org.apache.coyote.Adapter

Some of the code in this class was pulled from org.apache.coyote.tomcat4.CoyoteAdapter and hence will maintain the Apache License (and author credit from original source).


Field Summary
protected  org.apache.coyote.ProtocolHandler protocolHandler
           
protected  java.lang.String URIEncoding
           
 
Fields inherited from class org.jboss.remoting.transport.web.WebServerInvoker
HEADER_SESSION_ID, HEADER_SUBSYSTEM
 
Fields inherited from class org.jboss.remoting.ServerInvoker
callbackHandlers, CLIENT_CONNECT_ADDRESS_KEY, CLIENT_CONNECT_PORT_KEY, CLIENT_LEASE_PERIOD, clientCallbackListener, DEFAULT_CLIENT_LEASE_PERIOD, handlers, MAX_NUM_ONEWAY_THREADS, MAX_NUM_ONEWAY_THREADS_KEY, ONEWAY_THREAD_POOL_CLASS_KEY, SERVER_BIND_ADDRESS_KEY, SERVER_BIND_PORT_KEY, SERVER_SOCKET_FACTORY, TIMEOUT
 
Fields inherited from class org.jboss.remoting.AbstractInvoker
classbyteloader, configuration, localServerLocators, locator, log, serializationType
 
Constructor Summary
CoyoteInvoker(InvokerLocator locator)
           
CoyoteInvoker(InvokerLocator locator, java.util.Map configuration)
           
 
Method Summary
static java.lang.String capitalize(java.lang.String name)
          Reverse of Introspector.decapitalize
protected  void convertMB(org.apache.tomcat.util.buf.MessageBytes mb)
          Character conversion of the a US-ASCII MessageBytes.
protected  void convertURI(org.apache.tomcat.util.buf.MessageBytes uri, RequestMap request)
          Character conversion of the URI.
protected static void copyBytes(byte[] b, int dest, int src, int len)
          Copy an array of bytes to a different position.
protected  InvocationRequest createNewInvocationRequest(RequestMap requestMap, ResponseMap responseMap, java.lang.Object payload)
           
protected  javax.net.ServerSocketFactory getDefaultServerSocketFactory()
          Gets the default server socket factory to use for the server invoker.
static boolean normalize(org.apache.tomcat.util.buf.MessageBytes uriMB)
          Normalize URI.
protected  boolean postParseRequest(org.apache.coyote.Request req, RequestMap request, org.apache.coyote.Response res, ResponseMap response)
          Parse additional request parameters.
 void service(org.apache.coyote.Request req, org.apache.coyote.Response res)
          Service method.
static boolean setProperty(java.lang.Object o, java.lang.String name, java.lang.String value)
          Find a method with the right name If found, call the method ( if param is int or boolean we'll convert value to the right type before) - that means you can have setDebug(1).
protected  void setup()
           
 void start()
          subclasses should override to provide any specific start logic
 void stop()
          subclasses should override to provide any specific stop logic
 
Methods inherited from class org.jboss.remoting.transport.web.WebServerInvoker
createNewInvocationRequest, getContentLength, getDefaultDataType, getInvocationRequest, getMarshaller, getSessionId, getUnMarshaller, isTransportBiDirectional
 
Methods inherited from class org.jboss.remoting.ServerInvoker
addConnectionListener, addInvocationHandler, create, createServerSocketFactory, destroy, getClientConnectAddress, getClientConnectPort, getConfiguration, getDataType, getInvocationHandler, getInvocationHandlers, getLeasePeriod, getMaxNumberOfOnewayThreads, getMBeanObjectName, getMBeanServer, getOnewayThreadPool, getServerBindAddress, getServerBindPort, getServerSocketFactory, getSupportedSubsystems, getTimeout, hasInvocationHandler, invoke, invoke, isStarted, postProcess, preProcess, removeCallbackListener, removeConnectionListener, removeInvocationHandler, setClientConnectAddress, setClientConnectPort, setConfiguration, setLeasePeriod, setMaxNumberOfOnewayThreads, setMBeanServer, setOnewayThreadPool, setServerSocketFactory, setTimeout
 
Methods inherited from class org.jboss.remoting.AbstractInvoker
addClientLocator, getClassLoader, getClientLocator, getLocator, getSerializationType, setClassLoader, setSerializationType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

protocolHandler

protected org.apache.coyote.ProtocolHandler protocolHandler

URIEncoding

protected java.lang.String URIEncoding
Constructor Detail

CoyoteInvoker

public CoyoteInvoker(InvokerLocator locator)

CoyoteInvoker

public CoyoteInvoker(InvokerLocator locator,
                     java.util.Map configuration)
Method Detail

setup

protected void setup()
              throws java.lang.Exception
Overrides:
setup in class ServerInvoker
Throws:
java.lang.Exception

getDefaultServerSocketFactory

protected javax.net.ServerSocketFactory getDefaultServerSocketFactory()
Description copied from class: ServerInvoker
Gets the default server socket factory to use for the server invoker. The intention is this method will be overridden by sub-classes for their specific defaults.

Overrides:
getDefaultServerSocketFactory in class ServerInvoker
Returns:

start

public void start()
           throws java.io.IOException
Description copied from class: ServerInvoker
subclasses should override to provide any specific start logic

Specified by:
start in interface ServerInvokerMBean
Overrides:
start in class ServerInvoker
Throws:
java.io.IOException

service

public void service(org.apache.coyote.Request req,
                    org.apache.coyote.Response res)
             throws java.lang.Exception
Service method.

Specified by:
service in interface org.apache.coyote.Adapter
Throws:
java.lang.Exception

createNewInvocationRequest

protected InvocationRequest createNewInvocationRequest(RequestMap requestMap,
                                                       ResponseMap responseMap,
                                                       java.lang.Object payload)

postParseRequest

protected boolean postParseRequest(org.apache.coyote.Request req,
                                   RequestMap request,
                                   org.apache.coyote.Response res,
                                   ResponseMap response)
                            throws java.lang.Exception
Parse additional request parameters.

Throws:
java.lang.Exception

convertURI

protected void convertURI(org.apache.tomcat.util.buf.MessageBytes uri,
                          RequestMap request)
                   throws java.lang.Exception
Character conversion of the URI.

Throws:
java.lang.Exception

convertMB

protected void convertMB(org.apache.tomcat.util.buf.MessageBytes mb)
Character conversion of the a US-ASCII MessageBytes.


normalize

public static boolean normalize(org.apache.tomcat.util.buf.MessageBytes uriMB)
Normalize URI.

This method normalizes "\", "//", "/./" and "/../". This method will return false when trying to go above the root, or if the URI contains a null byte.

Parameters:
uriMB - URI to be normalized

copyBytes

protected static void copyBytes(byte[] b,
                                int dest,
                                int src,
                                int len)
Copy an array of bytes to a different position. Used during normalization.


stop

public void stop()
Description copied from class: ServerInvoker
subclasses should override to provide any specific stop logic

Specified by:
stop in interface ServerInvokerMBean
Overrides:
stop in class ServerInvoker

setProperty

public static boolean setProperty(java.lang.Object o,
                                  java.lang.String name,
                                  java.lang.String value)
Find a method with the right name If found, call the method ( if param is int or boolean we'll convert value to the right type before) - that means you can have setDebug(1).


capitalize

public static java.lang.String capitalize(java.lang.String name)
Reverse of Introspector.decapitalize



Copyright ? 1998-2005 JBoss Inc . All Rights Reserved.