Methods Summary |
---|
public void | containerEvent(org.apache.catalina.ContainerEvent event)Handle a ContainerEvent from one of the Containers we are
interested in.
try {
String type = event.getType();
if (Container.ADD_CHILD_EVENT.equals(type)) {
processContainerAddChild(event.getContainer(),
(Container) event.getData());
} else if (Container.REMOVE_CHILD_EVENT.equals(type)) {
processContainerRemoveChild(event.getContainer(),
(Container) event.getData());
}
} catch (Exception e) {
log.error("Exception processing event " + event, e);
}
|
protected void | createMBeans()Create the MBeans that correspond to every existing node of our tree.
try {
MBeanFactory factory = new MBeanFactory();
createMBeans(factory);
createMBeans(ServerFactory.getServer());
} catch (MBeanException t) {
Exception e = t.getTargetException();
if (e == null)
e = t;
log.error("createMBeans: MBeanException", e);
} catch (Throwable t) {
log.error("createMBeans: Throwable", t);
}
|
protected void | createMBeans(org.apache.catalina.Connector connector)Create the MBeans for the specified Connector and its nested components.
// Create the MBean for the Connnector itself
// if (log.isDebugEnabled())
// log.debug("Creating MBean for Connector " + connector);
// MBeanUtils.createMBean(connector);
|
protected void | createMBeans(org.apache.catalina.Context context)Create the MBeans for the specified Context and its nested components.
// Create the MBean for the Context itself
// if (log.isDebugEnabled())
// log.debug("Creating MBean for Context " + context);
// MBeanUtils.createMBean(context);
context.addContainerListener(this);
if (context instanceof StandardContext) {
((StandardContext) context).addPropertyChangeListener(this);
((StandardContext) context).addLifecycleListener(this);
}
// If the context is privileged, give a reference to it
// in a servlet context attribute
if (context.getPrivileged()) {
context.getServletContext().setAttribute
(Globals.MBEAN_REGISTRY_ATTR,
MBeanUtils.createRegistry());
context.getServletContext().setAttribute
(Globals.MBEAN_SERVER_ATTR,
MBeanUtils.createServer());
}
// Create the MBeans for the associated nested components
Loader cLoader = context.getLoader();
if (cLoader != null) {
if (log.isDebugEnabled())
log.debug("Creating MBean for Loader " + cLoader);
//MBeanUtils.createMBean(cLoader);
}
Logger hLogger = context.getParent().getLogger();
Logger cLogger = context.getLogger();
if ((cLogger != null) && (cLogger != hLogger)) {
if (log.isDebugEnabled())
log.debug("Creating MBean for Logger " + cLogger);
//MBeanUtils.createMBean(cLogger);
}
Manager cManager = context.getManager();
if (cManager != null) {
if (log.isDebugEnabled())
log.debug("Creating MBean for Manager " + cManager);
//MBeanUtils.createMBean(cManager);
}
Realm hRealm = context.getParent().getRealm();
Realm cRealm = context.getRealm();
if ((cRealm != null) && (cRealm != hRealm)) {
if (log.isDebugEnabled())
log.debug("Creating MBean for Realm " + cRealm);
//MBeanUtils.createMBean(cRealm);
}
// Create the MBeans for the NamingResources (if any)
NamingResources resources = context.getNamingResources();
createMBeans(resources);
|
protected void | createMBeans(org.apache.catalina.deploy.ContextEnvironment environment)Create the MBeans for the specified ContextEnvironment entry.
// Create the MBean for the ContextEnvironment itself
if (log.isDebugEnabled()) {
log.debug("Creating MBean for ContextEnvironment " + environment);
}
MBeanUtils.createMBean(environment);
|
protected void | createMBeans(org.apache.catalina.deploy.ContextResource resource)Create the MBeans for the specified ContextResource entry.
// Create the MBean for the ContextResource itself
if (log.isDebugEnabled()) {
log.debug("Creating MBean for ContextResource " + resource);
}
MBeanUtils.createMBean(resource);
|
protected void | createMBeans(org.apache.catalina.deploy.ContextResourceLink resourceLink)Create the MBeans for the specified ContextResourceLink entry.
// Create the MBean for the ContextResourceLink itself
if (log.isDebugEnabled()) {
log.debug("Creating MBean for ContextResourceLink " + resourceLink);
}
MBeanUtils.createMBean(resourceLink);
|
protected void | createMBeans(org.apache.catalina.DefaultContext dcontext)Create the MBeans for the specified DefaultContext and its nested components.
// Create the MBean for the DefaultContext itself
if (log.isDebugEnabled())
log.debug("Creating MBean for DefaultContext " + dcontext);
MBeanUtils.createMBean(dcontext);
dcontext.addPropertyChangeListener(this);
// Create the MBeans for the associated nested components
Loader dLoader = dcontext.getLoader();
if (dLoader != null) {
if (log.isDebugEnabled())
log.debug("Creating MBean for Loader " + dLoader);
//MBeanUtils.createMBean(dLoader);
}
Manager dManager = dcontext.getManager();
if (dManager != null) {
if (log.isDebugEnabled())
log.debug("Creating MBean for Manager " + dManager);
//MBeanUtils.createMBean(dManager);
}
// Create the MBeans for the NamingResources (if any)
NamingResources resources = dcontext.getNamingResources();
createMBeans(resources);
|
protected void | createMBeans(org.apache.catalina.Engine engine)Create the MBeans for the specified Engine and its nested components.
// Create the MBean for the Engine itself
if (log.isDebugEnabled()) {
log.debug("Creating MBean for Engine " + engine);
}
//MBeanUtils.createMBean(engine);
engine.addContainerListener(this);
if (engine instanceof StandardEngine) {
((StandardEngine) engine).addPropertyChangeListener(this);
}
// Create the MBeans for the associated nested components
Logger eLogger = engine.getLogger();
if (eLogger != null) {
if (log.isDebugEnabled())
log.debug("Creating MBean for Logger " + eLogger);
//MBeanUtils.createMBean(eLogger);
}
Realm eRealm = engine.getRealm();
if (eRealm != null) {
if (log.isDebugEnabled())
log.debug("Creating MBean for Realm " + eRealm);
//MBeanUtils.createMBean(eRealm);
}
// Create the MBeans for each child Host
Container hosts[] = engine.findChildren();
for (int j = 0; j < hosts.length; j++) {
createMBeans((Host) hosts[j]);
}
// Create the MBeans for DefaultContext
DefaultContext dcontext = engine.getDefaultContext();
if (dcontext != null) {
dcontext.setParent(engine);
createMBeans(dcontext);
}
|
protected void | createMBeans(org.apache.catalina.Host host)Create the MBeans for the specified Host and its nested components.
// Create the MBean for the Host itself
if (log.isDebugEnabled()) {
log.debug("Creating MBean for Host " + host);
}
//MBeanUtils.createMBean(host);
host.addContainerListener(this);
if (host instanceof StandardHost) {
((StandardHost) host).addPropertyChangeListener(this);
}
// Create the MBeans for the associated nested components
Logger eLogger = host.getParent().getLogger();
Logger hLogger = host.getLogger();
if ((hLogger != null) && (hLogger != eLogger)) {
if (log.isDebugEnabled())
log.debug("Creating MBean for Logger " + hLogger);
//MBeanUtils.createMBean(hLogger);
}
Realm eRealm = host.getParent().getRealm();
Realm hRealm = host.getRealm();
if ((hRealm != null) && (hRealm != eRealm)) {
if (log.isDebugEnabled())
log.debug("Creating MBean for Realm " + hRealm);
//MBeanUtils.createMBean(hRealm);
}
// Create the MBeans for each child Context
Container contexts[] = host.findChildren();
for (int k = 0; k < contexts.length; k++) {
createMBeans((Context) contexts[k]);
}
// Create the MBeans for DefaultContext
DefaultContext dcontext = host.getDefaultContext();
if (dcontext != null) {
dcontext.setParent(host);
createMBeans(dcontext);
}
|
protected void | createMBeans(MBeanFactory factory)Create the MBeans for MBeanFactory.
// Create the MBean for the MBeanFactory
if (log.isDebugEnabled())
log.debug("Creating MBean for MBeanFactory " + factory);
MBeanUtils.createMBean(factory);
|
protected void | createMBeans(org.apache.catalina.deploy.NamingResources resources)Create the MBeans for the specified NamingResources and its
nested components.
// Create the MBean for the NamingResources itself
if (log.isDebugEnabled()) {
log.debug("Creating MBean for NamingResources " + resources);
}
MBeanUtils.createMBean(resources);
resources.addPropertyChangeListener(this);
// Create the MBeans for each child environment entry
ContextEnvironment environments[] = resources.findEnvironments();
for (int i = 0; i < environments.length; i++) {
createMBeans(environments[i]);
}
// Create the MBeans for each child resource entry
ContextResource cresources[] = resources.findResources();
for (int i = 0; i < cresources.length; i++) {
createMBeans(cresources[i]);
}
// Create the MBeans for each child resource link entry
ContextResourceLink cresourcelinks[] = resources.findResourceLinks();
for (int i = 0; i < cresourcelinks.length; i++) {
createMBeans(cresourcelinks[i]);
}
|
protected void | createMBeans(org.apache.catalina.Server server)Create the MBeans for the specified Server and its nested components.
// Create the MBean for the Server itself
if (log.isDebugEnabled())
log.debug("Creating MBean for Server " + server);
//MBeanUtils.createMBean(server);
if (server instanceof StandardServer) {
((StandardServer) server).addPropertyChangeListener(this);
}
// Create the MBeans for the global NamingResources (if any)
NamingResources resources = server.getGlobalNamingResources();
if (resources != null) {
createMBeans(resources);
}
// Create the MBeans for each child Service
Service services[] = server.findServices();
for (int i = 0; i < services.length; i++) {
// FIXME - Warp object hierarchy not currently supported
if (services[i].getContainer().getClass().getName().equals
("org.apache.catalina.connector.warp.WarpEngine")) {
if (log.isDebugEnabled()) {
log.debug("Skipping MBean for Service " + services[i]);
}
continue;
}
createMBeans(services[i]);
}
|
protected void | createMBeans(org.apache.catalina.Service service)Create the MBeans for the specified Service and its nested components.
// Create the MBean for the Service itself
if (log.isDebugEnabled())
log.debug("Creating MBean for Service " + service);
//MBeanUtils.createMBean(service);
if (service instanceof StandardService) {
((StandardService) service).addPropertyChangeListener(this);
}
// Create the MBeans for the corresponding Connectors
Connector connectors[] = service.findConnectors();
for (int j = 0; j < connectors.length; j++) {
createMBeans(connectors[j]);
}
// Create the MBean for the associated Engine and friends
Engine engine = (Engine) service.getContainer();
if (engine != null) {
createMBeans(engine);
}
|
protected void | destroyMBeans(org.apache.catalina.Connector connector, org.apache.catalina.Service service)Deregister the MBeans for the specified Connector and its nested
components.
// // deregister the MBean for the Connector itself
// if (log.isDebugEnabled())
// log.debug("Destroying MBean for Connector " + connector);
// MBeanUtils.destroyMBean(connector, service);
|
protected void | destroyMBeans(org.apache.catalina.Context context)Deregister the MBeans for the specified Context and its nested
components.
// Deregister ourselves as a ContainerListener
context.removeContainerListener(this);
// Destroy the MBeans for the associated nested components
Realm hRealm = context.getParent().getRealm();
Realm cRealm = context.getRealm();
if ((cRealm != null) && (cRealm != hRealm)) {
if (log.isDebugEnabled())
log.debug("Destroying MBean for Realm " + cRealm);
//MBeanUtils.destroyMBean(cRealm);
}
Manager cManager = context.getManager();
if (cManager != null) {
if (log.isDebugEnabled())
log.debug("Destroying MBean for Manager " + cManager);
//MBeanUtils.destroyMBean(cManager);
}
Logger hLogger = context.getParent().getLogger();
Logger cLogger = context.getLogger();
if ((cLogger != null) && (cLogger != hLogger)) {
if (log.isDebugEnabled())
log.debug("Destroying MBean for Logger " + cLogger);
//MBeanUtils.destroyMBean(cLogger);
}
Loader cLoader = context.getLoader();
if (cLoader != null) {
if (log.isDebugEnabled())
log.debug("Destroying MBean for Loader " + cLoader);
//MBeanUtils.destroyMBean(cLoader);
}
// Destroy the MBeans for the NamingResources (if any)
NamingResources resources = context.getNamingResources();
if (resources != null) {
destroyMBeans(resources);
}
// deregister the MBean for the Context itself
if (log.isDebugEnabled())
log.debug("Destroying MBean for Context " + context);
//MBeanUtils.destroyMBean(context);
if (context instanceof StandardContext) {
((StandardContext) context).
removePropertyChangeListener(this);
}
|
protected void | destroyMBeans(org.apache.catalina.deploy.ContextEnvironment environment)Deregister the MBeans for the specified ContextEnvironment entry.
// Destroy the MBean for the ContextEnvironment itself
if (log.isDebugEnabled()) {
log.debug("Destroying MBean for ContextEnvironment " + environment);
}
MBeanUtils.destroyMBean(environment);
|
protected void | destroyMBeans(org.apache.catalina.deploy.ContextResource resource)Deregister the MBeans for the specified ContextResource entry.
// Destroy the MBean for the ContextResource itself
if (log.isDebugEnabled()) {
log.debug("Destroying MBean for ContextResource " + resource);
}
MBeanUtils.destroyMBean(resource);
|
protected void | destroyMBeans(org.apache.catalina.deploy.ContextResourceLink resourceLink)Deregister the MBeans for the specified ContextResourceLink entry.
// Destroy the MBean for the ContextResourceLink itself
if (log.isDebugEnabled()) {
log.debug("Destroying MBean for ContextResourceLink " + resourceLink);
}
MBeanUtils.destroyMBean(resourceLink);
|
protected void | destroyMBeans(org.apache.catalina.DefaultContext dcontext)Deregister the MBeans for the specified DefaultContext and its nested
components.
Manager dManager = dcontext.getManager();
if (dManager != null) {
if (log.isDebugEnabled())
log.debug("Destroying MBean for Manager " + dManager);
//MBeanUtils.destroyMBean(dManager);
}
Loader dLoader = dcontext.getLoader();
if (dLoader != null) {
if (log.isDebugEnabled())
log.debug("Destroying MBean for Loader " + dLoader);
//MBeanUtils.destroyMBean(dLoader);
}
// Destroy the MBeans for the NamingResources (if any)
NamingResources resources = dcontext.getNamingResources();
if (resources != null) {
destroyMBeans(resources);
}
// deregister the MBean for the DefaultContext itself
if (log.isDebugEnabled())
log.debug("Destroying MBean for Context " + dcontext);
MBeanUtils.destroyMBean(dcontext);
dcontext.removePropertyChangeListener(this);
|
protected void | destroyMBeans(org.apache.catalina.Engine engine)Deregister the MBeans for the specified Engine and its nested
components.
// Deregister ourselves as a ContainerListener
engine.removeContainerListener(this);
// Deregister the MBeans for each child Host
Container hosts[] = engine.findChildren();
for (int k = 0; k < hosts.length; k++) {
destroyMBeans((Host) hosts[k]);
}
// Deregister the MBeans for the associated nested components
Realm eRealm = engine.getRealm();
if (eRealm != null) {
if (log.isDebugEnabled())
log.debug("Destroying MBean for Realm " + eRealm);
//MBeanUtils.destroyMBean(eRealm);
}
Logger eLogger = engine.getLogger();
if (eLogger != null) {
if (log.isDebugEnabled())
log.debug("Destroying MBean for Logger " + eLogger);
//MBeanUtils.destroyMBean(eLogger);
}
// Deregister the MBean for the Engine itself
if (log.isDebugEnabled()) {
log.debug("Destroying MBean for Engine " + engine);
}
//MBeanUtils.destroyMBean(engine);
|
protected void | destroyMBeans(org.apache.catalina.Host host)Deregister the MBeans for the specified Host and its nested components.
// Deregister ourselves as a ContainerListener
host.removeContainerListener(this);
// Deregister the MBeans for each child Context
Container contexts[] = host.findChildren();
for (int k = 0; k < contexts.length; k++) {
destroyMBeans((Context) contexts[k]);
}
// Deregister the MBeans for the associated nested components
Realm eRealm = host.getParent().getRealm();
Realm hRealm = host.getRealm();
if ((hRealm != null) && (hRealm != eRealm)) {
if (log.isDebugEnabled())
log.debug("Destroying MBean for Realm " + hRealm);
//MBeanUtils.destroyMBean(hRealm);
}
Logger eLogger = host.getParent().getLogger();
Logger hLogger = host.getLogger();
if ((hLogger != null) && (hLogger != eLogger)) {
if (log.isDebugEnabled())
log.debug("Destroying MBean for Logger " + hLogger);
//MBeanUtils.destroyMBean(hLogger);
}
// Deregister the MBean for the Host itself
if (log.isDebugEnabled()) {
log.debug("Destroying MBean for Host " + host);
}
//MBeanUtils.destroyMBean(host);
|
protected void | destroyMBeans(org.apache.catalina.deploy.NamingResources resources)Deregister the MBeans for the specified NamingResources and its
nested components.
// Destroy the MBeans for each child resource entry
ContextResource cresources[] = resources.findResources();
for (int i = 0; i < cresources.length; i++) {
destroyMBeans(cresources[i]);
}
// Destroy the MBeans for each child resource link entry
ContextResourceLink cresourcelinks[] = resources.findResourceLinks();
for (int i = 0; i < cresourcelinks.length; i++) {
destroyMBeans(cresourcelinks[i]);
}
// Destroy the MBeans for each child environment entry
ContextEnvironment environments[] = resources.findEnvironments();
for (int i = 0; i < environments.length; i++) {
destroyMBeans(environments[i]);
}
// Destroy the MBean for the NamingResources itself
if (log.isDebugEnabled()) {
log.debug("Destroying MBean for NamingResources " + resources);
}
MBeanUtils.destroyMBean(resources);
resources.removePropertyChangeListener(this);
|
protected void | destroyMBeans(org.apache.catalina.Server server)Deregister the MBeans for the specified Server and its related
components.
// Destroy the MBeans for the global NamingResources (if any)
NamingResources resources = server.getGlobalNamingResources();
if (resources != null) {
destroyMBeans(resources);
}
// Destroy the MBeans for each child Service
Service services[] = server.findServices();
for (int i = 0; i < services.length; i++) {
// FIXME - Warp object hierarchy not currently supported
if (services[i].getContainer().getClass().getName().equals
("org.apache.catalina.connector.warp.WarpEngine")) {
if (log.isDebugEnabled()) {
log.debug("Skipping MBean for Service " + services[i]);
}
continue;
}
destroyMBeans(services[i]);
}
// Destroy the MBean for the Server itself
if (log.isDebugEnabled()) {
log.debug("Destroying MBean for Server " + server);
}
//MBeanUtils.destroyMBean(server);
if (server instanceof StandardServer) {
((StandardServer) server).removePropertyChangeListener(this);
}
|
protected void | destroyMBeans(org.apache.catalina.Service service)Deregister the MBeans for the specified Service and its nested
components.
// Deregister the MBeans for the associated Engine
Engine engine = (Engine) service.getContainer();
if (engine != null) {
//destroyMBeans(engine);
}
// // Deregister the MBeans for the corresponding Connectors
// Connector connectors[] = service.findConnectors();
// for (int j = 0; j < connectors.length; j++) {
// destroyMBeans(connectors[j], service);
// }
// Deregister the MBean for the Service itself
if (log.isDebugEnabled()) {
log.debug("Destroying MBean for Service " + service);
}
//MBeanUtils.destroyMBean(service);
if (service instanceof StandardService) {
((StandardService) service).removePropertyChangeListener(this);
}
|
public java.lang.String | getAdaptor()
return (this.adaptor);
|
public java.lang.String | getAdaptorHost()
return (this.adaptorHost);
|
public int | getAdaptorPort()
return (this.adaptorPort);
|
public int | getDebug()
return (this.debug);
|
public java.lang.String | getDescriptors()
return (this.descriptors);
|
public void | lifecycleEvent(org.apache.catalina.LifecycleEvent event)Primary entry point for startup and shutdown events.
Lifecycle lifecycle = event.getLifecycle();
if (Lifecycle.START_EVENT.equals(event.getType())) {
if (lifecycle instanceof Server) {
// Loading additional MBean descriptors
loadMBeanDescriptors();
createMBeans();
if (adaptor != null) {
try {
MBeanUtils.createRMIAdaptor(adaptor, adaptorHost, adaptorPort);
} catch (Exception e) {
log.error("createAdaptor: Exception", e);
}
}
}
// We are embedded.
if( lifecycle instanceof Service ) {
try {
MBeanFactory factory = new MBeanFactory();
createMBeans(factory);
loadMBeanDescriptors();
createMBeans((Service)lifecycle);
} catch( Exception ex ) {
log.error("Create mbean factory");
}
}
/*
// Ignore events from StandardContext objects to avoid
// reregistering the context
if (lifecycle instanceof StandardContext)
return;
createMBeans();
*/
} else if (Lifecycle.STOP_EVENT.equals(event.getType())) {
try {
if (lifecycle instanceof Server) {
destroyMBeans((Server)lifecycle);
}
if (lifecycle instanceof Service) {
destroyMBeans((Service)lifecycle);
}
} catch (MBeanException t) {
Exception e = t.getTargetException();
if (e == null) {
e = t;
}
log.error("destroyMBeans: MBeanException", e);
} catch (Throwable t) {
log.error("destroyMBeans: Throwable", t);
}
// FIXME: RMI adaptor should be stopped; however, this is
// undocumented in MX4J, and reports exist in the MX4J bug DB that
// this doesn't work
}
if ((Context.RELOAD_EVENT.equals(event.getType()))
|| (Lifecycle.START_EVENT.equals(event.getType()))) {
// Give context a new handle to the MBean server if the
// context has been reloaded since reloading causes the
// context to lose its previous handle to the server
if (lifecycle instanceof StandardContext) {
// If the context is privileged, give a reference to it
// in a servlet context attribute
StandardContext context = (StandardContext)lifecycle;
if (context.getPrivileged()) {
context.getServletContext().setAttribute
(Globals.MBEAN_REGISTRY_ATTR,
MBeanUtils.createRegistry());
context.getServletContext().setAttribute
(Globals.MBEAN_SERVER_ATTR,
MBeanUtils.createServer());
}
}
}
|
protected void | loadMBeanDescriptors()Load additional MBean descriptor resources.
if (descriptors != null) {
StringTokenizer tokenizer = new StringTokenizer(descriptors, ";");
while (tokenizer.hasMoreTokens()) {
String resource = tokenizer.nextToken();
MBeanUtils.loadMBeanDescriptors(resource);
}
}
|
protected void | processContainerAddChild(org.apache.catalina.Container parent, org.apache.catalina.Container child)Process the addition of a new child Container to a parent Container.
if (log.isDebugEnabled())
log.debug("Process addChild[parent=" + parent + ",child=" + child + "]");
try {
if (child instanceof Context) {
createMBeans((Context) child);
} else if (child instanceof Engine) {
createMBeans((Engine) child);
} else if (child instanceof Host) {
createMBeans((Host) child);
}
} catch (MBeanException t) {
Exception e = t.getTargetException();
if (e == null)
e = t;
log.error("processContainerAddChild: MBeanException", e);
} catch (Throwable t) {
log.error("processContainerAddChild: Throwable", t);
}
|
protected void | processContainerPropertyChange(org.apache.catalina.Container container, java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)Process a property change event on a Container.
if (log.isTraceEnabled()) {
log.trace("propertyChange[container=" + container +
",propertyName=" + propertyName +
",oldValue=" + oldValue +
",newValue=" + newValue + "]");
}
if ("defaultContext".equals(propertyName)) {
if (oldValue != null) {
if (log.isDebugEnabled()) {
log.debug("Removing MBean for DefaultContext " + oldValue);
}
destroyMBeans((DefaultContext) oldValue);
}
if (newValue != null) {
if (log.isDebugEnabled()) {
log.debug("Creating MBean for DefaultContext " + newValue);
}
createMBeans((DefaultContext) newValue);
}
} else if ("loader".equals(propertyName)) {
if (oldValue != null) {
if (log.isDebugEnabled()) {
log.debug("Removing MBean for Loader " + oldValue);
}
MBeanUtils.destroyMBean((Loader) oldValue);
}
if (newValue != null) {
if (log.isDebugEnabled()) {
log.debug("Creating MBean for Loader " + newValue);
}
MBeanUtils.createMBean((Loader) newValue);
}
} else if ("logger".equals(propertyName)) {
if (oldValue != null) {
if (log.isDebugEnabled()) {
log.debug("Removing MBean for Logger " + oldValue);
}
// MBeanUtils.destroyMBean((Logger) oldValue);
}
if (newValue != null) {
if (log.isDebugEnabled()) {
log.debug("Creating MBean for Logger " + newValue);
}
//MBeanUtils.createMBean((Logger) newValue);
}
} else if ("manager".equals(propertyName)) {
if (oldValue != null) {
if (log.isDebugEnabled()) {
log.debug("Removing MBean for Manager " + oldValue);
}
//MBeanUtils.destroyMBean((Manager) oldValue);
}
if (newValue != null) {
if (log.isDebugEnabled()) {
log.debug("Creating MBean for Manager " + newValue);
}
//MBeanUtils.createMBean((Manager) newValue);
}
} else if ("realm".equals(propertyName)) {
if (oldValue != null) {
if (log.isDebugEnabled()) {
log.debug("Removing MBean for Realm " + oldValue);
}
MBeanUtils.destroyMBean((Realm) oldValue);
}
if (newValue != null) {
if (log.isDebugEnabled()) {
log.debug("Creating MBean for Realm " + newValue);
}
//MBeanUtils.createMBean((Realm) newValue);
}
} else if ("service".equals(propertyName)) {
if (oldValue != null) {
destroyMBeans((Service) oldValue);
}
if (newValue != null) {
createMBeans((Service) newValue);
}
}
|
protected void | processContainerRemoveChild(org.apache.catalina.Container parent, org.apache.catalina.Container child)Process the removal of a child Container from a parent Container.
if (log.isDebugEnabled())
log.debug("Process removeChild[parent=" + parent + ",child=" +
child + "]");
try {
if (child instanceof Context) {
Context context = (Context) child;
if (context.getPrivileged()) {
context.getServletContext().removeAttribute
(Globals.MBEAN_REGISTRY_ATTR);
context.getServletContext().removeAttribute
(Globals.MBEAN_SERVER_ATTR);
}
if (log.isDebugEnabled())
log.debug(" Removing MBean for Context " + context);
destroyMBeans(context);
if (context instanceof StandardContext) {
((StandardContext) context).
removePropertyChangeListener(this);
}
} else if (child instanceof Host) {
Host host = (Host) child;
destroyMBeans(host);
if (host instanceof StandardHost) {
((StandardHost) host).
removePropertyChangeListener(this);
}
}
} catch (MBeanException t) {
Exception e = t.getTargetException();
if (e == null)
e = t;
log.error("processContainerRemoveChild: MBeanException", e);
} catch (Throwable t) {
log.error("processContainerRemoveChild: Throwable", t);
}
|
protected void | processDefaultContextPropertyChange(org.apache.catalina.DefaultContext defaultContext, java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)Process a property change event on a DefaultContext.
if (log.isTraceEnabled()) {
log.trace("propertyChange[defaultContext=" + defaultContext +
",propertyName=" + propertyName +
",oldValue=" + oldValue +
",newValue=" + newValue + "]");
}
if ("loader".equals(propertyName)) {
if (oldValue != null) {
if (log.isDebugEnabled()) {
log.debug("Removing MBean for Loader " + oldValue);
}
MBeanUtils.destroyMBean((Loader) oldValue);
}
if (newValue != null) {
if (log.isDebugEnabled()) {
log.debug("Creating MBean for Loader " + newValue);
}
MBeanUtils.createMBean((Loader) newValue);
}
} else if ("logger".equals(propertyName)) {
if (oldValue != null) {
if (log.isDebugEnabled()) {
log.debug("Removing MBean for Logger " + oldValue);
}
//MBeanUtils.destroyMBean((Logger) oldValue);
}
if (newValue != null) {
if (log.isDebugEnabled()) {
log.debug("Creating MBean for Logger " + newValue);
}
//MBeanUtils.createMBean((Logger) newValue);
}
} else if ("manager".equals(propertyName)) {
if (oldValue != null) {
if (log.isDebugEnabled()) {
log.debug("Removing MBean for Manager " + oldValue);
}
MBeanUtils.destroyMBean((Manager) oldValue);
}
if (newValue != null) {
if (log.isDebugEnabled()) {
log.debug("Creating MBean for Manager " + newValue);
}
MBeanUtils.createMBean((Manager) newValue);
}
} else if ("realm".equals(propertyName)) {
if (oldValue != null) {
// if (log.isDebugEnabled()) {
// log.debug("Removing MBean for Realm " + oldValue);
// }
// //MBeanUtils.destroyMBean((Realm) oldValue);
}
if (newValue != null) {
// if (log.isDebugEnabled()) {
// log.debug("Creating MBean for Realm " + newValue);
// }
// //MBeanUtils.createMBean((Realm) newValue);
}
} else if ("service".equals(propertyName)) {
if (oldValue != null) {
destroyMBeans((Service) oldValue);
}
if (newValue != null) {
createMBeans((Service) newValue);
}
}
|
protected void | processNamingResourcesPropertyChange(org.apache.catalina.deploy.NamingResources resources, java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)Process a property change event on a NamingResources.
if (log.isTraceEnabled()) {
log.trace("propertyChange[namingResources=" + resources +
",propertyName=" + propertyName +
",oldValue=" + oldValue +
",newValue=" + newValue + "]");
}
// FIXME - Add other resource types when supported by admin tool
if ("environment".equals(propertyName)) {
if (oldValue != null) {
destroyMBeans((ContextEnvironment) oldValue);
}
if (newValue != null) {
createMBeans((ContextEnvironment) newValue);
}
} else if ("resource".equals(propertyName)) {
if (oldValue != null) {
destroyMBeans((ContextResource) oldValue);
}
if (newValue != null) {
createMBeans((ContextResource) newValue);
}
} else if ("resourceLink".equals(propertyName)) {
if (oldValue != null) {
destroyMBeans((ContextResourceLink) oldValue);
}
if (newValue != null) {
createMBeans((ContextResourceLink) newValue);
}
}
|
protected void | processServerPropertyChange(org.apache.catalina.Server server, java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)Process a property change event on a Server.
if (log.isTraceEnabled()) {
log.trace("propertyChange[server=" + server +
",propertyName=" + propertyName +
",oldValue=" + oldValue +
",newValue=" + newValue + "]");
}
if ("globalNamingResources".equals(propertyName)) {
if (oldValue != null) {
destroyMBeans((NamingResources) oldValue);
}
if (newValue != null) {
createMBeans((NamingResources) newValue);
}
} else if ("service".equals(propertyName)) {
if (oldValue != null) {
destroyMBeans((Service) oldValue);
}
if (newValue != null) {
createMBeans((Service) newValue);
}
}
|
protected void | processServicePropertyChange(org.apache.catalina.Service service, java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)Process a property change event on a Service.
if (log.isTraceEnabled()) {
log.trace("propertyChange[service=" + service +
",propertyName=" + propertyName +
",oldValue=" + oldValue +
",newValue=" + newValue + "]");
}
if ("connector".equals(propertyName)) {
if (oldValue != null) {
destroyMBeans((Connector) oldValue, service);
}
if (newValue != null) {
createMBeans((Connector) newValue);
}
} else if ("container".equals(propertyName)) {
if (oldValue != null) {
destroyMBeans((Engine) oldValue);
}
if (newValue != null) {
createMBeans((Engine) newValue);
}
}
|
public void | propertyChange(java.beans.PropertyChangeEvent event)Handle a PropertyChangeEvent from one of the Containers
we are interested in.
if (event.getSource() instanceof Container) {
try {
processContainerPropertyChange((Container) event.getSource(),
event.getPropertyName(),
event.getOldValue(),
event.getNewValue());
} catch (Exception e) {
log.error("Exception handling Container property change", e);
}
} else if (event.getSource() instanceof DefaultContext) {
try {
processDefaultContextPropertyChange
((DefaultContext) event.getSource(),
event.getPropertyName(),
event.getOldValue(),
event.getNewValue());
} catch (Exception e) {
log.error("Exception handling DefaultContext property change", e);
}
} else if (event.getSource() instanceof NamingResources) {
try {
processNamingResourcesPropertyChange
((NamingResources) event.getSource(),
event.getPropertyName(),
event.getOldValue(),
event.getNewValue());
} catch (Exception e) {
log.error("Exception handling NamingResources property change", e);
}
} else if (event.getSource() instanceof Server) {
try {
processServerPropertyChange((Server) event.getSource(),
event.getPropertyName(),
event.getOldValue(),
event.getNewValue());
} catch (Exception e) {
log.error("Exception handing Server property change", e);
}
} else if (event.getSource() instanceof Service) {
try {
processServicePropertyChange((Service) event.getSource(),
event.getPropertyName(),
event.getOldValue(),
event.getNewValue());
} catch (Exception e) {
log.error("Exception handing Service property change", e);
}
}
|
public void | setAdaptor(java.lang.String adaptor)
this.adaptor = adaptor;
|
public void | setAdaptorHost(java.lang.String adaptorHost)
this.adaptorHost = adaptorHost;
|
public void | setAdaptorPort(int adaptorPort)
this.adaptorPort = adaptorPort;
|
public void | setDebug(int debug)
this.debug = debug;
|
public void | setDescriptors(java.lang.String descriptors)
this.descriptors = descriptors;
|