private void addID(ManagedPropertyImpl mp) { // TODO Map<String, Annotation> annotations = new HashMap<String, Annotation>(); Map<String, Object> idFields = Collections.emptyMap(); try { ManagementObjectID id = (ManagementObjectID) AnnotationProxy.createProxy(idFields, ManagementObjectID.class); annotations.put(ManagementObjectID.class.getName(), id); mp.setAnnotations(annotations); } catch(Exception e) { throw new UndeclaredThrowableException(e); } }
/** * Should we wrap the original * in order to get the name we created. * * @param original the original * @param name the new created name * @param exposedInterface the exposed interface * @return jmx annoation instance * @throws Throwable for any error */ protected JMX wrapJMX(JMX original, String name, Class<?> exposedInterface) throws Throwable { Map<String, Object> attributes = new HashMap<String, Object>(); attributes.put("exposedInterface", exposedInterface); attributes.put("name", name); attributes.put("registerDirectly", original.registerDirectly()); return (JMX)AnnotationProxy.createProxy(attributes, JMX.class); }
/** * Should we wrap the original * in order to get the name we created. * * @param original the original * @param name the new created name * @param exposedInterface the exposed interface * @return jmx annoation instance * @throws Throwable for any error */ protected JMX wrapJMX(JMX original, String name, Class<?> exposedInterface) throws Throwable { Map<String, Object> attributes = new HashMap<String, Object>(); attributes.put("exposedInterface", exposedInterface); attributes.put("name", name); attributes.put("registerDirectly", original.registerDirectly()); return (JMX)AnnotationProxy.createProxy(attributes, JMX.class); }
return AnnotationProxy.createProxy(map, annotation);
return AnnotationProxy.createProxy(map, annotation);