*/
public class DefaultBrokerFactory implements BrokerFactoryHandler {
public BrokerService createBroker(URI brokerURI) throws Exception {
CompositeData compositeData = URISupport.parseComposite(brokerURI);
Map<String, String> params = new HashMap<String, String>(compositeData.getParameters());
BrokerService brokerService = new BrokerService();
IntrospectionSupport.setProperties(brokerService, params);
if (compositeData.getPath() != null) {
brokerService.setBrokerName(compositeData.getPath());
}
URI[] components = compositeData.getComponents();
for (int i = 0; i < components.length; i++) {
if ("network".equals(components[i].getScheme())) {
brokerService.addNetworkConnector(components[i].getSchemeSpecificPart());
} else if ("proxy".equals(components[i].getScheme())) {
brokerService.addProxyConnector(components[i].getSchemeSpecificPart());