@Test public void testCreateService() { String serviceId = "message-service"; String serviceClass = MessageService.class.getName(); Service expected = broker.createService(serviceId, serviceClass); Service actual = broker.getService(serviceId); Assert.assertEquals(expected, actual); }
public Service createService(String id, String className) { Class svcClass = ClassUtil.createClass(className, getClassLoader()); Service service = (Service)ClassUtil.createDefaultInstance(svcClass, Service.class); service.setId(id); service.setManaged(isManaged()); service.setMessageBroker(this); return service; }
MessageBroker extends ManageableComponent { public Service createService(String id, String className) { Class svcClass = ClassUtil.createClass(className, getClassLoader()); Service service = (Service)ClassUtil.createDefaultInstance(svcClass, Service.class); service.setId(id); service.setManaged(isManaged()); service.setMessageBroker(this); return service; } }
MessageBroker extends ManageableComponent { public Service createService(String id, String className) { Class svcClass = ClassUtil.createClass(className, getClassLoader()); Service service = (Service)ClassUtil.createDefaultInstance(svcClass, Service.class); service.setId(id); service.setManaged(isManaged()); service.setMessageBroker(this); return service; } MessageBroker();  MessageBroker(boolean enableManagement);  MessageBroker(boolean enableManagement, String mbid);  MessageBroker(boolean enableManagement, String mbid, ClassLoader loader); }
MessageBroker extends ManageableComponent { public Service createService(String id, String className) { Class svcClass = ClassUtil.createClass(className, getClassLoader()); Service service = (Service)ClassUtil.createDefaultInstance(svcClass, Service.class); service.setId(id); service.setManaged(isManaged()); service.setMessageBroker(this); return service; } MessageBroker();  MessageBroker(boolean enableManagement);  MessageBroker(boolean enableManagement, String mbid);  MessageBroker(boolean enableManagement, String mbid, ClassLoader loader); @Override void setId(String id); static MessageBroker getMessageBroker(String id); @Override void start(); @Override void stop(); Iterator<String> getAttributeNames(); Object getAttribute(String name); void setAttribute(String name, Object value); void removeAttribute(String name); DeserializationValidator getDeserializationValidator(); void setDeserializationValidator(DeserializationValidator deserializationValidator); void setExternalPathResolver(PathResolver externalPathResolver); void setInternalPathResolver(InternalPathResolver internalPathResolver); InputStream resolveExternalPath(String filename); InputStream resolveInternalPath(String filename); ClusterManager getClusterManager(); void addServer(Server server); Server getServer(String id); Server removeServer(String id); Endpoint createEndpoint(String id, String url, String className); void addEndpoint(Endpoint endpoint); Endpoint getEndpoint(String id); Map<String, Endpoint> getEndpoints(); Endpoint getEndpoint(String path, String contextPath); Endpoint removeEndpoint(String id); boolean isEnforceEndpointValidation(); void setEnforceEndpointValidation(boolean enforceEndpointValidation); FlexFactory getFactory(String id); Map<String, FlexFactory> getFactories(); void addFactory(String id, FlexFactory factory); FlexFactory removeFactory(String id); Service getService(String id); Service getServiceByType(String type); Map<String, Service> getServices(); ConfigMap describeServices(Endpoint endpoint); ConfigMap describeServices(Endpoint endpoint, boolean onlyReliable); void addServiceValidationListener(String id, ServiceValidationListener listener); Iterator<ServiceValidationListener> getServiceValidationListenerIterator(); void removeServiceValidationListener(String id); Service createService(String id, String className); void addService(Service service); Service removeService(String id); Log getLog(); LogManager getLogManager(); LoginManager getLoginManager(); void setLoginManager(LoginManager loginManager); FlexClientManager getFlexClientManager(); void setFlexClientManager(FlexClientManager value); FlexSessionManager getFlexSessionManager(); void setFlexSessionManager(FlexSessionManager value); RedeployManager getRedeployManager(); void setRedeployManager(RedeployManager redeployManager); Class<? extends ThrottleManager> getThrottleManagerClass(); void setThrottleManagerClass(Class<? extends ThrottleManager> throttleManagerClass); String createUUID(); UUIDGenerator getUUIDGenerator(); void setUUIDGenerator(UUIDGenerator value); List<String> getChannelIds(); ChannelSettings getChannelSettings(String ref); Map<String, ChannelSettings> getAllChannelSettings(); void setChannelSettings(Map<String, ChannelSettings> channelSettings); List<String> getDefaultChannels(); void addDefaultChannel(String id); void setDefaultChannels(List<String> ids); boolean removeDefaultChannel(String id); SecurityConstraint getSecurityConstraint(String ref); ServletContext getServletContext(); SecuritySettings getSecuritySettings(); void setSecuritySettings(SecuritySettings securitySettings); SystemSettings getSystemSettings(); void setSystemSettings(SystemSettings l); FlexClientSettings getFlexClientSettings(); void setFlexClientSettings(FlexClientSettings value); void initThreadLocals(); AcknowledgeMessage routeMessageToService(Message message, Endpoint endpoint); AsyncMessage routeCommandToService(CommandMessage command, Endpoint endpoint); void routeMessageToMessageClient(Message message, MessageClient messageClient); void inspectOperation(Message message, Destination destination); void inspectChannel(Message message, Destination destination); String getLogCategory(Message message); ClassLoader getClassLoader(); void setClassLoader(ClassLoader classLoader); boolean isDestinationRegistered(String destId, String svcId, boolean throwException); void registerDestination(String destId, String svcId); void unregisterDestination(String destId); Destination getRegisteredDestination(String destId); void incrementAttributeIdRefCount(String attributeId); int decrementAttributeIdRefCount(String attributeId); void setServletContext(ServletContext servletContext); }
MessageBroker extends ManageableComponent { public Service createService(String id, String className) { Class svcClass = ClassUtil.createClass(className, getClassLoader()); Service service = (Service)ClassUtil.createDefaultInstance(svcClass, Service.class); service.setId(id); service.setManaged(isManaged()); service.setMessageBroker(this); return service; } MessageBroker();  MessageBroker(boolean enableManagement);  MessageBroker(boolean enableManagement, String mbid);  MessageBroker(boolean enableManagement, String mbid, ClassLoader loader); @Override void setId(String id); static MessageBroker getMessageBroker(String id); @Override void start(); @Override void stop(); Iterator<String> getAttributeNames(); Object getAttribute(String name); void setAttribute(String name, Object value); void removeAttribute(String name); DeserializationValidator getDeserializationValidator(); void setDeserializationValidator(DeserializationValidator deserializationValidator); void setExternalPathResolver(PathResolver externalPathResolver); void setInternalPathResolver(InternalPathResolver internalPathResolver); InputStream resolveExternalPath(String filename); InputStream resolveInternalPath(String filename); ClusterManager getClusterManager(); void addServer(Server server); Server getServer(String id); Server removeServer(String id); Endpoint createEndpoint(String id, String url, String className); void addEndpoint(Endpoint endpoint); Endpoint getEndpoint(String id); Map<String, Endpoint> getEndpoints(); Endpoint getEndpoint(String path, String contextPath); Endpoint removeEndpoint(String id); boolean isEnforceEndpointValidation(); void setEnforceEndpointValidation(boolean enforceEndpointValidation); FlexFactory getFactory(String id); Map<String, FlexFactory> getFactories(); void addFactory(String id, FlexFactory factory); FlexFactory removeFactory(String id); Service getService(String id); Service getServiceByType(String type); Map<String, Service> getServices(); ConfigMap describeServices(Endpoint endpoint); ConfigMap describeServices(Endpoint endpoint, boolean onlyReliable); void addServiceValidationListener(String id, ServiceValidationListener listener); Iterator<ServiceValidationListener> getServiceValidationListenerIterator(); void removeServiceValidationListener(String id); Service createService(String id, String className); void addService(Service service); Service removeService(String id); Log getLog(); LogManager getLogManager(); LoginManager getLoginManager(); void setLoginManager(LoginManager loginManager); FlexClientManager getFlexClientManager(); void setFlexClientManager(FlexClientManager value); FlexSessionManager getFlexSessionManager(); void setFlexSessionManager(FlexSessionManager value); RedeployManager getRedeployManager(); void setRedeployManager(RedeployManager redeployManager); Class<? extends ThrottleManager> getThrottleManagerClass(); void setThrottleManagerClass(Class<? extends ThrottleManager> throttleManagerClass); String createUUID(); UUIDGenerator getUUIDGenerator(); void setUUIDGenerator(UUIDGenerator value); List<String> getChannelIds(); ChannelSettings getChannelSettings(String ref); Map<String, ChannelSettings> getAllChannelSettings(); void setChannelSettings(Map<String, ChannelSettings> channelSettings); List<String> getDefaultChannels(); void addDefaultChannel(String id); void setDefaultChannels(List<String> ids); boolean removeDefaultChannel(String id); SecurityConstraint getSecurityConstraint(String ref); ServletContext getServletContext(); SecuritySettings getSecuritySettings(); void setSecuritySettings(SecuritySettings securitySettings); SystemSettings getSystemSettings(); void setSystemSettings(SystemSettings l); FlexClientSettings getFlexClientSettings(); void setFlexClientSettings(FlexClientSettings value); void initThreadLocals(); AcknowledgeMessage routeMessageToService(Message message, Endpoint endpoint); AsyncMessage routeCommandToService(CommandMessage command, Endpoint endpoint); void routeMessageToMessageClient(Message message, MessageClient messageClient); void inspectOperation(Message message, Destination destination); void inspectChannel(Message message, Destination destination); String getLogCategory(Message message); ClassLoader getClassLoader(); void setClassLoader(ClassLoader classLoader); boolean isDestinationRegistered(String destId, String svcId, boolean throwException); void registerDestination(String destId, String svcId); void unregisterDestination(String destId); Destination getRegisteredDestination(String destId); void incrementAttributeIdRefCount(String attributeId); int decrementAttributeIdRefCount(String attributeId); void setServletContext(ServletContext servletContext); static final String AUTHENTICATION_SERVICE_ID; static final int ERR_MSG_NO_SERVICE_FOR_DEST; static final int ERR_MSG_DESTINATION_UNACCESSIBLE; static final int ERR_MSG_UNKNOWN_REMOTE_CREDENTIALS_FORMAT; static final int ERR_MSG_NULL_MESSAGE_ID; static final int ERR_MSG_CANNOT_SERVICE_STOPPED; static final int ERR_MSG_NULL_ENDPOINT_URL; static final int ERR_MSG_SERVICE_CMD_NOT_SUPPORTED; static final int ERR_MSG_URI_ALREADY_REGISTERED; static final String LOG_CATEGORY; static final String LOG_CATEGORY_STARTUP_SERVICE; static final String TYPE; static final String DEFAULT_BROKER_ID; }