Spring Framework AnnotationJmxAttributeSource - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework AnnotationJmxAttributeSource class.

This code example shows how to use the following methods:
    private final MetadataMBeanInfoAssembler springAssembler;
 
    public SpringManagementMBeanAssembler(CamelContext camelContext) {
        super(camelContext);
        this.springAssembler = new MetadataMBeanInfoAssembler();
        this.springAssembler.setAttributeSource(new AnnotationJmxAttributeSource());
    } 
 
    public ModelMBean assemble(MBeanServer mBeanServer, Object obj, ObjectName name) throws JMException {
        ModelMBeanInfo mbi = null;
 
        // prefer to use the managed instance if it has been annotated with Spring JMX annotations 
        if (obj instanceof ManagedInstance) {
            Object custom = ((ManagedInstance) obj).getInstance();
            if (custom != null && ObjectHelper.hasAnnotation(custom.getClass().getAnnotations(), ManagedResource.class)) {
                LOG.trace("Assembling MBeanInfo for: {} from custom @ManagedResource object: {}", name, custom);
                // get the mbean info from the custom managed object 
                mbi = springAssembler.getMBeanInfo(custom, name.toString());
                // and let the custom object be registered in JMX 
                obj = custom;
5
CodeRank
This code example shows how to use the following methods:
 
            ReposeInstanceInfo reposeInstanceInfo = new ReposeInstanceInfo();
            reposeInstanceInfo.setNodeId( "node1" );
            reposeInstanceInfo.setClusterId( "cluster1" );
 
            reposeStrat = new ReposeJmxNamingStrategy( new AnnotationJmxAttributeSource(),
                                                       reposeInstanceInfo );
 
            metricsService = new MetricsServiceImpl( reposeStrat );
 
        } 
 
        protected Object getAttribute( Class klass, String name, String scope, String att )
              throws 
              MalformedObjectNameException,
              AttributeNotFoundException,
              MBeanException,
              ReflectionException,
              InstanceNotFoundException {
 
4
CodeRank