@Override public <T> String getControlId(String type, String alias, Class<T> controlInterface) { String controlId = getControlId(type, null, alias); return getControlMBean(controlId, controlInterface) != null ? controlId : null; }
@Override public <T> String getControlId(String type, String alias, Class<T> controlInterface) { String controlId = getControlId(type, null, alias); return getControlMBean(controlId, controlInterface) != null ? controlId : null; }
@Override public <T> T getControl(String type, String alias, Class<T> controlInterface) { String controlId = getControlId(type, null, alias); ControlMBean<?> bean = getControlMBean(controlId, controlInterface); return bean != null ? controlInterface.cast(bean.getControl()) : null; }
@Override public <T> T getControl(String type, String alias, Class<T> controlInterface) { String controlId = getControlId(type, null, alias); ControlMBean<?> bean = getControlMBean(controlId, controlInterface); return bean != null ? controlInterface.cast(bean.getControl()) : null; }
/** * {@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; }
final String type = request.get(TYPE_KEY).getAsString(); String alias = request.get(ALIAS_KEY).getAsString(); final String controlId = getControlId(type, null, alias);
final String type = request.get(TYPE_KEY).getAsString(); String alias = request.get(ALIAS_KEY).getAsString(); final String controlId = getControlId(type, null, alias);