org.jboss.remoting.transport.coyote
Class CoyoteInvoker

java.lang.Object
  extended by org.jboss.remoting.AbstractInvoker
      extended by org.jboss.remoting.ServerInvoker
          extended by org.jboss.remoting.transport.web.WebServerInvoker
              extended by org.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).


Nested Class Summary
 
Nested classes/interfaces inherited from class org.jboss.remoting.transport.web.WebServerInvoker
WebServerInvoker.CreatedInvocationRequest
 
Nested classes/interfaces inherited from class org.jboss.remoting.ServerInvoker
ServerInvoker.InvalidStateException
 
Nested classes/interfaces inherited from class org.jboss.remoting.AbstractInvoker
AbstractInvoker.CallbackLocatorHolder
 
Field Summary
protected static java.lang.Boolean FALSE
           
protected  boolean isRemotingUserAgent
          Indicates if client is HTTPClientInvoker
protected  org.apache.coyote.ProtocolHandler protocolHandler
           
protected static java.lang.ThreadLocal receivedInvocationRequest
          Indicates if input was raw or an InvocationRequest
protected static java.lang.Boolean TRUE
           
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
BLOCKING, BLOCKING_MODE, BLOCKING_TIMEOUT, callbackHandlers, CLIENT_CONNECT_ADDRESS_KEY, CLIENT_CONNECT_PORT_KEY, CLIENT_LEASE_PERIOD, clientCallbackListener, CONNECTION_LISTENER, connectionNotifier, DEFAULT_BLOCKING_TIMEOUT, DEFAULT_CLIENT_LEASE_PERIOD, DEFAULT_TIMEOUT_PERIOD, handlers, INVOKER_SESSION_ID, MAX_NUM_ONEWAY_THREADS, MAX_NUM_ONEWAY_THREADS_KEY, MAX_ONEWAY_THREAD_POOL_QUEUE_SIZE, NONBLOCKING, ONEWAY_THREAD_POOL_CLASS_KEY, REGISTER_CALLBACK_LISTENER, registerCallbackListeners, SERVER_BIND_ADDRESS_KEY, SERVER_BIND_PORT_KEY, SERVER_SOCKET_FACTORY, serverSocketFactory, singleCallbackContainer, singleHandler, started, TIMEOUT, useClientConnectionIdentity
 
Fields inherited from class org.jboss.remoting.AbstractInvoker
classbyteloader, configuration, localServerLocators, locator, passConfigMapToMarshalFactory, serializationType, socketFactory, socketFactoryCreatedFromSSLParameters
 
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, assignPort, create, createServerSocketFactory, destroy, findInvocationHandler, getClientConnectAddress, getClientConnectPort, getConfiguration, getConnectionNotifier, getDataType, getInvocationHandler, getInvocationHandlers, getLease, getLeasePeriod, getMaxNumberOfOnewayThreads, getMBeanObjectName, getMBeanServer, getOnewayThreadPool, getServerBindAddress, getServerBindPort, getServerSocketFactory, getSupportedSubsystems, getTimeout, handleInternalInvocation, hasInvocationHandler, invoke, invoke, isLeaseActivated, isRegisterCallbackListeners, isStarted, isUseClientConnectionIdentity, justNeedsSSLClientMode, postProcess, preProcess, removeCallbackHandler, removeCallbackListener, removeConnectionListener, removeInvocationHandler, setClientConnectAddress, setClientConnectPort, setConfiguration, setConnectionListener, setLeasePeriod, setMaxNumberOfOnewayThreads, setMBeanServer, setOnewayThreadPool, setRegisterCallbackListeners, setServerSocketFactory, setTimeout, setUseClientConnectionIdentity, shutdownCallbackHandler, wrapServerSocketFactory
 
Methods inherited from class org.jboss.remoting.AbstractInvoker
addClientLocator, createSocketFactory, getClassLoader, getClientLocator, getClientLocators, getLocator, getSerializationType, getSocketFactory, isCompleteSocketFactory, isSocketFactoryCreatedFromSSLParameters, needsCustomSSLConfiguration, setClassLoader, setSerializationType, setSocketFactory, wrapSocketFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

receivedInvocationRequest

protected static java.lang.ThreadLocal receivedInvocationRequest
Indicates if input was raw or an InvocationRequest


FALSE

protected static final java.lang.Boolean FALSE

TRUE

protected static final java.lang.Boolean TRUE

protocolHandler

protected org.apache.coyote.ProtocolHandler protocolHandler

URIEncoding

protected java.lang.String URIEncoding

isRemotingUserAgent

protected boolean isRemotingUserAgent
Indicates if client is HTTPClientInvoker

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()
                                                               throws java.io.IOException
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
Throws:
java.io.IOException

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.