public static UMODescriptor getDescriptor(String name, String implementation) { UMODescriptor descriptor = new MuleDescriptor(); descriptor.setExceptionListener(new DefaultExceptionStrategy()); descriptor.setName(name); descriptor.setImplementation(implementation); return descriptor; }
protected UMODescriptor getDefaultDescriptor() throws UMOException { // When the the beanFactory is refreshed all the beans get // reloaded so we need to unregister the component from Mule UMOModel model = MuleManager.getInstance().lookupModel(ModelHelper.SYSTEM_MODEL); if (model == null) { model = new SedaModel(); model.setName(ModelHelper.SYSTEM_MODEL); MuleManager.getInstance().registerModel(model); } UMODescriptor descriptor = model.getDescriptor(EVENT_MULTICASTER_DESCRIPTOR_NAME); if (descriptor != null) { model.unregisterComponent(descriptor); } descriptor = new MuleDescriptor(EVENT_MULTICASTER_DESCRIPTOR_NAME); if (subscriptions == null) { logger.info("No receive endpoints have been set, using default '*'"); descriptor.setInboundEndpoint(new MuleEndpoint("vm://*", true)); } else { // Set multiple inbound subscriptions on the descriptor UMOInboundRouterCollection messageRouter = descriptor.getInboundRouter(); for (int i = 0; i < subscriptions.length; i++) { String subscription = subscriptions[i]; UMOEndpointURI endpointUri = new MuleEndpointURI(subscription); UMOEndpoint endpoint = MuleEndpoint.getOrCreateEndpointForUri(endpointUri, UMOEndpoint.ENDPOINT_TYPE_RECEIVER); if (!asynchronous) { endpoint.setSynchronous(true); } messageRouter.addEndpoint(endpoint); } } // set the implementation name to this bean so Mule will manage it descriptor.setImplementation( AbstractApplicationContext.APPLICATION_EVENT_MULTICASTER_BEAN_NAME); return descriptor; }