public class ServletService extends java.lang.Object implements AlarmListener, ClassLoaderListener, InvocationBuilder, Dependency
Constructor and Description |
---|
ServletService(Resin resin)
Creates a new servlet server.
|
Modifier and Type | Method and Description |
---|---|
void |
add(DispatchRule rewriteRule) |
void |
addEarDefault(EarConfig config)
Adds an EarDefault
|
void |
addErrorPage(ErrorPage errorPage)
Adds an error page
|
void |
addHost(HostConfig host)
Adds the host.
|
void |
addHostDefault(HostConfig init)
Adds a HostDefault.
|
void |
addHostDeploy(HostExpandDeployGenerator deploy)
Adds a HostDeploy.
|
void |
addSendfileCount() |
void |
addWebAppDefault(WebAppConfig init)
Adds a WebAppDefault.
|
HttpBufferStore |
allocateHttpBuffer() |
Invocation |
buildInvocation(Invocation invocation)
Sets the invocation
|
void |
classLoaderDestroy(DynamicClassLoader loader)
Handles the case where a class loader is dropped.
|
void |
classLoaderInit(DynamicClassLoader loader)
Handles the case where a class loader is activated.
|
void |
clearCache()
Clears the proxy cache.
|
void |
clearCacheByPattern(java.lang.String hostPattern,
java.lang.String uriPattern)
Clears the catch by matching the invocation.
|
protected ServerAdmin |
createAdmin() |
ActorSender |
createAdminClient(java.lang.String uid)
Creates a bam client to the admin.
|
ActorSender |
createAdminClient(java.lang.String uid,
java.lang.String resource)
Creates a bam client to the admin.
|
protected HempBrokerManager |
createBrokerManager()
Creates the bam broker manager
|
HostExpandDeployGenerator |
createHostDeploy()
Adds a HostDeploy.
|
AbstractProxyCache |
createProxyCache()
Creates the http cache.
|
RewriteDispatch |
createRewriteDispatch()
Adds rewrite-dispatch.
|
void |
destroy()
Closes the server.
|
void |
freeHttpBuffer(HttpBufferStore buffer) |
AbstractAccessLog |
getAccessLog() |
int |
getAccessLogBufferSize() |
ServerMXBean |
getAdmin()
Returns the admin.
|
AdminAuthenticator |
getAdminAuthenticator() |
ManagedBroker |
getAdminBroker()
Returns the bam broker.
|
BamManager |
getAdminBrokerManager()
Returns the bam broker.
|
java.lang.String |
getAlternateSessionURLPrefix()
Gets the alternate session url prefix.
|
java.lang.String |
getBamAdminName()
Returns the bam name.
|
ManagedBroker |
getBamBroker()
Returns the bam broker.
|
BamManager |
getBamManager() |
Broker |
getBroker()
Returns the admin broker.
|
EnvironmentClassLoader |
getClassLoader()
Returns the classLoader
|
CloudCluster |
getCluster()
Returns the cluster
|
CloudCluster[] |
getClusterList()
Returns all the clusters
|
protected ClusterServer |
getClusterServer()
Returns the cluster server
|
java.lang.Throwable |
getConfigException()
Returns the configuration exception
|
java.lang.String |
getConnectionErrorPage()
Gets the connection error page.
|
double |
getCpuLoad() |
static ServletService |
getCurrent()
Returns the current server
|
WebApp |
getDefaultWebApp()
Returns the default web-app or error web-app for top-level errors
|
long |
getDependencyCheckInterval()
Returns the dependency check interval.
|
EnvironmentMXBean |
getEnvironmentAdmin()
Returns the admin for the current environment.
|
ErrorPageManager |
getErrorPageManager() |
WebApp |
getErrorWebApp()
Returns the error webApp during startup.
|
int |
getHeaderCountMax()
Gets the header-count-max
|
int |
getHeaderSizeMax()
Gets the header-size-max
|
MessageStream |
getHmtpStream()
Returns any HMTP stream
|
Host |
getHost(java.lang.String hostName,
int port)
Returns the matching servlet pattern for a URL.
|
HostController |
getHostController(java.lang.String hostName,
int port)
Returns the matching servlet pattern for a URL.
|
HostController[] |
getHostControllers()
Returns the host controllers.
|
InvocationDecoder |
getInvocationDecoder() |
InvocationServer |
getInvocationServer() |
PersistentStoreConfig |
getPersistentStore() |
CloudPod |
getPod()
Returns the self server's pod
|
AbstractProxyCache |
getProxyCache() |
long |
getProxyCacheHitCount()
Returns the proxy cache hit count.
|
long |
getProxyCacheMissCount()
Returns the proxy cache miss count.
|
Resin |
getResin()
Returns the resin server
|
Path |
getResinDataDirectory()
Returns the admin path
|
ResinSystem |
getResinSystem() |
Path |
getRootDirectory()
Sets the root directory.
|
ClusterServer |
getSelfServer()
Returns the self server
|
long |
getSendfileCount() |
long |
getSendfileMinLength() |
java.lang.String |
getServerHeader()
Gets the server header.
|
java.lang.String |
getServerId()
Returns the id.
|
int |
getServerIndex() |
java.lang.String |
getSessionCookie()
Gets the session cookie
|
java.lang.String |
getSessionURLPrefix()
Gets the session url prefix.
|
long |
getShutdownWaitMax()
Gets the max wait time for a shutdown.
|
java.lang.String |
getSSLSessionCookie()
Gets the ssl session cookie
|
java.lang.String |
getStage()
Returns the stage id
|
long |
getStartTime()
Returns the time the server started in ms.
|
java.lang.String |
getState()
Returns the lifecycle state
|
ClusterCache |
getSystemStore()
Returns the reliable system store
|
java.lang.String |
getUniqueServerName() |
java.lang.String |
getURLCharacterEncoding() |
int |
getUrlLengthMax()
Gets the url-length-max
|
WebApp |
getWebApp(java.lang.String hostName,
int port,
java.lang.String url)
Returns the matching web-app for a URL.
|
void |
handleAlarm(Alarm alarm)
Handles the alarm.
|
void |
init()
Initialization.
|
protected AbstractProxyCache |
instantiateProxyCache() |
boolean |
isActive()
Returns true if the server is currently active and accepting requests
|
boolean |
isAfterStarting()
Returns true if the server is starting or active
|
boolean |
isDeployError()
Return true if idle.
|
boolean |
isDestroyed()
Returns true if the server is closed.
|
boolean |
isDestroying()
Returns true if the server is closed.
|
boolean |
isDevelopmentModeErrorPage()
Development mode error pages.
|
boolean |
isEnabled()
Returns true for an enabled service.
|
boolean |
isErrorPageServerId()
Development mode error pages.
|
boolean |
isIgnoreClientDisconnect()
True if client disconnects should be invisible to servlets.
|
boolean |
isModified()
Returns true if the server has been modified and needs restarting.
|
boolean |
isModifiedNow()
Returns true if the server has been modified and needs restarting.
|
boolean |
isPreview()
Returns true in preview mode
|
boolean |
isResinServer() |
boolean |
isSendfileEnable()
Returns true if sendfile is enabled.
|
boolean |
isStopped()
Returns true if the server is stopped.
|
boolean |
isStopping()
Returns true if the server is stopped.
|
boolean |
isWatchdog()
Returns true for the watchdog server.
|
boolean |
logModified(java.util.logging.Logger log)
Log the reason for a modification, returning true if this
dependency was modified.
|
protected void |
logModules()
Display activated modules
|
protected void |
notifyStop()
Notifications to cluster servers that we've stopped.
|
protected void |
preInit() |
void |
restart() |
void |
setAccessLog(AccessLog log)
Sets the access log.
|
void |
setAccessLogBufferSize(Bytes bytes) |
void |
setAlternateSessionURLPrefix(java.lang.String urlPrefix)
Sets the alternate session url prefix.
|
void |
setConfigException(java.lang.Throwable exn)
Returns the configuration instance.
|
void |
setConnectionErrorPage(java.lang.String errorPage)
Sets the connection error page.
|
void |
setDevelopmentModeErrorPage(boolean isEnable)
Development mode error pages.
|
void |
setEnabled(boolean isEnabled) |
void |
setErrorPageServerId(boolean isEnable)
Development mode error pages.
|
void |
setHeaderCountMax(int length)
Sets the header-size-max
|
void |
setHeaderSizeMax(int length)
Sets the header-size-max
|
void |
setIgnoreClientDisconnect(boolean isIgnore)
True if client disconnections should be invisible to servlets.
|
void |
setPersistentStore(PersistentStoreConfig config) |
void |
setRootDirectory(Path path)
Sets the root directory.
|
void |
setSendfileEnable(boolean isEnable)
Returns true if sendfile is enabled.
|
void |
setSendfileMinLength(long bytes) |
void |
setServerHeader(java.lang.String server)
Sets the server header.
|
void |
setSessionCookie(java.lang.String cookie)
Sets the session cookie
|
void |
setSessionURLPrefix(java.lang.String urlPrefix)
Sets the session url prefix.
|
void |
setShutdownWaitMax(Period waitTime)
Sets the max wait time for shutdown.
|
void |
setSSLSessionCookie(java.lang.String cookie)
Sets the ssl session cookie
|
void |
setStage(java.lang.String stage)
Sets the stage id
|
void |
setURLCharacterEncoding(java.lang.String encoding)
Sets URL encoding.
|
void |
setUrlLengthMax(int length)
Sets the url-length-max
|
void |
start()
Start the server.
|
protected void |
startImpl() |
void |
stop()
Closes the server.
|
java.lang.String |
toString() |
public ServletService(Resin resin)
protected void preInit()
public static ServletService getCurrent()
public ResinSystem getResinSystem()
public boolean isResinServer()
public java.lang.String getUniqueServerName()
public EnvironmentClassLoader getClassLoader()
public java.lang.Throwable getConfigException()
public void setConfigException(java.lang.Throwable exn)
public Resin getResin()
public boolean isWatchdog()
public CloudCluster getCluster()
public CloudCluster[] getClusterList()
public Path getResinDataDirectory()
protected HempBrokerManager createBrokerManager()
protected ClusterServer getClusterServer()
public ClusterServer getSelfServer()
public CloudPod getPod()
public BamManager getBamManager()
public ManagedBroker getBamBroker()
public ManagedBroker getAdminBroker()
public BamManager getAdminBrokerManager()
public ActorSender createAdminClient(java.lang.String uid)
public ActorSender createAdminClient(java.lang.String uid, java.lang.String resource)
public java.lang.String getBamAdminName()
public Broker getBroker()
public AdminAuthenticator getAdminAuthenticator()
public boolean isDevelopmentModeErrorPage()
public void setDevelopmentModeErrorPage(boolean isEnable)
public boolean isErrorPageServerId()
public void setErrorPageServerId(boolean isEnable)
public void setStage(java.lang.String stage)
public java.lang.String getStage()
public boolean isPreview()
public boolean isEnabled()
public void setEnabled(boolean isEnabled)
public void setShutdownWaitMax(Period waitTime)
public long getShutdownWaitMax()
public void setConnectionErrorPage(java.lang.String errorPage)
public java.lang.String getConnectionErrorPage()
public boolean isDeployError()
public boolean isIgnoreClientDisconnect()
public void setIgnoreClientDisconnect(boolean isIgnore)
public java.lang.String getServerId()
public void setRootDirectory(Path path)
public Path getRootDirectory()
public void setServerHeader(java.lang.String server)
public java.lang.String getServerHeader()
public void setUrlLengthMax(int length)
public int getUrlLengthMax()
public void setHeaderSizeMax(int length)
public int getHeaderSizeMax()
public void setHeaderCountMax(int length)
public int getHeaderCountMax()
public void addWebAppDefault(WebAppConfig init)
public void addEarDefault(EarConfig config)
public void addHostDefault(HostConfig init)
public HostExpandDeployGenerator createHostDeploy()
public void addHostDeploy(HostExpandDeployGenerator deploy)
public void addHost(HostConfig host)
public RewriteDispatch createRewriteDispatch()
public void add(DispatchRule rewriteRule)
public AbstractProxyCache getProxyCache()
public final AbstractProxyCache createProxyCache() throws ConfigException
ConfigException
protected AbstractProxyCache instantiateProxyCache()
public void setSendfileEnable(boolean isEnable)
public boolean isSendfileEnable()
public long getSendfileMinLength()
public void setSendfileMinLength(long bytes)
public long getSendfileCount()
public void addSendfileCount()
public void setAccessLog(AccessLog log)
public AbstractAccessLog getAccessLog()
public void setAccessLogBufferSize(Bytes bytes)
public int getAccessLogBufferSize()
public long getDependencyCheckInterval()
public void setSessionCookie(java.lang.String cookie)
public java.lang.String getSessionCookie()
public void setSSLSessionCookie(java.lang.String cookie)
public java.lang.String getSSLSessionCookie()
public void setSessionURLPrefix(java.lang.String urlPrefix)
public java.lang.String getSessionURLPrefix()
public void setAlternateSessionURLPrefix(java.lang.String urlPrefix) throws ConfigException
ConfigException
public java.lang.String getAlternateSessionURLPrefix()
public void setURLCharacterEncoding(java.lang.String encoding) throws ConfigException
ConfigException
public java.lang.String getURLCharacterEncoding()
public InvocationDecoder getInvocationDecoder()
public InvocationServer getInvocationServer()
public void addErrorPage(ErrorPage errorPage)
public void setPersistentStore(PersistentStoreConfig config)
public PersistentStoreConfig getPersistentStore()
public int getServerIndex()
public long getStartTime()
public java.lang.String getState()
public double getCpuLoad()
public Invocation buildInvocation(Invocation invocation) throws ConfigException
buildInvocation
in interface InvocationBuilder
ConfigException
public ServerMXBean getAdmin()
public EnvironmentMXBean getEnvironmentAdmin()
public WebApp getDefaultWebApp()
public WebApp getWebApp(java.lang.String hostName, int port, java.lang.String url)
public WebApp getErrorWebApp()
public ErrorPageManager getErrorPageManager()
public HostController[] getHostControllers()
public Host getHost(java.lang.String hostName, int port)
public HostController getHostController(java.lang.String hostName, int port)
public ClusterCache getSystemStore()
public HttpBufferStore allocateHttpBuffer()
public void freeHttpBuffer(HttpBufferStore buffer)
public void classLoaderInit(DynamicClassLoader loader)
classLoaderInit
in interface ClassLoaderListener
public void classLoaderDestroy(DynamicClassLoader loader)
classLoaderDestroy
in interface ClassLoaderListener
@PostConstruct public void init()
protected ServerAdmin createAdmin()
public void start()
protected void startImpl()
protected void logModules()
public void handleAlarm(Alarm alarm)
handleAlarm
in interface AlarmListener
public boolean isModified()
isModified
in interface Dependency
public boolean logModified(java.util.logging.Logger log)
Dependency
logModified
in interface Dependency
public boolean isModifiedNow()
public boolean isAfterStarting()
public boolean isStopping()
public boolean isStopped()
public boolean isDestroyed()
public boolean isDestroying()
public boolean isActive()
public void clearCacheByPattern(java.lang.String hostPattern, java.lang.String uriPattern)
public void clearCache()
public long getProxyCacheHitCount()
public long getProxyCacheMissCount()
public MessageStream getHmtpStream()
public void restart()
public void stop()
protected void notifyStop()
public void destroy()
public java.lang.String toString()
toString
in class java.lang.Object