Methods Summary |
---|
static javax.management.modelmbean.ModelMBean | createMBean(org.apache.catalina.Group group)Create, register, and return an MBean for this
Group object.
String mname = createManagedName(group);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
Exception e = new Exception("ManagedBean is not found with "+mname);
throw new MBeanException(e);
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ModelMBean mbean = managed.createMBean(group);
ObjectName oname = createObjectName(domain, group);
if( mserver.isRegistered( oname )) {
mserver.unregisterMBean(oname);
}
mserver.registerMBean(mbean, oname);
return (mbean);
|
static javax.management.modelmbean.ModelMBean | createMBean(org.apache.catalina.Host host)Create, register, and return an MBean for this
Host object.
String mname = createManagedName(host);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
Exception e = new Exception("ManagedBean is not found with "+mname);
throw new MBeanException(e);
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ModelMBean mbean = managed.createMBean(host);
ObjectName oname = createObjectName(domain, host);
if( mserver.isRegistered( oname )) {
mserver.unregisterMBean(oname);
}
mserver.registerMBean(mbean, oname);
return (mbean);
|
static javax.management.modelmbean.ModelMBean | createMBean(org.apache.catalina.Loader loader)Create, register, and return an MBean for this
Loader object.
String mname = createManagedName(loader);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
Exception e = new Exception("ManagedBean is not found with "+mname);
throw new MBeanException(e);
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ModelMBean mbean = managed.createMBean(loader);
ObjectName oname = createObjectName(domain, loader);
if( mserver.isRegistered( oname )) {
// side effect: stop it
mserver.unregisterMBean( oname );
}
mserver.registerMBean(mbean, oname);
return (mbean);
|
static javax.management.modelmbean.ModelMBean | createMBean(org.apache.catalina.Logger logger)Create, register, and return an MBean for this
Logger object.
String mname = createManagedName(logger);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
Exception e = new Exception("ManagedBean is not found with "+mname);
throw new MBeanException(e);
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ModelMBean mbean = managed.createMBean(logger);
ObjectName oname = createObjectName(domain, logger);
if( mserver.isRegistered( oname )) {
mserver.unregisterMBean(oname);
}
mserver.registerMBean(mbean, oname);
return (mbean);
|
static javax.management.modelmbean.ModelMBean | createMBean(org.apache.catalina.Manager manager)Create, register, and return an MBean for this
Manager object.
String mname = createManagedName(manager);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
Exception e = new Exception("ManagedBean is not found with "+mname);
throw new MBeanException(e);
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ModelMBean mbean = managed.createMBean(manager);
ObjectName oname = createObjectName(domain, manager);
if( mserver.isRegistered( oname )) {
mserver.unregisterMBean(oname);
}
mserver.registerMBean(mbean, oname);
return (mbean);
|
static javax.management.modelmbean.ModelMBean | createMBean(MBeanFactory factory)Create, register, and return an MBean for this
MBeanFactory object.
String mname = createManagedName(factory);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
Exception e = new Exception("ManagedBean is not found with "+mname);
throw new MBeanException(e);
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ModelMBean mbean = managed.createMBean(factory);
ObjectName oname = createObjectName(domain, factory);
if( mserver.isRegistered(oname )) {
mserver.unregisterMBean(oname);
}
mserver.registerMBean(mbean, oname);
return (mbean);
|
static javax.management.modelmbean.ModelMBean | createMBean(org.apache.catalina.deploy.NamingResources resource)Create, register, and return an MBean for this
NamingResources object.
String mname = createManagedName(resource);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
Exception e = new Exception("ManagedBean is not found with "+mname);
throw new MBeanException(e);
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ModelMBean mbean = managed.createMBean(resource);
ObjectName oname = createObjectName(domain, resource);
if( mserver.isRegistered( oname )) {
mserver.unregisterMBean(oname);
}
mserver.registerMBean(mbean, oname);
return (mbean);
|
static javax.management.modelmbean.ModelMBean | createMBean(org.apache.catalina.Realm realm)Create, register, and return an MBean for this
Realm object.
String mname = createManagedName(realm);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
Exception e = new Exception("ManagedBean is not found with "+mname);
throw new MBeanException(e);
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ModelMBean mbean = managed.createMBean(realm);
ObjectName oname = createObjectName(domain, realm);
if( mserver.isRegistered( oname )) {
mserver.unregisterMBean(oname);
}
mserver.registerMBean(mbean, oname);
return (mbean);
|
static javax.management.modelmbean.ModelMBean | createMBean(org.apache.catalina.Role role)Create, register, and return an MBean for this
Role object.
String mname = createManagedName(role);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
Exception e = new Exception("ManagedBean is not found with "+mname);
throw new MBeanException(e);
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ModelMBean mbean = managed.createMBean(role);
ObjectName oname = createObjectName(domain, role);
if( mserver.isRegistered( oname )) {
mserver.unregisterMBean(oname);
}
mserver.registerMBean(mbean, oname);
return (mbean);
|
static javax.management.modelmbean.ModelMBean | createMBean(org.apache.catalina.Server server)Create, register, and return an MBean for this
Server object.
String mname = createManagedName(server);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
Exception e = new Exception("ManagedBean is not found with "+mname);
throw new MBeanException(e);
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ModelMBean mbean = managed.createMBean(server);
ObjectName oname = createObjectName(domain, server);
if( mserver.isRegistered( oname )) {
mserver.unregisterMBean(oname);
}
mserver.registerMBean(mbean, oname);
return (mbean);
|
static javax.management.modelmbean.ModelMBean | createMBean(org.apache.catalina.Service service)Create, register, and return an MBean for this
Service object.
String mname = createManagedName(service);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
Exception e = new Exception("ManagedBean is not found with "+mname);
throw new MBeanException(e);
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ModelMBean mbean = managed.createMBean(service);
ObjectName oname = createObjectName(domain, service);
if( mserver.isRegistered( oname )) {
mserver.unregisterMBean(oname);
}
mserver.registerMBean(mbean, oname);
return (mbean);
|
static javax.management.modelmbean.ModelMBean | createMBean(org.apache.catalina.User user)Create, register, and return an MBean for this
User object.
String mname = createManagedName(user);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
Exception e = new Exception("ManagedBean is not found with "+mname);
throw new MBeanException(e);
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ModelMBean mbean = managed.createMBean(user);
ObjectName oname = createObjectName(domain, user);
if( mserver.isRegistered( oname )) {
mserver.unregisterMBean(oname);
}
mserver.registerMBean(mbean, oname);
return (mbean);
|
static javax.management.modelmbean.ModelMBean | createMBean(org.apache.catalina.UserDatabase userDatabase)Create, register, and return an MBean for this
UserDatabase object.
String mname = createManagedName(userDatabase);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
Exception e = new Exception("ManagedBean is not found with "+mname);
throw new MBeanException(e);
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ModelMBean mbean = managed.createMBean(userDatabase);
ObjectName oname = createObjectName(domain, userDatabase);
if( mserver.isRegistered( oname )) {
mserver.unregisterMBean(oname);
}
mserver.registerMBean(mbean, oname);
return (mbean);
|
static javax.management.modelmbean.ModelMBean | createMBean(org.apache.catalina.Valve valve)Create, register, and return an MBean for this
Valve object.
String mname = createManagedName(valve);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
Exception e = new Exception("ManagedBean is not found with "+mname);
throw new MBeanException(e);
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ModelMBean mbean = managed.createMBean(valve);
ObjectName oname = createObjectName(domain, valve);
if( mserver.isRegistered( oname )) {
mserver.unregisterMBean(oname);
}
mserver.registerMBean(mbean, oname);
return (mbean);
|
static javax.management.modelmbean.ModelMBean | createMBean(org.apache.catalina.Connector connector)Create, register, and return an MBean for this
Connector object.
String mname = createManagedName(connector);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
Exception e = new Exception("ManagedBean is not found with "+mname);
throw new MBeanException(e);
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ModelMBean mbean = managed.createMBean(connector);
ObjectName oname = createObjectName(domain, connector);
if( mserver.isRegistered( oname )) {
mserver.unregisterMBean(oname);
}
mserver.registerMBean(mbean, oname);
return (mbean);
|
static javax.management.modelmbean.ModelMBean | createMBean(org.apache.catalina.Context context)Create, register, and return an MBean for this
Context object.
String mname = createManagedName(context);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
Exception e = new Exception("ManagedBean is not found with "+mname);
throw new MBeanException(e);
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ModelMBean mbean = managed.createMBean(context);
ObjectName oname = createObjectName(domain, context);
if( mserver.isRegistered(oname)) {
log.debug("Already registered " + oname);
mserver.unregisterMBean(oname);
}
mserver.registerMBean(mbean, oname);
return (mbean);
|
static javax.management.modelmbean.ModelMBean | createMBean(org.apache.catalina.deploy.ContextEnvironment environment)Create, register, and return an MBean for this
ContextEnvironment object.
String mname = createManagedName(environment);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
Exception e = new Exception("ManagedBean is not found with "+mname);
throw new MBeanException(e);
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ModelMBean mbean = managed.createMBean(environment);
ObjectName oname = createObjectName(domain, environment);
if( mserver.isRegistered( oname )) {
mserver.unregisterMBean(oname);
}
mserver.registerMBean(mbean, oname);
return (mbean);
|
static javax.management.modelmbean.ModelMBean | createMBean(org.apache.catalina.deploy.ContextResource resource)Create, register, and return an MBean for this
ContextResource object.
String mname = createManagedName(resource);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
Exception e = new Exception("ManagedBean is not found with "+mname);
throw new MBeanException(e);
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ModelMBean mbean = managed.createMBean(resource);
ObjectName oname = createObjectName(domain, resource);
if( mserver.isRegistered( oname )) {
mserver.unregisterMBean(oname);
}
mserver.registerMBean(mbean, oname);
return (mbean);
|
static javax.management.modelmbean.ModelMBean | createMBean(org.apache.catalina.deploy.ContextResourceLink resourceLink)Create, register, and return an MBean for this
ContextResourceLink object.
String mname = createManagedName(resourceLink);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
Exception e = new Exception("ManagedBean is not found with "+mname);
throw new MBeanException(e);
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ModelMBean mbean = managed.createMBean(resourceLink);
ObjectName oname = createObjectName(domain, resourceLink);
if( mserver.isRegistered( oname )) {
mserver.unregisterMBean(oname);
}
mserver.registerMBean(mbean, oname);
return (mbean);
|
static javax.management.modelmbean.ModelMBean | createMBean(org.apache.catalina.DefaultContext context)Create, register, and return an MBean for this
DefaultContext object.
String mname = createManagedName(context);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
Exception e = new Exception("ManagedBean is not found with "+mname);
throw new MBeanException(e);
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ModelMBean mbean = managed.createMBean(context);
ObjectName oname = createObjectName(domain, context);
if( mserver.isRegistered( oname )) {
mserver.unregisterMBean(oname);
}
mserver.registerMBean(mbean, oname);
return (mbean);
|
static javax.management.modelmbean.ModelMBean | createMBean(org.apache.catalina.Engine engine)Create, register, and return an MBean for this
Engine object.
String mname = createManagedName(engine);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
Exception e = new Exception("ManagedBean is not found with "+mname);
throw new MBeanException(e);
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ModelMBean mbean = managed.createMBean(engine);
ObjectName oname = createObjectName(domain, engine);
if( mserver.isRegistered( oname )) {
mserver.unregisterMBean(oname);
}
mserver.registerMBean(mbean, oname);
return (mbean);
|
static java.lang.String | createManagedName(java.lang.Object component)Create and return the name of the ManagedBean that
corresponds to this Catalina component.
// Deal with exceptions to the standard rule
String className = component.getClass().getName();
for (int i = 0; i < exceptions.length; i++) {
if (className.equals(exceptions[i][0])) {
return (exceptions[i][1]);
}
}
// Perform the standard transformation
int period = className.lastIndexOf('.");
if (period >= 0)
className = className.substring(period + 1);
return (className);
|
static javax.management.ObjectName | createObjectName(java.lang.String domain, org.apache.catalina.Connector connector)Create an ObjectName for this
Connector object.
ObjectName name = null;
if (connector.getClass().getName().indexOf("CoyoteConnector") >= 0 ) {
try {
String address = (String)
PropertyUtils.getSimpleProperty(connector, "address");
Integer port = (Integer)
PropertyUtils.getSimpleProperty(connector, "port");
Service service = connector.getService();
String serviceName = null;
if (service != null)
serviceName = service.getName();
StringBuffer sb = new StringBuffer(domain);
sb.append(":type=Connector");
sb.append(",port=" + port);
if ((address != null) && (address.length()>0)) {
sb.append(",address=" + address);
}
name = new ObjectName(sb.toString());
return (name);
} catch (Exception e) {
throw new MalformedObjectNameException
("Cannot create object name for " + connector+e);
}
} else {
throw new MalformedObjectNameException
("Cannot create object name for " + connector);
}
|
static javax.management.ObjectName | createObjectName(java.lang.String domain, org.apache.catalina.Context context)Create an ObjectName for this
Context object.
ObjectName name = null;
Host host = (Host)context.getParent();
Service service = ((Engine)host.getParent()).getService();
String path = context.getPath();
if (path.length() < 1)
path = "/";
// FIXME
name = new ObjectName(domain + ":j2eeType=WebModule,name=//" +
host.getName()+ path +
",J2EEApplication=none,J2EEServer=none");
return (name);
|
public static javax.management.ObjectName | createObjectName(java.lang.String domain, org.apache.catalina.deploy.ContextEnvironment environment)Create an ObjectName for this
Service object.
ObjectName name = null;
Object container =
environment.getNamingResources().getContainer();
if (container instanceof Server) {
name = new ObjectName(domain + ":type=Environment" +
",resourcetype=Global,name=" + environment.getName());
} else if (container instanceof Context) {
String path = ((Context)container).getPath();
if (path.length() < 1)
path = "/";
Host host = (Host) ((Context)container).getParent();
Engine engine = (Engine) host.getParent();
Service service = engine.getService();
name = new ObjectName(domain + ":type=Environment" +
",resourcetype=Context,path=" + path +
",host=" + host.getName() +
",name=" + environment.getName());
} else if (container instanceof DefaultContext) {
container = ((DefaultContext)container).getParent();
if (container instanceof Host) {
Host host = (Host) container;
Service service = ((Engine)host.getParent()).getService();
name = new ObjectName(domain + ":type=Environment" +
",resourcetype=HostDefaultContext,host=" + host.getName() +
",name=" + environment.getName());
} else if (container instanceof Engine) {
Engine engine = (Engine) container;
Service service = engine.getService();
name = new ObjectName(domain + ":type=Environment" +
",resourcetype=ServiceDefaultContext,name=" + environment.getName());
}
}
return (name);
|
public static javax.management.ObjectName | createObjectName(java.lang.String domain, org.apache.catalina.deploy.ContextResource resource)Create an ObjectName for this
ContextResource object.
ObjectName name = null;
String encodedResourceName = encodeStr(resource.getName());
Object container =
resource.getNamingResources().getContainer();
if (container instanceof Server) {
name = new ObjectName(domain + ":type=Resource" +
",resourcetype=Global,class=" + resource.getType() +
",name=" + encodedResourceName);
} else if (container instanceof Context) {
String path = ((Context)container).getPath();
if (path.length() < 1)
path = "/";
Host host = (Host) ((Context)container).getParent();
Engine engine = (Engine) host.getParent();
Service service = engine.getService();
name = new ObjectName(domain + ":type=Resource" +
",resourcetype=Context,path=" + path +
",host=" + host.getName() +
",class=" + resource.getType() +
",name=" + encodedResourceName);
} else if (container instanceof DefaultContext) {
container = ((DefaultContext)container).getParent();
if (container instanceof Host) {
Host host = (Host) container;
Service service = ((Engine)host.getParent()).getService();
name = new ObjectName(domain + ":type=Resource" +
",resourcetype=HostDefaultContext,host=" + host.getName() +
",class=" + resource.getType() +
",name=" + encodedResourceName);
} else if (container instanceof Engine) {
Engine engine = (Engine) container;
Service service = engine.getService();
name = new ObjectName(domain + ":type=Resource" +
",resourcetype=ServiceDefaultContext,class=" + resource.getType() +
",name=" + encodedResourceName);
}
}
return (name);
|
public static javax.management.ObjectName | createObjectName(java.lang.String domain, org.apache.catalina.deploy.ContextResourceLink resourceLink)Create an ObjectName for this
ContextResourceLink object.
ObjectName name = null;
String encodedResourceLinkName = encodeStr(resourceLink.getName());
Object container =
resourceLink.getNamingResources().getContainer();
if (container instanceof Server) {
name = new ObjectName(domain + ":type=ResourceLink" +
",resourcetype=Global" +
",name=" + encodedResourceLinkName);
} else if (container instanceof Context) {
String path = ((Context)container).getPath();
if (path.length() < 1)
path = "/";
Host host = (Host) ((Context)container).getParent();
Engine engine = (Engine) host.getParent();
Service service = engine.getService();
name = new ObjectName(domain + ":type=ResourceLink" +
",resourcetype=Context,path=" + path +
",host=" + host.getName() +
",name=" + encodedResourceLinkName);
} else if (container instanceof DefaultContext) {
container = ((DefaultContext)container).getParent();
if (container instanceof Host) {
Host host = (Host) container;
Service service = ((Engine)host.getParent()).getService();
name = new ObjectName(domain + ":type=ResourceLink" +
",resourcetype=HostDefaultContext,host=" + host.getName() +
",name=" + encodedResourceLinkName);
} else if (container instanceof Engine) {
Engine engine = (Engine) container;
Service service = engine.getService();
name = new ObjectName(domain + ":type=ResourceLink" +
",resourcetype=ServiceDefaultContext,name=" + encodedResourceLinkName);
}
}
return (name);
|
static javax.management.ObjectName | createObjectName(java.lang.String domain, org.apache.catalina.DefaultContext context)Create an ObjectName for this
DefaultContext object.
ObjectName name = null;
Container container = context.getParent();
if (container instanceof Host) {
Host host = (Host) container;
Service service = ((Engine)host.getParent()).getService();
name = new ObjectName(domain + ":type=DefaultContext,host=" +
host.getName());
} else if (container instanceof Engine) {
Engine engine = (Engine) container;
Service service = engine.getService();
name = new ObjectName(domain + ":type=DefaultContext");
}
return (name);
|
static javax.management.ObjectName | createObjectName(java.lang.String domain, org.apache.catalina.Engine engine)Create an ObjectName for this
Engine object.
ObjectName name = null;
name = new ObjectName(domain + ":type=Engine");
return (name);
|
static javax.management.ObjectName | createObjectName(java.lang.String domain, org.apache.catalina.Group group)Create an ObjectName for this
Group object.
ObjectName name = null;
name = new ObjectName(domain + ":type=Group,groupname=" +
group.getGroupname() + ",database=" +
group.getUserDatabase().getId());
return (name);
|
static javax.management.ObjectName | createObjectName(java.lang.String domain, org.apache.catalina.Host host)Create an ObjectName for this
Host object.
ObjectName name = null;
Engine engine = (Engine)host.getParent();
Service service = engine.getService();
name = new ObjectName(domain + ":type=Host,host=" +
host.getName());
return (name);
|
static javax.management.ObjectName | createObjectName(java.lang.String domain, org.apache.catalina.Loader loader)Create an ObjectName for this
Loader object.
ObjectName name = null;
Container container = loader.getContainer();
if (container instanceof Engine) {
Service service = ((Engine)container).getService();
name = new ObjectName(domain + ":type=Loader");
} else if (container instanceof Host) {
Engine engine = (Engine) container.getParent();
Service service = engine.getService();
name = new ObjectName(domain + ":type=Loader,host=" +
container.getName());
} else if (container instanceof Context) {
String path = ((Context)container).getPath();
if (path.length() < 1) {
path = "/";
}
Host host = (Host) container.getParent();
Engine engine = (Engine) host.getParent();
Service service = engine.getService();
name = new ObjectName(domain + ":type=Loader,path=" + path +
",host=" + host.getName());
} else if (container == null) {
// What is that ???
DefaultContext defaultContext = loader.getDefaultContext();
if (defaultContext != null) {
Container parent = defaultContext.getParent();
if (parent instanceof Engine) {
Service service = ((Engine)parent).getService();
name = new ObjectName(domain + ":type=DefaultLoader");
} else if (parent instanceof Host) {
Engine engine = (Engine) parent.getParent();
Service service = engine.getService();
name = new ObjectName(domain + ":type=DefaultLoader,host=" +
parent.getName());
}
}
}
return (name);
|
static javax.management.ObjectName | createObjectName(java.lang.String domain, org.apache.catalina.Logger logger)Create an ObjectName for this
Logger object.
ObjectName name = null;
Container container = logger.getContainer();
if (container instanceof Engine) {
Service service = ((Engine)container).getService();
name = new ObjectName(domain + ":type=Logger");
} else if (container instanceof Host) {
Engine engine = (Engine) container.getParent();
Service service = engine.getService();
name = new ObjectName(domain + ":type=Logger,host=" +
container.getName());
} else if (container instanceof Context) {
String path = ((Context)container).getPath();
if (path.length() < 1) {
path = "/";
}
Host host = (Host) container.getParent();
Engine engine = (Engine) host.getParent();
Service service = engine.getService();
name = new ObjectName(domain + ":type=Logger,path=" + path +
",host=" + host.getName());
}
return (name);
|
static javax.management.ObjectName | createObjectName(java.lang.String domain, org.apache.catalina.Manager manager)Create an ObjectName for this
Manager object.
ObjectName name = null;
Container container = manager.getContainer();
if (container instanceof Engine) {
Service service = ((Engine)container).getService();
name = new ObjectName(domain + ":type=Manager");
} else if (container instanceof Host) {
Engine engine = (Engine) container.getParent();
Service service = engine.getService();
name = new ObjectName(domain + ":type=Manager,host=" +
container.getName());
} else if (container instanceof Context) {
String path = ((Context)container).getPath();
if (path.length() < 1) {
path = "/";
}
Host host = (Host) container.getParent();
Engine engine = (Engine) host.getParent();
Service service = engine.getService();
name = new ObjectName(domain + ":type=Manager,path=" + path +
",host=" + host.getName());
} else if (container == null) {
DefaultContext defaultContext = manager.getDefaultContext();
if (defaultContext != null) {
Container parent = defaultContext.getParent();
if (parent instanceof Engine) {
Service service = ((Engine)parent).getService();
name = new ObjectName(domain + ":type=DefaultManager");
} else if (parent instanceof Host) {
Engine engine = (Engine) parent.getParent();
Service service = engine.getService();
name = new ObjectName(domain + ":type=DefaultManager,host=" +
parent.getName());
}
}
}
return (name);
|
static javax.management.ObjectName | createObjectName(java.lang.String domain, org.apache.catalina.deploy.NamingResources resources)Create an ObjectName for this
Server object.
ObjectName name = null;
Object container = resources.getContainer();
if (container instanceof Server) {
name = new ObjectName(domain + ":type=NamingResources" +
",resourcetype=Global");
} else if (container instanceof Context) {
String path = ((Context)container).getPath();
if (path.length() < 1)
path = "/";
Host host = (Host) ((Context)container).getParent();
Engine engine = (Engine) host.getParent();
Service service = engine.getService();
name = new ObjectName(domain + ":type=NamingResources" +
",resourcetype=Context,path=" + path +
",host=" + host.getName());
} else if (container instanceof DefaultContext) {
container = ((DefaultContext)container).getParent();
if (container instanceof Host) {
Host host = (Host) container;
Service service = ((Engine)host.getParent()).getService();
name = new ObjectName(domain + ":type=NamingResources" +
",resourcetype=HostDefaultContext,host=" + host.getName());
} else if (container instanceof Engine) {
Engine engine = (Engine) container;
Service service = engine.getService();
name = new ObjectName(domain + ":type=NamingResources" +
",resourcetype=ServiceDefaultContext");
}
}
return (name);
|
static javax.management.ObjectName | createObjectName(java.lang.String domain, MBeanFactory factory)Create an ObjectName for this
MBeanFactory object.
ObjectName name = new ObjectName(domain + ":type=MBeanFactory");
return (name);
|
static javax.management.ObjectName | createObjectName(java.lang.String domain, org.apache.catalina.Realm realm)Create an ObjectName for this
Realm object.
ObjectName name = null;
Container container = realm.getContainer();
if (container instanceof Engine) {
Service service = ((Engine)container).getService();
name = new ObjectName(domain + ":type=Realm");
} else if (container instanceof Host) {
Engine engine = (Engine) container.getParent();
Service service = engine.getService();
name = new ObjectName(domain + ":type=Realm,host=" +
container.getName());
} else if (container instanceof Context) {
String path = ((Context)container).getPath();
if (path.length() < 1) {
path = "/";
}
Host host = (Host) container.getParent();
Engine engine = (Engine) host.getParent();
Service service = engine.getService();
name = new ObjectName(domain + ":type=Realm,path=" + path +
",host=" + host.getName());
}
return (name);
|
static javax.management.ObjectName | createObjectName(java.lang.String domain, org.apache.catalina.Role role)Create an ObjectName for this
Role object.
ObjectName name = null;
name = new ObjectName(domain + ":type=Role,rolename=" +
role.getRolename() + ",database=" +
role.getUserDatabase().getId());
return (name);
|
static javax.management.ObjectName | createObjectName(java.lang.String domain, org.apache.catalina.Server server)Create an ObjectName for this
Server object.
ObjectName name = null;
name = new ObjectName(domain + ":type=Server");
return (name);
|
static javax.management.ObjectName | createObjectName(java.lang.String domain, org.apache.catalina.Service service)Create an ObjectName for this
Service object.
ObjectName name = null;
name = new ObjectName(domain + ":type=Service,serviceName=" +
service.getName());
return (name);
|
static javax.management.ObjectName | createObjectName(java.lang.String domain, org.apache.catalina.User user)Create an ObjectName for this
User object.
ObjectName name = null;
name = new ObjectName(domain + ":type=User,username=" +
user.getUsername() + ",database=" +
user.getUserDatabase().getId());
return (name);
|
static javax.management.ObjectName | createObjectName(java.lang.String domain, org.apache.catalina.UserDatabase userDatabase)Create an ObjectName for this
UserDatabase object.
ObjectName name = null;
name = new ObjectName(domain + ":type=UserDatabase,database=" +
userDatabase.getId());
return (name);
|
static javax.management.ObjectName | createObjectName(java.lang.String domain, org.apache.catalina.Valve valve)Create an ObjectName for this
Valve object.
if( valve instanceof ValveBase ) {
ObjectName name=((ValveBase)valve).getObjectName();
if( name != null )
return name;
}
ObjectName name = null;
Container container = null;
String className=valve.getClass().getName();
int period = className.lastIndexOf('.");
if (period >= 0)
className = className.substring(period + 1);
if( valve instanceof Contained ) {
container = ((Contained)valve).getContainer();
}
if( container == null ) {
throw new MalformedObjectNameException(
"Cannot create mbean for non-contained valve " +
valve);
}
if (container instanceof Engine) {
Service service = ((Engine)container).getService();
String local="";
int seq = getSeq(local);
String ext="";
if( seq > 0 ) {
ext=",seq=" + seq;
}
name = new ObjectName(domain + ":type=Valve,name=" + className +
ext + local );
} else if (container instanceof Host) {
Service service = ((Engine)container.getParent()).getService();
String local=",host=" +container.getName();
int seq = getSeq(local);
String ext="";
if( seq > 0 ) {
ext=",seq=" + seq;
}
name = new ObjectName(domain + ":type=Valve,name=" + className +
ext + local );
} else if (container instanceof Context) {
String path = ((Context)container).getPath();
if (path.length() < 1) {
path = "/";
}
Host host = (Host) container.getParent();
Service service = ((Engine) host.getParent()).getService();
String local=",path=" + path + ",host=" +
host.getName();
int seq = getSeq(local);
String ext="";
if( seq > 0 ) {
ext=",seq=" + seq;
}
name = new ObjectName(domain + ":type=Valve,name=" + className +
ext + local );
}
return (name);
|
public static void | createRMIAdaptor(java.lang.String adaptorType, java.lang.String host, int port)Create a RMI adapter [MX4J specific].
String namingProviderObjectName = null;
String namingProviderClassName = null;
String adaptorObjectName = null;
String adaptorClassName = null;
String adaptorMbeanClassName = null;
boolean delay = false;
String jndiName = "jrmp";
String contextFactory = null;
String providerUrl = null;
if ((host == null) || (host.trim().length() == 0))
host = "localhost";
if (adaptorType.equals("jrmp")) {
namingProviderObjectName = "Naming:type=rmiregistry";
namingProviderClassName = "mx4j.tools.naming.NamingService";
adaptorObjectName = "Adaptor:protocol=JRMP";
adaptorClassName = "mx4j.adaptor.rmi.jrmp.JRMPAdaptor";
adaptorMbeanClassName = "mx4j.adaptor.rmi.jrmp.JRMPAdaptorMBean";
contextFactory =
"com.sun.jndi.rmi.registry.RegistryContextFactory";
if (port == -1)
port = 1099;
providerUrl = "rmi://" + host + ":" + Integer.toString(port);
} else if (adaptorType.equals("iiop")) {
namingProviderObjectName = "Naming:type=tnameserv";
namingProviderClassName = "mx4j.tools.naming.CosNamingService";
delay = true;
adaptorObjectName = "Adaptor:protocol=IIOP";
adaptorClassName = "mx4j.adaptor.rmi.iiop.IIOPAdaptor";
adaptorMbeanClassName = "mx4j.adaptor.rmi.iiop.IIOPAdaptorMBean";
contextFactory = "com.sun.jndi.cosnaming.CNCtxFactory";
if (port == -1)
port = 900;
providerUrl = "iiop://" + host + ":" + Integer.toString(port);
} else {
throw new IllegalArgumentException("Unknown adaptor type");
}
// Create and start the naming service
ObjectName naming = new ObjectName(namingProviderObjectName);
mserver.createMBean(namingProviderClassName, naming, null);
if (delay) {
mserver.setAttribute(naming, new Attribute
("Delay", Integer.valueOf(5000)));
}
mserver.invoke(naming, "start", null, null);
// Create the JRMP adaptor
ObjectName adaptor = new ObjectName(adaptorObjectName);
mserver.createMBean(adaptorClassName, adaptor, null);
Class proxyClass = Class.forName("mx4j.util.StandardMBeanProxy");
Object args[] = null;
Class types[] = null;
Method method = null;
types = new Class[3];
types[0] = Class.class;
types[1] = MBeanServer.class;
types[2] = ObjectName.class;
args = new Object[3];
args[0] = Class.forName(adaptorMbeanClassName);
args[1] = mserver;
args[2] = adaptor;
method = proxyClass.getMethod("create", types);
Object bean = method.invoke(null, args);
Class beanClass = bean.getClass();
args = new Object[1];
args[0] = jndiName;
types = new Class[1];
types[0] = String.class;
method = beanClass.getMethod("setJNDIName", types);
method.invoke(bean, args);
args = new Object[2];
types = new Class[2];
types[0] = Object.class;
types[1] = Object.class;
method = beanClass.getMethod("putJNDIProperty", types);
args[0] = javax.naming.Context.INITIAL_CONTEXT_FACTORY;
args[1] = contextFactory;
method.invoke(bean, args);
args[0] = javax.naming.Context.PROVIDER_URL;
args[1] = providerUrl;
method.invoke(bean, args);
method = beanClass.getMethod("start", (Class[])null);
method.invoke(bean, (Object[])null);
|
public static synchronized com.sun.org.apache.commons.modeler.Registry | createRegistry()Create and configure (if necessary) and return the registry of
managed object descriptions.
if (registry == null) {
registry = Registry.getRegistry();
ClassLoader cl = serverLifecycleListenerClassLoader;
registry.loadDescriptors("org.apache.catalina.mbeans", cl);
registry.loadDescriptors("org.apache.catalina.authenticator", cl);
registry.loadDescriptors("org.apache.catalina.core", cl);
registry.loadDescriptors("org.apache.catalina", cl);
registry.loadDescriptors("org.apache.catalina.deploy", cl);
registry.loadDescriptors("org.apache.catalina.loader", cl);
registry.loadDescriptors("org.apache.catalina.logger", cl);
registry.loadDescriptors("org.apache.catalina.realm", cl);
registry.loadDescriptors("org.apache.catalina.session", cl);
registry.loadDescriptors("org.apache.catalina.startup", cl);
registry.loadDescriptors("org.apache.catalina.users", cl);
registry.loadDescriptors("org.apache.catalina.cluster", cl);
registry.loadDescriptors("org.apache.catalina.valves", cl);
registry.loadDescriptors("org.apache.coyote.tomcat5", cl);
}
return (registry);
|
public static synchronized javax.management.MBeanServer | createServer()Create and configure (if necessary) and return the
MBeanServer with which we will be
registering our ModelMBean implementations.
if (mserver == null) {
try {
//Trace.parseTraceProperties();
//mserver = MBeanServerFactory.createMBeanServer();
mserver = Registry.getServer();
} catch (Throwable t) {
t.printStackTrace(System.out);
System.exit(1);
}
}
return (mserver);
|
static void | destroyMBean(org.apache.catalina.Connector connector, org.apache.catalina.Service service)Deregister the MBean for this
Connector object.
connector.setService(service);
String mname = createManagedName(connector);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
return;
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ObjectName oname = createObjectName(domain, connector);
connector.setService(null);
if( mserver.isRegistered( oname )) {
mserver.unregisterMBean(oname);
}
|
static void | destroyMBean(org.apache.catalina.Context context)Deregister the MBean for this
Context object.
String mname = createManagedName(context);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
return;
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ObjectName oname = createObjectName(domain, context);
if( mserver.isRegistered(oname) )
mserver.unregisterMBean(oname);
|
static void | destroyMBean(org.apache.catalina.deploy.ContextEnvironment environment)Deregister the MBean for this
ContextEnvironment object.
String mname = createManagedName(environment);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
return;
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ObjectName oname = createObjectName(domain, environment);
if( mserver.isRegistered(oname) )
mserver.unregisterMBean(oname);
|
static void | destroyMBean(org.apache.catalina.deploy.ContextResource resource)Deregister the MBean for this
ContextResource object.
String mname = createManagedName(resource);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
return;
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ObjectName oname = createObjectName(domain, resource);
if( mserver.isRegistered(oname ))
mserver.unregisterMBean(oname);
|
static void | destroyMBean(org.apache.catalina.deploy.ContextResourceLink resourceLink)Deregister the MBean for this
ContextResourceLink object.
String mname = createManagedName(resourceLink);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
return;
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ObjectName oname = createObjectName(domain, resourceLink);
if( mserver.isRegistered(oname) )
mserver.unregisterMBean(oname);
|
static void | destroyMBean(org.apache.catalina.DefaultContext context)Deregister the MBean for this
DefaultContext object.
String mname = createManagedName(context);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
return;
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ObjectName oname = createObjectName(domain, context);
if( mserver.isRegistered(oname) )
mserver.unregisterMBean(oname);
|
static void | destroyMBean(org.apache.catalina.Engine engine)Deregister the MBean for this
Engine object.
String mname = createManagedName(engine);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
return;
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ObjectName oname = createObjectName(domain, engine);
if( mserver.isRegistered(oname) )
mserver.unregisterMBean(oname);
|
static void | destroyMBean(org.apache.catalina.Group group)Deregister the MBean for this
Group object.
String mname = createManagedName(group);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
return;
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ObjectName oname = createObjectName(domain, group);
if( mserver.isRegistered(oname) )
mserver.unregisterMBean(oname);
|
static void | destroyMBean(org.apache.catalina.Host host)Deregister the MBean for this
Host object.
String mname = createManagedName(host);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
return;
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ObjectName oname = createObjectName(domain, host);
if( mserver.isRegistered(oname) )
mserver.unregisterMBean(oname);
|
static void | destroyMBean(org.apache.catalina.Loader loader)Deregister the MBean for this
Loader object.
String mname = createManagedName(loader);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
return;
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ObjectName oname = createObjectName(domain, loader);
if( mserver.isRegistered(oname) )
mserver.unregisterMBean(oname);
|
static void | destroyMBean(org.apache.catalina.Logger logger)Deregister the MBean for this
Logger object.
String mname = createManagedName(logger);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
return;
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ObjectName oname = createObjectName(domain, logger);
if( mserver.isRegistered(oname) )
mserver.unregisterMBean(oname);
|
static void | destroyMBean(org.apache.catalina.Manager manager)Deregister the MBean for this
Manager object.
String mname = createManagedName(manager);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
return;
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ObjectName oname = createObjectName(domain, manager);
if( mserver.isRegistered(oname) )
mserver.unregisterMBean(oname);
|
static void | destroyMBean(org.apache.catalina.deploy.NamingResources resources)Deregister the MBean for this
NamingResources object.
String mname = createManagedName(resources);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
return;
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ObjectName oname = createObjectName(domain, resources);
if( mserver.isRegistered(oname) )
mserver.unregisterMBean(oname);
|
static void | destroyMBean(org.apache.catalina.Realm realm)Deregister the MBean for this
Realm object.
String mname = createManagedName(realm);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
return;
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ObjectName oname = createObjectName(domain, realm);
if( mserver.isRegistered(oname) )
mserver.unregisterMBean(oname);
|
static void | destroyMBean(org.apache.catalina.Role role)Deregister the MBean for this
Role object.
String mname = createManagedName(role);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
return;
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ObjectName oname = createObjectName(domain, role);
if( mserver.isRegistered(oname) )
mserver.unregisterMBean(oname);
|
static void | destroyMBean(org.apache.catalina.Server server)Deregister the MBean for this
Server object.
String mname = createManagedName(server);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
return;
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ObjectName oname = createObjectName(domain, server);
if( mserver.isRegistered(oname) )
mserver.unregisterMBean(oname);
|
static void | destroyMBean(org.apache.catalina.Service service)Deregister the MBean for this
Service object.
String mname = createManagedName(service);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
return;
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ObjectName oname = createObjectName(domain, service);
if( mserver.isRegistered(oname) )
mserver.unregisterMBean(oname);
|
static void | destroyMBean(org.apache.catalina.User user)Deregister the MBean for this
User object.
String mname = createManagedName(user);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
return;
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ObjectName oname = createObjectName(domain, user);
if( mserver.isRegistered(oname) )
mserver.unregisterMBean(oname);
|
static void | destroyMBean(org.apache.catalina.UserDatabase userDatabase)Deregister the MBean for this
UserDatabase object.
String mname = createManagedName(userDatabase);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
return;
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ObjectName oname = createObjectName(domain, userDatabase);
if( mserver.isRegistered(oname) )
mserver.unregisterMBean(oname);
|
static void | destroyMBean(org.apache.catalina.Valve valve, org.apache.catalina.Container container)Deregister the MBean for this
Valve object.
((Contained)valve).setContainer(container);
String mname = createManagedName(valve);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
return;
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ObjectName oname = createObjectName(domain, valve);
try {
((Contained)valve).setContainer(null);
} catch (Throwable t) {
;
}
if( mserver.isRegistered(oname) ) {
mserver.unregisterMBean(oname);
}
|
private static final java.lang.String | encodeStr(java.lang.String t)Translates a string into x-www-form-urlencoded format
// --------------------------------------------------------- Static Methods
return URLEncoder.encode(t);
|
static int | getSeq(java.lang.String key)
int i[]=(int [])seq.get( key );
if (i == null ) {
i=new int[1];
i[0]=0;
seq.put( key, i);
} else {
i[0]++;
}
return i[0];
|
public static synchronized void | loadMBeanDescriptors(java.lang.String resource)Load an MBean descriptor resource.
try {
URL url = ServerLifecycleListener.class.getResource(resource);
if (url != null) {
InputStream stream = url.openStream();
Registry.loadRegistry(stream);
stream.close();
} else {
// XXX: i18n
log.warn("MBean descriptors not found:" + resource);
}
} catch (Throwable t) {
t.printStackTrace(System.out);
}
|