/** * {@inheritDoc} * <P> * All control service MBeans must be valid according * to {@link Controls#isControlServiceMBean(Class)}. * </P> * * @see Controls#isControlServiceMBean(Class) */ @Override public synchronized <T> String registerControl(String type, String id, String alias, Class<T> controlInterface, T control) { if (!Controls.isControlServiceMBean(controlInterface)) throw new IllegalArgumentException(); final String controlId = getControlId(type, id, alias); if (mbeans.containsKey(controlId)) { logger.error("Control id: {} already exists", controlId); throw new IllegalStateException(); } logger.trace("Register control id: {}", controlId); mbeans.put(controlId, new ControlMBean<T>(controlInterface, control)); return controlId; }
/** * {@inheritDoc} * <P> * All control service MBeans must be valid according * to {@link Controls#isControlServiceMBean(Class)}. * </P> * * @see Controls#isControlServiceMBean(Class) */ @Override public synchronized <T> String registerControl(String type, String id, String alias, Class<T> controlInterface, T control) { if (!Controls.isControlServiceMBean(controlInterface)) throw new IllegalArgumentException(); final String controlId = getControlId(type, id, alias); if (mbeans.containsKey(controlId)) { logger.error("Control id: {} already exists", controlId); throw new IllegalStateException(); } logger.trace("Register control id: {}", controlId); mbeans.put(controlId, new ControlMBean<T>(controlInterface, control)); return controlId; }