• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java MBeanUtils类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.catalina.mbeans.MBeanUtils的典型用法代码示例。如果您正苦于以下问题:Java MBeanUtils类的具体用法?Java MBeanUtils怎么用?Java MBeanUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MBeanUtils类属于org.apache.catalina.mbeans包,在下文中一共展示了MBeanUtils类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: addResourceLink

import org.apache.catalina.mbeans.MBeanUtils; //导入依赖的package包/类
/**
 * Add a resource link for this web application.
 *
 * @param resourceLink New resource link
 */
public void addResourceLink(ContextResourceLink resourceLink) {

    if (entries.contains(resourceLink.getName())) {
        return;
    } else {
        entries.add(resourceLink.getName());
    }

    synchronized (resourceLinks) {
        resourceLink.setNamingResources(this);
        resourceLinks.put(resourceLink.getName(), resourceLink);
    }
    support.firePropertyChange("resourceLink", null, resourceLink);

    // Register with JMX
    if (resourceRequireExplicitRegistration) {
        try {
            MBeanUtils.createMBean(resourceLink);
        } catch (Exception e) {
            log.warn(sm.getString("namingResources.mbeanCreateFail",
                    resourceLink.getName()), e);
        }
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:30,代码来源:NamingResources.java


示例2: removeEnvironment

import org.apache.catalina.mbeans.MBeanUtils; //导入依赖的package包/类
/**
 * Remove any environment entry with the specified name.
 *
 * @param name Name of the environment entry to remove
 */
public void removeEnvironment(String name) {

    entries.remove(name);

    ContextEnvironment environment = null;
    synchronized (envs) {
        environment = envs.remove(name);
    }
    if (environment != null) {
        support.firePropertyChange("environment", environment, null);
        // De-register with JMX
        if (resourceRequireExplicitRegistration) {
            try {
                MBeanUtils.destroyMBean(environment);
            } catch (Exception e) {
                log.warn(sm.getString("namingResources.mbeanDestroyFail",
                        environment.getName()), e);
            }
        }
        environment.setNamingResources(null);
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:28,代码来源:NamingResources.java


示例3: removeResource

import org.apache.catalina.mbeans.MBeanUtils; //导入依赖的package包/类
/**
 * Remove any resource reference with the specified name.
 *
 * @param name Name of the resource reference to remove
 */
public void removeResource(String name) {

    entries.remove(name);

    ContextResource resource = null;
    synchronized (resources) {
        resource = resources.remove(name);
    }
    if (resource != null) {
        support.firePropertyChange("resource", resource, null);
        // De-register with JMX
        if (resourceRequireExplicitRegistration) {
            try {
                MBeanUtils.destroyMBean(resource);
            } catch (Exception e) {
                log.warn(sm.getString("namingResources.mbeanDestroyFail",
                        resource.getName()), e);
            }
        }
        resource.setNamingResources(null);
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:28,代码来源:NamingResources.java


示例4: removeResourceLink

import org.apache.catalina.mbeans.MBeanUtils; //导入依赖的package包/类
/**
 * Remove any resource link with the specified name.
 *
 * @param name Name of the resource link to remove
 */
public void removeResourceLink(String name) {

    entries.remove(name);

    ContextResourceLink resourceLink = null;
    synchronized (resourceLinks) {
        resourceLink = resourceLinks.remove(name);
    }
    if (resourceLink != null) {
        support.firePropertyChange("resourceLink", resourceLink, null);
        // De-register with JMX
        if (resourceRequireExplicitRegistration) {
            try {
                MBeanUtils.destroyMBean(resourceLink);
            } catch (Exception e) {
                log.warn(sm.getString("namingResources.mbeanDestroyFail",
                        resourceLink.getName()), e);
            }
        }
        resourceLink.setNamingResources(null);
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:28,代码来源:NamingResources.java


示例5: addResourceLink

import org.apache.catalina.mbeans.MBeanUtils; //导入依赖的package包/类
/**
 * Add a resource link for this web application.
 *
 * @param resourceLink
 *            New resource link
 */
public void addResourceLink(ContextResourceLink resourceLink) {

	if (entries.contains(resourceLink.getName())) {
		return;
	} else {
		entries.add(resourceLink.getName());
	}

	synchronized (resourceLinks) {
		resourceLink.setNamingResources(this);
		resourceLinks.put(resourceLink.getName(), resourceLink);
	}
	support.firePropertyChange("resourceLink", null, resourceLink);

	// Register with JMX
	if (resourceRequireExplicitRegistration) {
		try {
			MBeanUtils.createMBean(resourceLink);
		} catch (Exception e) {
			log.warn(sm.getString("namingResources.mbeanCreateFail", resourceLink.getName()), e);
		}
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:30,代码来源:NamingResources.java


示例6: removeEnvironment

import org.apache.catalina.mbeans.MBeanUtils; //导入依赖的package包/类
/**
 * Remove any environment entry with the specified name.
 *
 * @param name
 *            Name of the environment entry to remove
 */
public void removeEnvironment(String name) {

	entries.remove(name);

	ContextEnvironment environment = null;
	synchronized (envs) {
		environment = envs.remove(name);
	}
	if (environment != null) {
		support.firePropertyChange("environment", environment, null);
		// De-register with JMX
		if (resourceRequireExplicitRegistration) {
			try {
				MBeanUtils.destroyMBean(environment);
			} catch (Exception e) {
				log.warn(sm.getString("namingResources.mbeanDestroyFail", environment.getName()), e);
			}
		}
		environment.setNamingResources(null);
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:28,代码来源:NamingResources.java


示例7: removeResource

import org.apache.catalina.mbeans.MBeanUtils; //导入依赖的package包/类
/**
 * Remove any resource reference with the specified name.
 *
 * @param name
 *            Name of the resource reference to remove
 */
public void removeResource(String name) {

	entries.remove(name);

	ContextResource resource = null;
	synchronized (resources) {
		resource = resources.remove(name);
	}
	if (resource != null) {
		support.firePropertyChange("resource", resource, null);
		// De-register with JMX
		if (resourceRequireExplicitRegistration) {
			try {
				MBeanUtils.destroyMBean(resource);
			} catch (Exception e) {
				log.warn(sm.getString("namingResources.mbeanDestroyFail", resource.getName()), e);
			}
		}
		resource.setNamingResources(null);
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:28,代码来源:NamingResources.java


示例8: removeResourceLink

import org.apache.catalina.mbeans.MBeanUtils; //导入依赖的package包/类
/**
 * Remove any resource link with the specified name.
 *
 * @param name
 *            Name of the resource link to remove
 */
public void removeResourceLink(String name) {

	entries.remove(name);

	ContextResourceLink resourceLink = null;
	synchronized (resourceLinks) {
		resourceLink = resourceLinks.remove(name);
	}
	if (resourceLink != null) {
		support.firePropertyChange("resourceLink", resourceLink, null);
		// De-register with JMX
		if (resourceRequireExplicitRegistration) {
			try {
				MBeanUtils.destroyMBean(resourceLink);
			} catch (Exception e) {
				log.warn(sm.getString("namingResources.mbeanDestroyFail", resourceLink.getName()), e);
			}
		}
		resourceLink.setNamingResources(null);
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:28,代码来源:NamingResources.java


示例9: load

import org.apache.catalina.mbeans.MBeanUtils; //导入依赖的package包/类
/**
 * Load and initialize an instance of this servlet, if there is not already
 * at least one initialized instance. This can be used, for example, to load
 * servlets that are marked in the deployment descriptor to be loaded at
 * server startup time.
 * <p>
 * <b>IMPLEMENTATION NOTE</b>: Servlets whose classnames begin with
 * <code>org.apache.catalina.</code> (so-called "container" servlets) are
 * loaded by the same classloader that loaded this class, rather than the
 * classloader for the current web application. This gives such classes
 * access to Catalina internals, which are prevented for classes loaded for
 * web applications.
 *
 * @exception ServletException
 *                if the servlet init() method threw an exception
 * @exception ServletException
 *                if some other loading problem occurs
 */
@Override
public synchronized void load() throws ServletException {
	instance = loadServlet();

	if (!instanceInitialized) {
		initServlet(instance);
	}

	if (isJspServlet) {
		StringBuilder oname = new StringBuilder(MBeanUtils.getDomain(getParent()));

		oname.append(":type=JspMonitor,name=");
		oname.append(getName());

		oname.append(getWebModuleKeyProperties());

		try {
			jspMonitorON = new ObjectName(oname.toString());
			Registry.getRegistry(null, null).registerComponent(instance, jspMonitorON, null);
		} catch (Exception ex) {
			log.info("Error registering JSP monitoring with jmx " + instance);
		}
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:43,代码来源:StandardWrapper.java


示例10: addResource

import org.apache.catalina.mbeans.MBeanUtils; //导入依赖的package包/类
/**
 * Add a resource reference for this web application.
 *
 * @param resource New resource reference
 */
public void addResource(ContextResource resource) {

    if (entries.containsKey(resource.getName())) {
        return;
    } else {
        entries.put(resource.getName(), resource.getType());
    }

    synchronized (resources) {
        resource.setNamingResources(this);
        resources.put(resource.getName(), resource);
    }
    support.firePropertyChange("resource", null, resource);

    // Register with JMX
    if (resourceRequireExplicitRegistration) {
        try {
            MBeanUtils.createMBean(resource);
        } catch (Exception e) {
            log.warn(sm.getString("namingResources.mbeanCreateFail",
                    resource.getName()), e);
        }
    }
}
 
开发者ID:WhiteBearSolutions,项目名称:WBSAirback,代码行数:30,代码来源:NamingResources.java


示例11: initInternal

import org.apache.catalina.mbeans.MBeanUtils; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@Override
protected void initInternal() throws LifecycleException {
    super.initInternal();
    if (clusterDeployer != null) {
        StringBuilder name = new StringBuilder("type=Cluster");
        Container container = getContainer();
        name.append(MBeanUtils.getContainerKeyProperties(container));
        name.append(",component=Deployer");
        onameClusterDeployer = register(clusterDeployer, name.toString());
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:13,代码来源:SimpleTcpCluster.java


示例12: getDomainInternal

import org.apache.catalina.mbeans.MBeanUtils; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@Override
protected String getDomainInternal() {
    Container container = getContainer();
    if (container == null) {
        return null;
    }
    return MBeanUtils.getDomain(container);
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:10,代码来源:SimpleTcpCluster.java


示例13: getObjectNameKeyProperties

import org.apache.catalina.mbeans.MBeanUtils; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@Override
protected String getObjectNameKeyProperties() {
    StringBuilder name = new StringBuilder("type=Cluster");

    Container container = getContainer();
    if (container != null) {
        name.append(MBeanUtils.getContainerKeyProperties(container));
    }

    return name.toString();
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:13,代码来源:SimpleTcpCluster.java


示例14: registerMember

import org.apache.catalina.mbeans.MBeanUtils; //导入依赖的package包/类
@SuppressWarnings("deprecation")
private void registerMember(Member member) {
    // JMX registration
    StringBuilder name = new StringBuilder("type=Cluster");
    Container container = getContainer();
    if (container != null) {
        name.append(MBeanUtils.getContainerKeyProperties(container));
    }
    name.append(",component=Member,name=");
    name.append(ObjectName.quote(member.getName()));

    ObjectName oname = register(member, name.toString());
    memberOnameMap.put(member, oname);
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:15,代码来源:SimpleTcpCluster.java


示例15: stopInternal

import org.apache.catalina.mbeans.MBeanUtils; //导入依赖的package包/类
/**
 * Stop associated {@link ClassLoader} and implement the requirements
 * of {@link org.apache.catalina.util.LifecycleBase#stopInternal()}.
 *
 * @exception LifecycleException if this component detects a fatal error
 *  that prevents this component from being used
 */
@Override
protected void stopInternal() throws LifecycleException {

    if (log.isDebugEnabled())
        log.debug(sm.getString("webappLoader.stopping"));

    setState(LifecycleState.STOPPING);

    // Remove context attributes as appropriate
    if (container instanceof Context) {
        ServletContext servletContext =
            ((Context) container).getServletContext();
        servletContext.removeAttribute(Globals.CLASS_PATH_ATTR);
    }

    // Throw away our current class loader
    if (classLoader != null) {
        ((Lifecycle) classLoader).stop();
        DirContextURLStreamHandler.unbind(classLoader);
    }

    try {
        StandardContext ctx=(StandardContext)container;
        String contextName = ctx.getName();
        if (!contextName.startsWith("/")) {
            contextName = "/" + contextName;
        }
        ObjectName cloname = new ObjectName
            (MBeanUtils.getDomain(ctx) + ":type=WebappClassLoader,context="
             + contextName + ",host=" + ctx.getParent().getName());
        Registry.getRegistry(null, null).unregisterComponent(cloname);
    } catch (Exception e) {
        log.error("LifecycleException ", e);
    }

    classLoader = null;
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:45,代码来源:WebappLoader.java


示例16: addResource

import org.apache.catalina.mbeans.MBeanUtils; //导入依赖的package包/类
/**
 * Add a resource reference for this web application.
 *
 * @param resource New resource reference
 */
public void addResource(ContextResource resource) {

    if (entries.contains(resource.getName())) {
        return;
    } else {
        if (!checkResourceType(resource)) {
            throw new IllegalArgumentException(sm.getString(
                    "namingResources.resourceTypeFail", resource.getName(),
                    resource.getType()));
        }
        entries.add(resource.getName());
    }

    synchronized (resources) {
        resource.setNamingResources(this);
        resources.put(resource.getName(), resource);
    }
    support.firePropertyChange("resource", null, resource);

    // Register with JMX
    if (resourceRequireExplicitRegistration) {
        try {
            MBeanUtils.createMBean(resource);
        } catch (Exception e) {
            log.warn(sm.getString("namingResources.mbeanCreateFail",
                    resource.getName()), e);
        }
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:35,代码来源:NamingResources.java


示例17: getObjectNameKeyProperties

import org.apache.catalina.mbeans.MBeanUtils; //导入依赖的package包/类
@Override
protected String getObjectNameKeyProperties() {
    Object c = getContainer();
    if (c instanceof Container) {
        return "type=NamingResources" +
                MBeanUtils.getContainerKeyProperties((Container) c);
    }
    // Server or just unknown
    return "type=NamingResources";
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:11,代码来源:NamingResources.java


示例18: getObjectNameKeyProperties

import org.apache.catalina.mbeans.MBeanUtils; //导入依赖的package包/类
@Override
public String getObjectNameKeyProperties() {

    StringBuilder keyProperties = new StringBuilder("type=Realm");
    keyProperties.append(getRealmSuffix());
    keyProperties.append(MBeanUtils.getContainerKeyProperties(container));

    return keyProperties.toString();
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:10,代码来源:RealmBase.java


示例19: getDomainInternal

import org.apache.catalina.mbeans.MBeanUtils; //导入依赖的package包/类
/**
 * Obtain the MBean domain for this server. The domain is obtained using
 * the following search order:
 * <ol>
 * <li>Name of first {@link org.apache.catalina.Engine}.</li>
 * <li>Name of first {@link Service}.</li>
 * </ol>
 */
@Override
protected String getDomainInternal() {
    
    String domain = null;
    
    Service[] services = findServices();
    if (services.length > 0) {
        Service service = services[0];
        if (service != null) {
            domain = MBeanUtils.getDomain(service);
        }
    }
    return domain;
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:23,代码来源:StandardServer.java


示例20: getObjectNameKeyProperties

import org.apache.catalina.mbeans.MBeanUtils; //导入依赖的package包/类
@Override
protected String getObjectNameKeyProperties() {

    StringBuilder keyProperties = new StringBuilder("type=Host");
    keyProperties.append(MBeanUtils.getContainerKeyProperties(this));

    return keyProperties.toString();
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:9,代码来源:StandardHost.java



注:本文中的org.apache.catalina.mbeans.MBeanUtils类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TextSearchRequestor类代码示例发布时间:2022-05-23
下一篇:
Java SetObjectTaggingRequest类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap