Java 类org.apache.camel.core.xml.CamelJMXAgentDefinition 实例源码

项目:Camel    文件:CamelBeanPostProcessor.java   
@Override
public boolean canPostProcessBean(Object bean, String beanName) {
    // the JMXAgent is a bit strange and causes Spring issues if we let it being
    // post processed by this one. It does not need it anyway so we are good to go.
    // We should also avoid to process the null object bean (in Spring 2.5.x)
    if (bean == null || bean instanceof CamelJMXAgentDefinition) {
        return false;
    }

    return super.canPostProcessBean(bean, beanName);
}
项目:Camel    文件:CamelContextFactoryBean.java   
public CamelJMXAgentDefinition getCamelJMXAgent() {
    return camelJMXAgent;
}
项目:Camel    文件:CamelContextFactoryBean.java   
public void setCamelJMXAgent(CamelJMXAgentDefinition camelJMXAgent) {
    this.camelJMXAgent = camelJMXAgent;
}
项目:Camel    文件:CamelContextFactoryBean.java   
public CamelJMXAgentDefinition getCamelJMXAgent() {
    return camelJMXAgent;
}
项目:Camel    文件:CamelContextFactoryBean.java   
public void setCamelJMXAgent(CamelJMXAgentDefinition agent) {
    camelJMXAgent = agent;
}
项目:Camel    文件:CamelNamespaceHandler.java   
public void init() {
    // register restContext parser
    registerParser("restContext", new RestContextDefinitionParser());
    // register routeContext parser
    registerParser("routeContext", new RouteContextDefinitionParser());
    // register endpoint parser
    registerParser("endpoint", endpointParser);

    addBeanDefinitionParser("keyStoreParameters", KeyStoreParametersFactoryBean.class, true, true);
    addBeanDefinitionParser("secureRandomParameters", SecureRandomParametersFactoryBean.class, true, true);
    registerBeanDefinitionParser("sslContextParameters", new SSLContextParametersFactoryBeanBeanDefinitionParser());

    addBeanDefinitionParser("proxy", CamelProxyFactoryBean.class, true, false);
    addBeanDefinitionParser("template", CamelProducerTemplateFactoryBean.class, true, false);
    addBeanDefinitionParser("consumerTemplate", CamelConsumerTemplateFactoryBean.class, true, false);
    addBeanDefinitionParser("export", CamelServiceExporter.class, true, false);
    addBeanDefinitionParser("threadPool", CamelThreadPoolFactoryBean.class, true, true);
    addBeanDefinitionParser("redeliveryPolicyProfile", CamelRedeliveryPolicyFactoryBean.class, true, true);

    // jmx agent, stream caching, hystrix, service call configurations and property placeholder cannot be used outside of the camel context
    addBeanDefinitionParser("jmxAgent", CamelJMXAgentDefinition.class, false, false);
    addBeanDefinitionParser("streamCaching", CamelStreamCachingStrategyDefinition.class, false, false);
    addBeanDefinitionParser("propertyPlaceholder", CamelPropertyPlaceholderDefinition.class, false, false);
    addBeanDefinitionParser("hystrixConfiguration", HystrixConfigurationDefinition.class, false, false);
    addBeanDefinitionParser("consulConfiguration", ConsulConfigurationDefinition.class, false, false);
    addBeanDefinitionParser("dnsConfiguration", DnsConfigurationDefinition.class, false, false);
    addBeanDefinitionParser("etcdConfiguration", EtcdConfigurationDefinition.class, false, false);
    addBeanDefinitionParser("kubernetesConfiguration", KubernetesConfigurationDefinition.class, false, false);
    addBeanDefinitionParser("ribbonConfiguration", RibbonConfigurationDefinition.class, false, false);

    // errorhandler could be the sub element of camelContext or defined outside camelContext
    BeanDefinitionParser errorHandlerParser = new ErrorHandlerDefinitionParser();
    registerParser("errorHandler", errorHandlerParser);
    parserMap.put("errorHandler", errorHandlerParser);

    // camel context
    boolean osgi = false;
    Class<?> cl = CamelContextFactoryBean.class;
    // These code will try to detected if we are in the OSGi environment.
    // If so, camel will use the OSGi version of CamelContextFactoryBean to create the CamelContext.
    try {
        // Try to load the BundleActivator first
        Class.forName("org.osgi.framework.BundleActivator");
        Class<?> c = Class.forName("org.apache.camel.osgi.Activator");
        Method mth = c.getDeclaredMethod("getBundle");
        Object bundle = mth.invoke(null);
        if (bundle != null) {
            cl = Class.forName("org.apache.camel.osgi.CamelContextFactoryBean");
            osgi = true;
        }
    } catch (Throwable t) {
        // not running with camel-core-osgi so we fallback to the regular factory bean
        LOG.trace("Cannot find class so assuming not running in OSGi container: " + t.getMessage());
    }
    if (osgi) {
        LOG.info("OSGi environment detected.");
    } 
    LOG.debug("Using {} as CamelContextBeanDefinitionParser", cl.getCanonicalName());
    registerParser("camelContext", new CamelContextBeanDefinitionParser(cl));
}
项目:Camel    文件:CamelContextFactoryBean.java   
public void setCamelJMXAgent(CamelJMXAgentDefinition agent) {
    camelJMXAgent = agent;
}
项目:Camel    文件:CamelContextFactoryBean.java   
public CamelJMXAgentDefinition getCamelJMXAgent() {
    return camelJMXAgent;
}
项目:switchyard    文件:CamelContextFactoryBeanDelegate.java   
@Override
public CamelJMXAgentDefinition getCamelJMXAgent() {
    return _factoryBean.getCamelJMXAgent();
}
项目:camel-cdi    文件:CamelContextFactoryBean.java   
public CamelJMXAgentDefinition getCamelJMXAgent() {
    return camelJMXAgent;
}
项目:camel-cdi    文件:CamelContextFactoryBean.java   
public void setCamelJMXAgent(CamelJMXAgentDefinition agent) {
    camelJMXAgent = agent;
}