本文整理汇总了Java中org.apache.catalina.Server.getGlobalNamingResources方法的典型用法代码示例。如果您正苦于以下问题:Java Server.getGlobalNamingResources方法的具体用法?Java Server.getGlobalNamingResources怎么用?Java Server.getGlobalNamingResources使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.catalina.Server
的用法示例。
在下文中一共展示了Server.getGlobalNamingResources方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createMBeans
import org.apache.catalina.Server; //导入方法依赖的package包/类
/**
* Create the MBeans for the specified Server and its nested components.
*
* @param server Server for which to create MBeans
*
* @exception Exception if an exception is thrown during MBean creation
*/
protected void createMBeans(Server server) throws Exception {
// 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]);
}
}
示例2: destroyMBeans
import org.apache.catalina.Server; //导入方法依赖的package包/类
/**
* Deregister the MBeans for the specified Server and its related
* components.
*
* @param server Server for which to destroy MBeans
*
* @exception Exception if an exception is thrown during MBean destruction
*/
protected void destroyMBeans(Server server) throws Exception {
// 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);
}
}
示例3: createMBeans
import org.apache.catalina.Server; //导入方法依赖的package包/类
/**
* Create the MBeans for the specified Server and its nested components.
*
* @param server Server for which to create MBeans
*
* @exception Exception if an exception is thrown during MBean creation
*/
protected void createMBeans(Server server) throws Exception {
// Create the MBean for the Server itself
if (debug >= 2)
log("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 (debug >= 1) {
log("Skipping MBean for Service " + services[i]);
}
continue;
}
createMBeans(services[i]);
}
}
示例4: destroyMBeans
import org.apache.catalina.Server; //导入方法依赖的package包/类
/**
* Deregister the MBeans for the specified Server and its related
* components.
*
* @param server Server for which to destroy MBeans
*
* @exception Exception if an exception is thrown during MBean destruction
*/
protected void destroyMBeans(Server server) throws Exception {
// 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 (debug >= 1) {
log("Skipping MBean for Service " + services[i]);
}
continue;
}
destroyMBeans(services[i]);
}
// Destroy the MBean for the Server itself
if (debug >= 2) {
log("Destroying MBean for Server " + server);
}
MBeanUtils.destroyMBean(server);
if (server instanceof StandardServer) {
((StandardServer) server).removePropertyChangeListener(this);
}
}
示例5: storeServer
import org.apache.catalina.Server; //导入方法依赖的package包/类
/**
* Store the specified Server properties.
*
* @param writer PrintWriter to which we are storing
* @param indent Number of spaces to indent this element
* @param server Object to be stored
*
* @exception Exception if an exception occurs while storing
*/
private void storeServer(PrintWriter writer, int indent,
Server server) throws Exception {
// Store the beginning of this element
writer.println("<?xml version='1.0' encoding='utf-8'?>");
for (int i = 0; i < indent; i++) {
writer.print(' ');
}
writer.print("<Server");
storeAttributes(writer, server);
writer.println(">");
// Store nested <Listener> elements
if (server instanceof Lifecycle) {
LifecycleListener listeners[] =
((Lifecycle) server).findLifecycleListeners();
for (int i = 0; i < listeners.length; i++) {
storeListener(writer, indent + 2, listeners[i]);
}
}
// Store nested <GlobalNamingResources> element
NamingResources globalNamingResources =
server.getGlobalNamingResources();
if (globalNamingResources != null) {
for (int i = 0; i < indent + 2; i++) {
writer.print(' ');
}
writer.println("<GlobalNamingResources>");
storeNamingResources(writer, indent + 4, globalNamingResources);
for (int i = 0; i < indent + 2; i++) {
writer.print(' ');
}
writer.println("</GlobalNamingResources>");
}
// Store nested <Service> elements
Service services[] = server.findServices();
for (int i = 0; i < services.length; i++) {
storeService(writer, indent + 2, services[i]);
}
// Store the ending of this element
for (int i = 0; i < indent; i++) {
writer.print(' ');
}
writer.println("</Server>");
}