jrun.servlet.http
Class WebService
jrunx.kernel.ServiceAdapter
|
+--jrunx.scheduler.ThreadPoolService
|
+--jrun.servlet.network.NetworkService
|
+--jrun.servlet.http.WebService
- All Implemented Interfaces:
- NetworkServiceMBean, javax.naming.Referenceable, RunnableFactory, java.io.Serializable, Service, ServiceMBean, ThreadPoolServiceMBean, WebServiceMBean
- Direct Known Subclasses:
- SSLService
- public class WebService
- extends NetworkService
- implements WebServiceMBean
- See Also:
- Serialized Form
| 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 |
|
Method Summary |
java.lang.Runnable |
createRunnable()
return a smart endpoint used for implementing
protocols that handle more than one request per socket
connection. |
void |
destroy()
Every service is eventually destroyed. |
void |
destroyRunnable(java.lang.Runnable r,
int reason)
destroy the given runnable. |
java.lang.String |
getMetricsPrefix()
Gets the prefix to be used for metrics, such as "jcp" or "web". |
java.lang.String |
getServiceName()
Gets the service name, such as JRun Web Server. |
void |
init()
Not every service needs to init, implement it out of convenience. |
void |
invokeRunnable(java.lang.Runnable r)
process this request. |
boolean |
isKeepAlive()
Gets the keep-alive flag |
void |
setKeepAlive(boolean keepalive)
Sets the keep-alive flag |
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)
get the next runnable request from the socket. |
| Methods inherited from class jrun.servlet.network.NetworkService |
accept, 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.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.kernel.ServiceMBean |
bind, getBindToJNDI, getDeactivated, getDomainName, getJRunService, getLogger, getName, getParentService, getServerName, requestServer, setBindToJNDI, setDeactivated, setDomainName, setName, setParentService, unbind |
WebService
public WebService()
setKeepAlive
public void setKeepAlive(boolean keepalive)
- Description copied from interface:
WebServiceMBean
- Sets the keep-alive flag
- Specified by:
setKeepAlive in interface WebServiceMBean
- Following copied from interface:
jrun.servlet.http.WebServiceMBean
- Parameters:
keepalive - true to enable HTTP keep-alive
isKeepAlive
public boolean isKeepAlive()
- Description copied from interface:
WebServiceMBean
- Gets the keep-alive flag
- Specified by:
isKeepAlive in interface WebServiceMBean
- Following copied from interface:
jrun.servlet.http.WebServiceMBean
- Returns:
- true if HTTP keep-alive is enabled
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
createRunnable
public java.lang.Runnable createRunnable()
throws java.lang.InterruptedException
- return a smart endpoint used for implementing
protocols that handle more than one request per socket
connection.
- 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
- get the next runnable request from the socket.
- 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 final void invokeRunnable(java.lang.Runnable r)
- Description copied from interface:
RunnableFactory
- process this request. entry point into filter pattern
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
Copyright � 2002 Macromedia Corporation. All Rights Reserved.