com.jproxy.proxy.servlet
Class ServletTunnel

java.lang.Object
  |
  +--com.jproxy.proxy.Tunnel
        |
        +--com.jproxy.proxy.servlet.ServletTunnel
All Implemented Interfaces:
java.lang.Runnable, java.io.Serializable

public class ServletTunnel
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
           
 HelperInputStream helperInputStream
           
 
Fields inherited from class com.jproxy.proxy.Tunnel
CALLBACK_PENDING_TIME, CALLBACK_TUNNEL_CLASS, callbackTunnels, COMPRESSION_ENABLED, DATASTACK_ENABLED, env, features, HOST_URL, INITIAL_CONTEXT_FACTORY, INVOCATION_INTERCEPTOR, INVOCATOR_THREADING_ENABLED, JAAS_CONFIGURATION_NAME, LOG_CLASS, LOG_LEVEL, MAX_FAILOVER_ATTEMPTS, NATIVE_EXCEPTIONS_ENABLED, NETWORK_PERFORMANCE_THRESHOLD, OBJECT_DESTROY_ENABLED, OBJECT_TTL, PROVIDER_URL, REMOTE_CLASSES, SERVER_RESPONSE_MIN, SOCKET_TIMEOUT, STUBGEN_CLASSPATH, STUBGEN_COMPILER_CLASSPATH, STUBGEN_COMPILER_OPTIONS, STUBGEN_LIB_CLASSPATH, TUNNEL_CLASS, TUNNEL_URL, tunnels, USE_JPROXY_SSL_SOCKET_FACTORY, version, VERSION
 
Constructor Summary
ServletTunnel(java.lang.String url)
          Constructs instance of ServletTunnel.
 
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.
 void run()
           
 
Methods inherited from class com.jproxy.proxy.Tunnel
createCallbackTunnel, createConstructRequest, createDestructRequest, createInvokeRequest, createReferenceRequest, createStubRequest, createTunnel, getInstance, getServerUrl, getTimeout, invokeMethod, invokeRequest, newInstance, newStub, parseBoolean, removeInstance, setServerUrl, 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

helperInputStream

public transient HelperInputStream helperInputStream
Constructor Detail

ServletTunnel

public ServletTunnel(java.lang.String url)
Constructs instance of ServletTunnel.
Parameters:
serverUrlStr - URL String of Tunneling server
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.
Overrides:
invoke in class Tunnel
Parameters:
data - - Object instance that will be marshalled to TunnelServlet
Throws:
- - 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.
Parameters:
data - - URLConnection
Throws:
- - Exception

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()
Overrides:
getCallbackClient in class Tunnel
Throws:
- - TunnelException


Copyright © JProxy LLC. All Rights Reserved.