com.jproxy.proxy.servlet
Class HTTPTunnel

java.lang.Object
  extended bycom.jproxy.proxy.Tunnel
      extended bycom.jproxy.proxy.servlet.HTTPTunnel
All Implemented Interfaces:
java.lang.Runnable, java.io.Serializable

public class HTTPTunnel
extends Tunnel
implements java.lang.Runnable

Tunnel implementation. The class is responsible for client-side data marshalling and client-side object distribution protocol implementation. The class uses HTTP protocol for communication protocol layer.

See Also:
Serialized Form

Field Summary
static java.lang.String DEFAULT_TUNNEL_URL
           
 java.lang.Thread thread
           
 
Fields inherited from class com.jproxy.proxy.Tunnel
CALLBACK_INTERFACES, CALLBACK_ONE_WAY, CALLBACK_PENDING_TIME, CALLBACK_RECEIVER_TIMEOUT, CALLBACK_RETURN_RESULT, CALLBACK_TUNNEL_CLASS, CALLBACK_VALIDATE_RECEIVER, callbackTunnels, CLIENT_INVOCATION_INTERCEPTOR, CONCURRENT_CALLBACKS, DATASTACK_ENABLED, defaultSessionId, env, features, HOST_URL, INITIAL_CONTEXT_FACTORY, INPROCESS_CALL_OPTIMIZATION_ENABLED, INVOCATOR_THREADING_ENABLED, JAAS_CONFIGURATION_NAME, LOG_CLASS, LOG_LEVEL, LOW_VERSION, MAX_FAILOVER_ATTEMPTS, NATIVE_EXCEPTIONS_ENABLED, NETWORK_PERFORMANCE_THRESHOLD, NONREMOTE_CLASSES, NONREMOTE_INTERFACES, OBJECT_TTL, PROVIDER_URL, REMOTE_CLASSES, REMOTE_INTERFACES, SERVER_CLASSPATH, SERVER_INVOCATION_INTERCEPTOR, SOAP_INIT_ARGUMENTS, SOAP_URL_FROM_WSDL, SOCKET_TIMEOUT, STUB_REUSE_ENABLED, STUBGEN_CODEBASE_PATH_MAPPING, STUBGEN_COMPILER_OPTIONS, TIMEOUT_UPDATE_ENABLED, TUNNEL_CLASS, TUNNEL_URL, tunnels, USE_JPROXY_SSL_SOCKET_FACTORY, version, VERSION
 
Constructor Summary
HTTPTunnel(java.lang.Object[] args)
           
 
Method Summary
 void adjustSocketFactory(java.net.URLConnection con)
          The method gets invoked after URLConnection opening.
 CallbackClient getCallbackClient()
          The method returns CallbackClient object for enabling callbacks over HTTP The method creates server-side CallbackServer object that collects all callback requests, which then may be delivered by client request CallbackClient.popAll()
 java.lang.Object invoke(java.lang.Object data)
          The method marshales data and unmurshal result for remote call.
 boolean isCompressionInUse()
          Returns flag showing if compression for communication was used.
 void run()
           
 void setServerUrl(java.lang.String _serverUrlStr)
           
 
Methods inherited from class com.jproxy.proxy.Tunnel
createCallbackTunnel, createConstructRequest, createDestructRequest, createInvokeRequest, createReferenceRequest, createSessionRequest, createStaticInvokeRequest, createStubRequest, createTunnel, getConstructorParameters, getEventListener, getInstance, getServerUrl, getTimeout, init, invokeMethod, invokeRequest, invokeStaticMethod, invokeStaticMethod, loadProperties, newInstance, newInstance, newStub, removeInstance, setEventListener, setTimeout
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_TUNNEL_URL

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

thread

public transient java.lang.Thread thread
Constructor Detail

HTTPTunnel

public HTTPTunnel(java.lang.Object[] args)
Method Detail

invoke

public java.lang.Object invoke(java.lang.Object data)
                        throws TunnelException
The method marshales data and unmurshal result for remote call. The method is executed on the client that invokes method on remote object. The HTTP protocol is used for marshalling and unmarshalling. The method utilizes the compression for data sending and recieving Timeout may be used for HTTP requests.

Specified by:
invoke in class Tunnel
Parameters:
data - - Object instance that will be marshalled to TunnelServlet
Throws:
- - TunnelException
TunnelException

adjustSocketFactory

public void adjustSocketFactory(java.net.URLConnection con)
                         throws java.lang.Throwable
The method gets invoked after URLConnection opening. The method selects SSLProxySocketFactory according to folowing condition: Sun SSL is avalable AND HTTPS requested AND (timeout>0 OR communicating through proxy). The factory is instantiated per each URLConnection.

Throws:
- - Exception
java.lang.Throwable

run

public void run()
Specified by:
run in interface java.lang.Runnable

getCallbackClient

public CallbackClient getCallbackClient()
                                 throws java.lang.Throwable
The method returns CallbackClient object for enabling callbacks over HTTP The method creates server-side CallbackServer object that collects all callback requests, which then may be delivered by client request CallbackClient.popAll()

Specified by:
getCallbackClient in class Tunnel
Throws:
- - TunnelException
java.lang.Throwable

setServerUrl

public void setServerUrl(java.lang.String _serverUrlStr)
Overrides:
setServerUrl in class Tunnel

isCompressionInUse

public boolean isCompressionInUse()
Returns flag showing if compression for communication was used. Because the flag is dynamically determined by JProxy runtime, the flag is valid only after invoke method was called or after actual communication. The flag can be tested from custom implementation of IClientInvocationInterceptor

Returns:
flag telling if GZIP compression was used for last call.


Copyright © JProxy LLC. All Rights Reserved.