当前位置: 首页>>代码示例>>Java>>正文


Java InstrumentationManagerImpl类代码示例

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


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

示例1: instrumentationManager

import org.apache.cxf.management.jmx.InstrumentationManagerImpl; //导入依赖的package包/类
@Bean
public InstrumentationManager instrumentationManager(SpringBus cxf) {
    InstrumentationManagerImpl impl = new InstrumentationManagerImpl();
    impl.setEnabled(true);
    impl.setBus(cxf);
    impl.setUsePlatformMBeanServer(true);
    return impl;
}
 
开发者ID:przodownikR1,项目名称:cxf_over_jms_kata,代码行数:9,代码来源:CxfConfig.java

示例2: destroy

import org.apache.cxf.management.jmx.InstrumentationManagerImpl; //导入依赖的package包/类
public void destroy(@Observes final AssemblerDestroyed ignored) {
    final SystemInstance systemInstance = SystemInstance.get();
    final Bus bus = getBus();
    if ("true".equalsIgnoreCase(systemInstance.getProperty("openejb.cxf.jmx", "true"))) {
        final InstrumentationManager mgr = bus.getExtension(InstrumentationManager.class);
        if (InstrumentationManagerImpl.class.isInstance(mgr)) {
            mgr.shutdown();
        }
    }
    systemInstance.removeObserver(this);
}
 
开发者ID:apache,项目名称:tomee,代码行数:12,代码来源:CxfUtil.java

示例3: configureBus

import org.apache.cxf.management.jmx.InstrumentationManagerImpl; //导入依赖的package包/类
public static void configureBus() {
    if (USER_COUNT.incrementAndGet() > 1) {
        return;
    }

    final SystemInstance systemInstance = SystemInstance.get();

    final Bus bus = getBus();

    // ensure cxf classes are loaded from container to avoid conflicts with app
    if ("true".equalsIgnoreCase(systemInstance.getProperty("openejb.cxf.CxfContainerClassLoader", "true"))) {
        bus.setExtension(new CxfContainerClassLoader(), ClassLoader.class);
    }

    // activate jmx, by default isEnabled() == false in InstrumentationManagerImpl
    final boolean hasMonitoring = hasMonitoring(systemInstance);
    if (hasMonitoring || "true".equalsIgnoreCase(systemInstance.getProperty("openejb.cxf.jmx", "true"))) {
        final InstrumentationManager mgr = bus.getExtension(InstrumentationManager.class);
        if (InstrumentationManagerImpl.class.isInstance(mgr)) {
            bus.setExtension(LocalMBeanServer.get(), MBeanServer.class); // just to keep everything consistent

            final InstrumentationManagerImpl manager = InstrumentationManagerImpl.class.cast(mgr);
            manager.setEnabled(true);
            manager.setServer(LocalMBeanServer.get());
            manager.setDaemon(true);

            try { // avoid to bother our nice logs
                LogUtils.getL7dLogger(InstrumentationManagerImpl.class).setLevel(Level.WARNING);
            } catch (final Throwable th) {
                // no-op
            }

            // failed when bus was constructed or even if passed we switch the MBeanServer
            manager.init();
        }
    }
    if (hasMonitoring) {
        new CounterRepository().setBus(bus);
    }

    final ServiceConfiguration configuration = new ServiceConfiguration(systemInstance.getProperties(),
            systemInstance.getComponent(OpenEjbConfiguration.class).facilities.services);

    final Collection<ServiceInfo> serviceInfos = configuration.getAvailableServices();
    Properties properties = configuration.getProperties();
    if (properties == null) {
        properties = new Properties();
    }

    final String featuresIds = properties.getProperty(BUS_PREFIX + FEATURES);
    if (featuresIds != null) {
        final List<Feature> features = createFeatures(serviceInfos, featuresIds);
        if (features != null) {
            features.addAll(bus.getFeatures());
            bus.setFeatures(features);
        }
    }

    final Properties busProperties = ServiceInfos.serviceProperties(serviceInfos, properties.getProperty(BUS_PREFIX + ENDPOINT_PROPERTIES));
    if (busProperties != null) {
        bus.getProperties().putAll(PropertiesHelper.map(busProperties));
    }

    configureInterceptors(bus, BUS_PREFIX, serviceInfos, configuration.getProperties());

    systemInstance.getProperties().setProperty(BUS_CONFIGURED_FLAG, "true");
    systemInstance.fireEvent(new BusCreated(bus));
}
 
开发者ID:apache,项目名称:tomee,代码行数:69,代码来源:CxfUtil.java


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