jrun.servlet.jrpp
Class JRunProxyService

jrunx.kernel.ServiceAdapter
  |
  +--jrunx.scheduler.ThreadPoolService
        |
        +--jrun.servlet.network.NetworkService
              |
              +--jrun.servlet.jrpp.JRunProxyService
All Implemented Interfaces:
JRunProxyInterface, JRunProxyServiceMBean, NetworkServiceMBean, javax.naming.Referenceable, RunnableFactory, java.io.Serializable, Service, ServiceMBean, ThreadPoolServiceMBean

public class JRunProxyService
extends NetworkService
implements JRunProxyServiceMBean, JRunProxyInterface

See Also:
Serialized Form

Field Summary
static java.lang.String SERVER_LOAD_ATTRIBUTE
           
 
Fields inherited from class jrun.servlet.network.NetworkService
BYTES_IN, BYTES_OUT, HANDLED_MS, HANDLED_RQ, metricsElapsedIndex, metricsIndexIn, metricsIndexOut, metricsServicedIndex, serverSocketFactory, ss
 
Fields inherited from class jrunx.scheduler.ThreadPoolService
metrics, threadPool
 
Fields inherited from class jrunx.kernel.ServiceAdapter
DEFAULT_DEACTIVATED, DEFAULT_DOMAIN, DOMAIN_NAME_SEPARATOR, DOMAIN_NAME_SUFFIX, domainName, jndiBindable, LOGGER_CACHE_TIME, SCHEDULER_SERVICE, SECURITY_MANAGER, server, status, TRANSACTION_MANAGER
 
Fields inherited from interface jrunx.kernel.Service
INITIALIZED, STARTED, STARTING, STOPPED, STOPPING, UNINITIALIZED
 
Fields inherited from interface jrunx.scheduler.RunnableFactory
BUSY, EXCEPTION, SHUTDOWN
 
Constructor Summary
JRunProxyService()
           
 
Method Summary
protected  java.net.Socket accept()
          Subclasses can override this to change the socket class or implement a different concurrency policy.
 java.lang.Runnable createRunnable()
          Returns an Runnable object by doing a protocol-specific accept or receive; the Runnable encapsulates an atomic unit of work.
 void destroy()
          Every service is eventually destroyed.
 void destroyRunnable(java.lang.Runnable r, int reason)
          destroy the given runnable.
 boolean getCacheRealPath()
          If true, the results from getRealPath() will be cached.
 JRunProxyClusterHelper getClusterHelper()
           
 int getClusterSequence()
           
 java.lang.String getLoadBalancingAlgorithm()
          Gets the loadbalancing algorithm
 int getMapCheck()
          Gets the time how often web server connector should refrehs mappings
 java.lang.String getMetricsPrefix()
          Gets the prefix to be used for metrics, such as "jcp" or "web".
 int getServerWeight()
          Gets the 'server weight' used in Weighted RoundRobin and Weighted Random RR
 java.lang.String getServiceName()
          Gets the service name, such as JRun Web Server.
 ServletEngine getServletEngine()
           
 java.lang.String getServletInfo()
           
 boolean getSSL()
          Returns whether or not SSL is enabled between the web server and the ProxyService
 java.lang.String getStickySessions()
          Gets whether or not connector load balancing will honour session stickyness
 void init()
          Not every service needs to init, implement it out of convenience.
 void invokeRunnable(java.lang.Runnable r)
          process this request.
 void setCacheRealPath(boolean cache)
          If true, the results from getRealPath() will be cached.
 void setClusterSequence(int seq)
           
 void setKeyStore(java.lang.String keyStore)
          Sets the keystore file name
 void setKeyStorePassword(java.lang.String keyStorePassword)
          Sets the keystore password
 void setLoadBalancingAlgorithm(java.lang.String algorithm)
          Sets the loadbalancing algorithm to use
 void setMapCheck(int time)
          Sets the time how ofter the web server connector will try to refresh mappings, in seconds, 0 if only do at startup
 void setServerWeight(int weight)
          Sets the 'server weight' used in Weighted RoundRobin and Weighted Random RR
 void setStickySessions(java.lang.String sticky)
          Sets whether or not connector load balancing will honour session stickyness
 void setTrustStore(java.lang.String trustStore)
          Sets the truststore file name
 void start()
          Every service other than mere data collections should start
 void stop()
          Every service other than mere data collections should stop
 java.lang.Runnable swapRunnable(java.lang.Runnable r)
          this is an alternative method for sourcing runnables, letting the runnable factory take care of creation and destruction of the runnable objects.
 
Methods inherited from class jrun.servlet.network.NetworkService
bindToSocket, createMetrics, getAvailablePort, getBacklog, getBindAddress, getInputMetricIndex, getInterface, getMetrics, getOutputMetricIndex, getPort, getRunnableFactory, getServicedMetricIndex, getSocketFactoryName, getTimeout, getTimeoutMs, setBacklog, setBindAddress, setInterface, setPort, setSocketFactoryName, setTimeout, updateRequestMetrics
 
Methods inherited from class jrunx.scheduler.ThreadPoolService
getActiveHandlerThreads, getMaxHandlerThreads, getMinHandlerThreads, getThreadWaitTimeout, setActiveHandlerThreads, setMaxHandlerThreads, setMinHandlerThreads, setThreadWaitTimeout
 
Methods inherited from class jrunx.kernel.ServiceAdapter
bind, findObjectInstance, findObjectInstance, findObjectInstance, getBindToJNDI, getDeactivated, getDomainName, getDomainSearchPath, getJRunService, getLogger, getName, getParentService, getReference, getResourceManager, getServerName, getServerProperties, getStatus, invokeMethod, isInPartition, isPartition, lookup, postDeregister, postRegister, preDeregister, preRegister, requestServer, scheduleRunnable, setBindToJNDI, setDeactivated, setDomainName, setName, setParentService, toString, unbind, unscheduleRunnable, updateStatus
 
Methods inherited from interface jrun.servlet.network.NetworkServiceMBean
getAvailablePort, getBacklog, getBindAddress, getInterface, getPort, getSocketFactoryName, getTimeout, setBacklog, setBindAddress, setInterface, setPort, setSocketFactoryName, setTimeout
 
Methods inherited from interface jrunx.scheduler.ThreadPoolServiceMBean
getActiveHandlerThreads, getMaxHandlerThreads, getMinHandlerThreads, getThreadWaitTimeout, setActiveHandlerThreads, setMaxHandlerThreads, setMinHandlerThreads, setThreadWaitTimeout
 
Methods inherited from interface jrunx.kernel.ServiceMBean
bind, getBindToJNDI, getDeactivated, getDomainName, getJRunService, getLogger, getName, getParentService, getServerName, requestServer, setBindToJNDI, setDeactivated, setDomainName, setName, setParentService, unbind
 
Methods inherited from interface jrunx.kernel.Service
getStatus, updateStatus
 

Field Detail

SERVER_LOAD_ATTRIBUTE

public static final java.lang.String SERVER_LOAD_ATTRIBUTE
Constructor Detail

JRunProxyService

public JRunProxyService()
Method Detail

getServletInfo

public java.lang.String getServletInfo()

init

public void init()
          throws java.lang.Exception
Description copied from class: ServiceAdapter
Not every service needs to init, implement it out of convenience.
Specified by:
init in interface Service
Overrides:
init in class NetworkService

start

public void start()
           throws java.lang.Exception
Description copied from class: ServiceAdapter
Every service other than mere data collections should start
Specified by:
start in interface Service
Overrides:
start in class NetworkService

stop

public void stop()
          throws java.lang.Exception
Description copied from class: ServiceAdapter
Every service other than mere data collections should stop
Specified by:
stop in interface Service
Overrides:
stop in class NetworkService

destroy

public void destroy()
             throws java.lang.Exception
Description copied from class: ServiceAdapter
Every service is eventually destroyed. Convenience implementation.
Specified by:
destroy in interface Service
Overrides:
destroy in class ServiceAdapter

accept

protected java.net.Socket accept()
                          throws java.io.IOException,
                                 java.lang.InterruptedException
Description copied from class: NetworkService
Subclasses can override this to change the socket class or implement a different concurrency policy.
Overrides:
accept in class NetworkService

createRunnable

public java.lang.Runnable createRunnable()
                                  throws java.lang.InterruptedException
Description copied from interface: RunnableFactory
Returns an Runnable object by doing a protocol-specific accept or receive; the Runnable encapsulates an atomic unit of work. Subclasses implement this method for the protocol they support. If the factory encapsulates a listen socket, this is the place to call accept()
Following copied from interface: jrunx.scheduler.RunnableFactory
Returns:
an endpoint for requests and responses. never null.
Throws:
java.lang.InterruptedException - if a timeout or interrupt occurs

swapRunnable

public java.lang.Runnable swapRunnable(java.lang.Runnable r)
                                throws java.lang.InterruptedException
Description copied from interface: RunnableFactory
this is an alternative method for sourcing runnables, letting the runnable factory take care of creation and destruction of the runnable objects. If the runnable encapsulates a connected socket, this is the natural place to read the next request or message from the socket.

returning null from this method is an efficient way to signal no more swapping can be done, without throwing an exception.

Following copied from interface: jrunx.scheduler.RunnableFactory
Parameters:
ep - a previously used endpoint for recycling
Returns:
a new runnable object, or null if no more exist.
Throws:
java.lang.InterruptedException - if an interrupt or timeout occurs.

destroyRunnable

public void destroyRunnable(java.lang.Runnable r,
                            int reason)
Description copied from interface: RunnableFactory
destroy the given runnable. This is called by the thread pool when we resource limits have been exceeded, an exception has occured, or a shutdown has been issued. The BUSY case is where you should implement any "we are too busy" logic.

invokeRunnable

public void invokeRunnable(java.lang.Runnable r)
Description copied from interface: RunnableFactory
process this request. entry point into filter pattern

getServletEngine

public ServletEngine getServletEngine()

getServiceName

public java.lang.String getServiceName()
Description copied from class: NetworkService
Gets the service name, such as JRun Web Server. This must be implemented by any subclasses
Overrides:
getServiceName in class NetworkService

getMetricsPrefix

public java.lang.String getMetricsPrefix()
Description copied from class: NetworkService
Gets the prefix to be used for metrics, such as "jcp" or "web". This must be implemented by any subclasses.
Overrides:
getMetricsPrefix in class NetworkService

setLoadBalancingAlgorithm

public void setLoadBalancingAlgorithm(java.lang.String algorithm)
Description copied from interface: JRunProxyServiceMBean
Sets the loadbalancing algorithm to use
Specified by:
setLoadBalancingAlgorithm in interface JRunProxyServiceMBean
Following copied from interface: jrun.servlet.jrpp.JRunProxyServiceMBean
Parameters:
algorithm -  

getLoadBalancingAlgorithm

public java.lang.String getLoadBalancingAlgorithm()
Description copied from interface: JRunProxyServiceMBean
Gets the loadbalancing algorithm
Specified by:
getLoadBalancingAlgorithm in interface JRunProxyServiceMBean
Following copied from interface: jrun.servlet.jrpp.JRunProxyServiceMBean
Returns:
The algorithm

setServerWeight

public void setServerWeight(int weight)
Description copied from interface: JRunProxyServiceMBean
Sets the 'server weight' used in Weighted RoundRobin and Weighted Random RR
Specified by:
setServerWeight in interface JRunProxyServiceMBean
Following copied from interface: jrun.servlet.jrpp.JRunProxyServiceMBean
Parameters:
weight -  

getServerWeight

public int getServerWeight()
Description copied from interface: JRunProxyServiceMBean
Gets the 'server weight' used in Weighted RoundRobin and Weighted Random RR
Specified by:
getServerWeight in interface JRunProxyServiceMBean
Following copied from interface: jrun.servlet.jrpp.JRunProxyServiceMBean
Returns:
The 'server weight'

setMapCheck

public void setMapCheck(int time)
Description copied from interface: JRunProxyServiceMBean
Sets the time how ofter the web server connector will try to refresh mappings, in seconds, 0 if only do at startup
Specified by:
setMapCheck in interface JRunProxyServiceMBean
Following copied from interface: jrun.servlet.jrpp.JRunProxyServiceMBean
Parameters:
time -  

getMapCheck

public int getMapCheck()
Description copied from interface: JRunProxyServiceMBean
Gets the time how often web server connector should refrehs mappings
Specified by:
getMapCheck in interface JRunProxyServiceMBean
Following copied from interface: jrun.servlet.jrpp.JRunProxyServiceMBean
Returns:
The time in seconds

setCacheRealPath

public void setCacheRealPath(boolean cache)
Description copied from interface: JRunProxyServiceMBean
If true, the results from getRealPath() will be cached. There are some instances where you may want to disable the caching of real path information (which is keyed by the requested resource path), such as when multiple virtual servers are using the same JRun server. The default is true.
Specified by:
setCacheRealPath in interface JRunProxyServiceMBean
Following copied from interface: jrun.servlet.jrpp.JRunProxyServiceMBean
Parameters:
cache - Whether getRealPath() should be cached.

getCacheRealPath

public boolean getCacheRealPath()
Description copied from interface: JRunProxyServiceMBean
If true, the results from getRealPath() will be cached.
Specified by:
getCacheRealPath in interface JRunProxyServiceMBean
Following copied from interface: jrun.servlet.jrpp.JRunProxyServiceMBean
Returns:
Whether getRealPath() should be cached.

setStickySessions

public void setStickySessions(java.lang.String sticky)
Description copied from interface: JRunProxyServiceMBean
Sets whether or not connector load balancing will honour session stickyness
Specified by:
setStickySessions in interface JRunProxyServiceMBean
Following copied from interface: jrun.servlet.jrpp.JRunProxyServiceMBean
Parameters:
sticky, - 'true' / 'false'

getStickySessions

public java.lang.String getStickySessions()
Description copied from interface: JRunProxyServiceMBean
Gets whether or not connector load balancing will honour session stickyness
Specified by:
getStickySessions in interface JRunProxyServiceMBean
Following copied from interface: jrun.servlet.jrpp.JRunProxyServiceMBean
Returns:
 

setKeyStore

public void setKeyStore(java.lang.String keyStore)
Description copied from interface: JRunProxyServiceMBean
Sets the keystore file name
Specified by:
setKeyStore in interface JRunProxyServiceMBean
Following copied from interface: jrun.servlet.jrpp.JRunProxyServiceMBean
Parameters:
keystore - filespec

setKeyStorePassword

public void setKeyStorePassword(java.lang.String keyStorePassword)
Description copied from interface: JRunProxyServiceMBean
Sets the keystore password
Specified by:
setKeyStorePassword in interface JRunProxyServiceMBean
Following copied from interface: jrun.servlet.jrpp.JRunProxyServiceMBean
Parameters:
keystore - password

setTrustStore

public void setTrustStore(java.lang.String trustStore)
Description copied from interface: JRunProxyServiceMBean
Sets the truststore file name
Specified by:
setTrustStore in interface JRunProxyServiceMBean
Following copied from interface: jrun.servlet.jrpp.JRunProxyServiceMBean
Parameters:
truststore - filespec

getSSL

public boolean getSSL()
Description copied from interface: JRunProxyServiceMBean
Returns whether or not SSL is enabled between the web server and the ProxyService
Specified by:
getSSL in interface JRunProxyServiceMBean

getClusterHelper

public JRunProxyClusterHelper getClusterHelper()
Specified by:
getClusterHelper in interface JRunProxyInterface

setClusterSequence

public void setClusterSequence(int seq)
Specified by:
setClusterSequence in interface JRunProxyInterface

getClusterSequence

public int getClusterSequence()
Specified by:
getClusterSequence in interface JRunProxyInterface


Copyright � 2002 Macromedia Corporation. All Rights Reserved.