org.jboss.remoting.transport.http
Class HTTPClientInvoker

java.lang.Object
  extended by org.jboss.remoting.AbstractInvoker
      extended by org.jboss.remoting.MicroRemoteClientInvoker
          extended by org.jboss.remoting.RemoteClientInvoker
              extended by org.jboss.remoting.transport.http.HTTPClientInvoker
All Implemented Interfaces:
Invoker, ClientInvoker
Direct Known Subclasses:
HTTPSClientInvoker

public class HTTPClientInvoker
extends RemoteClientInvoker

HTTP client invoker. Used for making http requests on http/servlet invoker.

Author:
Tom Elrod

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jboss.remoting.AbstractInvoker
AbstractInvoker.CallbackLocatorHolder
 
Field Summary
protected static org.jboss.logging.Logger log
           
static java.lang.String MAX_NUM_TIMEOUT_THREADS
          Key for the configuration map that determines the threadpool size for simulated timeouts when using jdk 1.4.
static int MAX_NUM_TIMEOUT_THREADS_DEFAULT
          Specifies the default number of work threads in the thread pool for simulating timeouts when using jdk 1.4.
static java.lang.String MAX_TIMEOUT_QUEUE_SIZE
          Key for the configuration map that determines the queue size for simulated timeout threadpool when using jdk 1.4.
static java.lang.String UNMARSHAL_NULL_STREAM
           
protected  boolean unmarshalNullStream
           
 
Fields inherited from class org.jboss.remoting.MicroRemoteClientInvoker
connected
 
Fields inherited from class org.jboss.remoting.AbstractInvoker
classbyteloader, configuration, localServerLocators, locator, passConfigMapToMarshalFactory, serializationType, socketFactory, socketFactoryCreatedFromSSLParameters
 
Constructor Summary
HTTPClientInvoker(InvokerLocator locator)
           
HTTPClientInvoker(InvokerLocator locator, java.util.Map configuration)
           
 
Method Summary
protected  void configureParameters()
           
protected  java.net.HttpURLConnection createURLConnection(java.lang.String url, java.util.Map metadata)
           
protected  java.lang.String getDefaultDataType()
          Each implementation of the remote client invoker should have a default data type that is uses in the case it is not specified in the invoker locator uri.
 org.jboss.util.threadpool.ThreadPool getTimeoutThreadPool()
          Gets the thread pool being used for simulating timeouts with jdk 1.4.
protected  void handleConnect()
          subclasses must implement this method to provide a hook to connect to the remote server, if this applies to the specific transport.
protected  void handleDisconnect()
          subclasses must implement this method to provide a hook to disconnect from the remote server, if this applies to the specific transport.
 void setTimeoutThreadPool(org.jboss.util.threadpool.ThreadPool pool)
          Sets the thread pool to be used for simulating timeouts with jdk 1.4.
protected  java.lang.Object transport(java.lang.String sessionId, java.lang.Object invocation, java.util.Map metadata, Marshaller marshaller, UnMarshaller unmarshaller)
           
protected  java.lang.String validateURL(java.lang.String url)
           
 
Methods inherited from class org.jboss.remoting.RemoteClientInvoker
useAllParams
 
Methods inherited from class org.jboss.remoting.MicroRemoteClientInvoker
connect, disconnect, establishLease, finalize, getLeasePeriod, getLeasePinger, getMarshaller, getSessionId, getUnMarshaller, init, invoke, isConnected, postProcess, preProcess, setMarshaller, setUnMarshaller, terminateLease, terminateLease
 
Methods inherited from class org.jboss.remoting.AbstractInvoker
addClientLocator, createSocketFactory, getClassLoader, getClientLocator, getClientLocators, getConfiguration, getLocator, getSerializationType, getSocketFactory, isCompleteSocketFactory, isSocketFactoryCreatedFromSSLParameters, needsCustomSSLConfiguration, setClassLoader, setSerializationType, setSocketFactory, wrapSocketFactory
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.remoting.transport.ClientInvoker
addClientLocator, getClientLocator, getClientLocators, getSocketFactory, setSocketFactory
 
Methods inherited from interface org.jboss.remoting.Invoker
getLocator
 

Field Detail

MAX_NUM_TIMEOUT_THREADS

public static final java.lang.String MAX_NUM_TIMEOUT_THREADS
Key for the configuration map that determines the threadpool size for simulated timeouts when using jdk 1.4.

See Also:
Constant Field Values

MAX_TIMEOUT_QUEUE_SIZE

public static final java.lang.String MAX_TIMEOUT_QUEUE_SIZE
Key for the configuration map that determines the queue size for simulated timeout threadpool when using jdk 1.4.

See Also:
Constant Field Values

MAX_NUM_TIMEOUT_THREADS_DEFAULT

public static final int MAX_NUM_TIMEOUT_THREADS_DEFAULT
Specifies the default number of work threads in the thread pool for simulating timeouts when using jdk 1.4.

See Also:
Constant Field Values

UNMARSHAL_NULL_STREAM

public static final java.lang.String UNMARSHAL_NULL_STREAM
See Also:
Constant Field Values

log

protected static final org.jboss.logging.Logger log

unmarshalNullStream

protected boolean unmarshalNullStream
Constructor Detail

HTTPClientInvoker

public HTTPClientInvoker(InvokerLocator locator)

HTTPClientInvoker

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

transport

protected java.lang.Object transport(java.lang.String sessionId,
                                     java.lang.Object invocation,
                                     java.util.Map metadata,
                                     Marshaller marshaller,
                                     UnMarshaller unmarshaller)
                              throws java.io.IOException,
                                     ConnectionFailedException
Specified by:
transport in class MicroRemoteClientInvoker
Parameters:
sessionId -
invocation -
marshaller -
Returns:
Throws:
java.io.IOException
ConnectionFailedException

validateURL

protected java.lang.String validateURL(java.lang.String url)

createURLConnection

protected java.net.HttpURLConnection createURLConnection(java.lang.String url,
                                                         java.util.Map metadata)
                                                  throws java.io.IOException
Throws:
java.io.IOException

handleConnect

protected void handleConnect()
                      throws ConnectionFailedException
subclasses must implement this method to provide a hook to connect to the remote server, if this applies to the specific transport. However, in some transport implementations, this may not make must difference since the connection is not persistent among invocations, such as SOAP. In these cases, the method should silently return without any processing.

Specified by:
handleConnect in class MicroRemoteClientInvoker
Throws:
ConnectionFailedException

handleDisconnect

protected void handleDisconnect()
subclasses must implement this method to provide a hook to disconnect from the remote server, if this applies to the specific transport. However, in some transport implementations, this may not make must difference since the connection is not persistent among invocations, such as SOAP. In these cases, the method should silently return without any processing.

Specified by:
handleDisconnect in class MicroRemoteClientInvoker

getDefaultDataType

protected java.lang.String getDefaultDataType()
Each implementation of the remote client invoker should have a default data type that is uses in the case it is not specified in the invoker locator uri.

Specified by:
getDefaultDataType in class MicroRemoteClientInvoker
Returns:

setTimeoutThreadPool

public void setTimeoutThreadPool(org.jboss.util.threadpool.ThreadPool pool)
Sets the thread pool to be used for simulating timeouts with jdk 1.4.


configureParameters

protected void configureParameters()

getTimeoutThreadPool

public org.jboss.util.threadpool.ThreadPool getTimeoutThreadPool()
Gets the thread pool being used for simulating timeouts with jdk 1.4. If one has not be specifically set via configuration or call to set it, will always return instance of org.jboss.util.threadpool.BasicThreadPool.



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