import javax.management.ObjectName;
import org.apache.catalina.Context;
-import org.apache.catalina.Engine;
import org.apache.catalina.LifecycleException;
import org.apache.catalina.LifecycleState;
import org.apache.catalina.Server;
import org.apache.catalina.mbeans.MBeanFactory;
import org.apache.catalina.mbeans.MBeanUtils;
import org.apache.catalina.startup.Catalina;
-import org.apache.catalina.util.LifecycleBase;
import org.apache.catalina.util.LifecycleMBeanBase;
import org.apache.catalina.util.ServerInfo;
import org.apache.juli.logging.Log;
/**
* Return the global naming resources.
*/
+ @Override
public NamingResources getGlobalNamingResources() {
return (this.globalNamingResources);
*
* @param globalNamingResources The new global naming resources
*/
+ @Override
public void setGlobalNamingResources
(NamingResources globalNamingResources) {
* the corresponding version number, in the format
* <code><description>/<version></code>.
*/
+ @Override
public String getInfo() {
return (info);
/**
* Return the port number we listen to for shutdown commands.
*/
+ @Override
public int getPort() {
return (this.port);
*
* @param port The new port number
*/
+ @Override
public void setPort(int port) {
this.port = port;
/**
* Return the address on which we listen to for shutdown commands.
*/
+ @Override
public String getAddress() {
return (this.address);
*
* @param address The new address
*/
+ @Override
public void setAddress(String address) {
this.address = address;
/**
* Return the shutdown command string we are waiting for.
*/
+ @Override
public String getShutdown() {
return (this.shutdown);
*
* @param shutdown The new shutdown command
*/
+ @Override
public void setShutdown(String shutdown) {
this.shutdown = shutdown;
*
* @param service The Service to be added
*/
+ @Override
public void addService(Service service) {
service.setServer(this);
* This keeps the main thread alive - the thread pool listening for http
* connections is daemon threads.
*/
+ @Override
public void await() {
// Negative values - don't wait on port - tomcat is embedded or we just don't like ports
if( port == -2 ) {
*
* @param name Name of the Service to be returned
*/
+ @Override
public Service findService(String name) {
if (name == null) {
/**
* Return the set of Services defined within this Server.
*/
+ @Override
public Service[] findServices() {
return (services);
*
* @param service The Service to be removed
*/
+ @Override
public void removeService(Service service) {
synchronized (services) {
/**
* Start nested components ({@link Service}s) and implement the requirements
- * of {@link LifecycleBase#startInternal()}.
+ * of {@link org.apache.catalina.util.LifecycleBase#startInternal()}.
*
* @exception LifecycleException if this component detects a fatal error
* that prevents this component from being used
/**
* Stop nested components ({@link Service}s) and implement the requirements
- * of {@link LifecycleBase#stopInternal()}.
+ * of {@link org.apache.catalina.util.LifecycleBase#stopInternal()}.
*
* @exception LifecycleException if this component detects a fatal error
* that needs to be reported
* Obtain the MBean domain for this server. The domain is obtained using
* the following search order:
* <ol>
- * <li>Name of first {@link Engine}.</li>
+ * <li>Name of first {@link org.apache.catalina.Engine}.</li>
* <li>Name of first {@link Service}.</li>
* </ol>
*/
import org.apache.catalina.Service;
import org.apache.catalina.connector.Connector;
import org.apache.catalina.mbeans.MBeanUtils;
-import org.apache.catalina.util.LifecycleBase;
import org.apache.catalina.util.LifecycleMBeanBase;
import org.apache.juli.logging.Log;
import org.apache.juli.logging.LogFactory;
* Return the <code>Container</code> that handles requests for all
* <code>Connectors</code> associated with this Service.
*/
+ @Override
public Container getContainer() {
return (this.container);
*
* @param container The new Container
*/
+ @Override
public void setContainer(Container container) {
Container oldContainer = this.container;
* the corresponding version number, in the format
* <code><description>/<version></code>.
*/
+ @Override
public String getInfo() {
return (info);
/**
* Return the name of this Service.
*/
+ @Override
public String getName() {
return (this.name);
*
* @param name The new service name
*/
+ @Override
public void setName(String name) {
this.name = name;
/**
* Return the <code>Server</code> with which we are associated (if any).
*/
+ @Override
public Server getServer() {
return (this.server);
*
* @param server The server that owns this Service
*/
+ @Override
public void setServer(Server server) {
this.server = server;
*
* @param connector The Connector to be added
*/
+ @Override
public void addConnector(Connector connector) {
synchronized (connectors) {
/**
* Find and return the set of Connectors associated with this Service.
*/
+ @Override
public Connector[] findConnectors() {
return (connectors);
*
* @param connector The Connector to be removed
*/
+ @Override
public void removeConnector(Connector connector) {
synchronized (connectors) {
* Adds a named executor to the service
* @param ex Executor
*/
+ @Override
public void addExecutor(Executor ex) {
synchronized (executors) {
if (!executors.contains(ex)) {
* Retrieves all executors
* @return Executor[]
*/
+ @Override
public Executor[] findExecutors() {
synchronized (executors) {
Executor[] arr = new Executor[executors.size()];
* @param executorName String
* @return Executor
*/
+ @Override
public Executor getExecutor(String executorName) {
synchronized (executors) {
for (Executor executor: executors) {
* Removes an executor from the service
* @param ex Executor
*/
+ @Override
public void removeExecutor(Executor ex) {
synchronized (executors) {
if ( executors.remove(ex) && getState().isAvailable() ) {
/**
* Start nested components ({@link Executor}s, {@link Connector}s and
* {@link Container}s) and implement the requirements of
- * {@link LifecycleBase#startInternal()}.
+ * {@link org.apache.catalina.util.LifecycleBase#startInternal()}.
*
* @exception LifecycleException if this component detects a fatal error
* that prevents this component from being used
/**
* Stop nested components ({@link Executor}s, {@link Connector}s and
* {@link Container}s) and implement the requirements of
- * {@link LifecycleBase#stopInternal()}.
+ * {@link org.apache.catalina.util.LifecycleBase#stopInternal()}.
*
* @exception LifecycleException if this component detects a fatal error
* that needs to be reported
import org.apache.catalina.security.SecurityUtil;
import org.apache.catalina.util.Enumerator;
import org.apache.catalina.util.InstanceSupport;
-import org.apache.catalina.util.LifecycleBase;
import org.apache.juli.logging.Log;
import org.apache.juli.logging.LogFactory;
import org.apache.tomcat.InstanceManager;
* this servlet will return an SC_SERVICE_UNAVAILABLE error. If it is zero,
* the servlet is currently available.
*/
+ @Override
public long getAvailable() {
return (this.available);
*
* @param available The new available date/time
*/
+ @Override
public void setAvailable(long available) {
long oldAvailable = this.available;
* Return the load-on-startup order value (negative value means
* load on first call).
*/
+ @Override
public int getLoadOnStartup() {
if (isJspServlet && loadOnStartup < 0) {
*
* @param value New load-on-startup value
*/
+ @Override
public void setLoadOnStartup(int value) {
int oldLoadOnStartup = this.loadOnStartup;
/**
* Return the run-as identity for this servlet.
*/
+ @Override
public String getRunAs() {
return (this.runAs);
*
* @param runAs New run-as identity value
*/
+ @Override
public void setRunAs(String runAs) {
String oldRunAs = this.runAs;
/**
* Return the fully qualified servlet class name for this servlet.
*/
+ @Override
public String getServletClass() {
return (this.servletClass);
*
* @param servletClass Servlet class name
*/
+ @Override
public void setServletClass(String servletClass) {
String oldServletClass = this.servletClass;
/**
* Is this servlet currently unavailable?
*/
+ @Override
public boolean isUnavailable() {
if (!isEnabled())
* @return Array of names of the methods supported by the underlying
* servlet
*/
+ @Override
public String[] getServletMethods() throws ServletException {
Class<? extends Servlet> servletClazz = loadServlet().getClass();
/**
* Return the associated servlet instance.
*/
+ @Override
public Servlet getServlet() {
return instance;
}
/**
* Set the associated servlet instance.
*/
+ @Override
public void setServlet(Servlet servlet) {
instance = servlet;
}
* @param name Name of this initialization parameter to add
* @param value Value of this initialization parameter to add
*/
+ @Override
public void addInitParameter(String name, String value) {
synchronized (parameters) {
*
* @param listener The new listener
*/
+ @Override
public void addInstanceListener(InstanceListener listener) {
instanceSupport.addInstanceListener(listener);
*
* @param mapping The new wrapper mapping
*/
+ @Override
public void addMapping(String mapping) {
synchronized (mappings) {
* @param name Role name used within this servlet
* @param link Role name used within the web application
*/
+ @Override
public void addSecurityReference(String name, String link) {
synchronized (references) {
* an exception
* @exception ServletException if a loading error occurs
*/
+ @Override
public Servlet allocate() throws ServletException {
// If we are currently unloading this servlet, throw an exception
*
* @exception ServletException if a deallocation error occurs
*/
+ @Override
public void deallocate(Servlet servlet) throws ServletException {
// If not SingleThreadModel, no action is required
*
* @param name Name of the requested initialization parameter
*/
+ @Override
public String findInitParameter(String name) {
synchronized (parameters) {
* Return the names of all defined initialization parameters for this
* servlet.
*/
+ @Override
public String[] findInitParameters() {
synchronized (parameters) {
/**
* Return the mappings associated with this wrapper.
*/
+ @Override
public String[] findMappings() {
synchronized (mappings) {
*
* @param name Security role reference used within this servlet
*/
+ @Override
public String findSecurityReference(String name) {
synchronized (references) {
* Return the set of security role reference names associated with
* this servlet, if any; otherwise return a zero-length array.
*/
+ @Override
public String[] findSecurityReferences() {
synchronized (references) {
* an exception
* @exception ServletException if some other loading problem occurs
*/
+ @Override
public synchronized void load() throws ServletException {
instance = loadServlet();
*
* @param name Name of the initialization parameter to remove
*/
+ @Override
public void removeInitParameter(String name) {
synchronized (parameters) {
*
* @param listener The listener to remove
*/
+ @Override
public void removeInstanceListener(InstanceListener listener) {
instanceSupport.removeInstanceListener(listener);
*
* @param mapping The pattern to remove
*/
+ @Override
public void removeMapping(String mapping) {
synchronized (mappings) {
*
* @param name Security role used within this servlet to be removed
*/
+ @Override
public void removeSecurityReference(String name) {
synchronized (references) {
* @param unavailable The exception that occurred, or <code>null</code>
* to mark this servlet as permanently unavailable
*/
+ @Override
public void unavailable(UnavailableException unavailable) {
getServletContext().log(sm.getString("standardWrapper.unavailable", getName()));
if (unavailable == null)
* @exception ServletException if an exception is thrown by the
* destroy() method
*/
+ @Override
public synchronized void unload() throws ServletException {
// Nothing to do if we have never loaded the instance
*
* @param name Name of the initialization parameter to retrieve
*/
+ @Override
public String getInitParameter(String name) {
return (findInitParameter(name));
* Return the set of initialization parameter names defined for this
* servlet. If none are defined, an empty Enumeration is returned.
*/
+ @Override
public Enumeration<String> getInitParameterNames() {
synchronized (parameters) {
/**
* Return the servlet context with which this servlet is associated.
*/
+ @Override
public ServletContext getServletContext() {
if (parent == null)
/**
* Return the name of this servlet.
*/
+ @Override
public String getServletName() {
return (getName());
/**
* Increment the error count used for monitoring.
*/
+ @Override
public void incrementErrorCount(){
swValve.setErrorCount(swValve.getErrorCount() + 1);
}
return classLoadTime;
}
+ @Override
public MultipartConfigElement getMultipartConfigElement() {
return multipartConfigElement;
}
+ @Override
public void setMultipartConfigElement(
MultipartConfigElement multipartConfigElement) {
this.multipartConfigElement = multipartConfigElement;
return asyncSupported;
}
+ @Override
public void setAsyncSupported(boolean asyncSupported) {
this.asyncSupported = asyncSupported;
}
+ @Override
public boolean isEnabled() {
return enabled;
}
+ @Override
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
/**
* Start this component and implement the requirements
- * of {@link LifecycleBase#startInternal()}.
+ * of {@link org.apache.catalina.util.LifecycleBase#startInternal()}.
*
* @exception LifecycleException if this component detects a fatal error
* that prevents this component from being used
/**
* Stop this component and implement the requirements
- * of {@link LifecycleBase#stopInternal()}.
+ * of {@link org.apache.catalina.util.LifecycleBase#stopInternal()}.
*
* @exception LifecycleException if this component detects a fatal error
* that prevents this component from being used
/* Remove a JMX notficationListener
* @see javax.management.NotificationEmitter#removeNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object)
*/
+ @Override
public void removeNotificationListener(NotificationListener listener,
NotificationFilter filter, Object object) throws ListenerNotFoundException {
broadcaster.removeNotificationListener(listener,filter,object);
* @TODO This two events we not send j2ee.state.failed and j2ee.attribute.changed!
* @see javax.management.NotificationBroadcaster#getNotificationInfo()
*/
+ @Override
public MBeanNotificationInfo[] getNotificationInfo() {
if(notificationInfo == null) {
/* Add a JMX-NotificationListener
* @see javax.management.NotificationBroadcaster#addNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object)
*/
+ @Override
public void addNotificationListener(NotificationListener listener,
NotificationFilter filter, Object object) throws IllegalArgumentException {
broadcaster.addNotificationListener(listener,filter,object);
* Remove a JMX-NotificationListener
* @see javax.management.NotificationBroadcaster#removeNotificationListener(javax.management.NotificationListener)
*/
+ @Override
public void removeNotificationListener(NotificationListener listener)
throws ListenerNotFoundException {
broadcaster.removeNotificationListener(listener);