Package org.apache.activemq.util.URISupport

Examples of org.apache.activemq.util.URISupport.CompositeData


        CompositeData data = URISupport.parseComposite(new URI("test:part1"));
        assertEquals(1, data.getComponents().length);
    }

    public void testComposite() throws Exception {
        CompositeData data = URISupport.parseComposite(new URI("test:(part1://host,part2://(sub1://part,sube2:part))"));
        assertEquals(2, data.getComponents().length);
    }
View Full Code Here


*/
public class DefaultBrokerFactory implements BrokerFactoryHandler {

    public BrokerService createBroker(URI brokerURI) throws Exception {

        CompositeData compositeData = URISupport.parseComposite(brokerURI);
        Map params = new HashMap(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());
View Full Code Here

     * @throws IOException
     * @throws URISyntaxException
     */
    public Transport createTransport(URI location) throws IOException, URISyntaxException {
       
        CompositeData compositData = URISupport.parseComposite(location);
        Map parameters = new HashMap(compositData.getParameters());
        DiscoveryTransport transport = new DiscoveryTransport(createTransport(parameters));
       
        DiscoveryAgent discoveryAgent = DiscoveryAgentFactory.createDiscoveryAgent(compositData.getComponents()[0]);
        transport.setDiscoveryAgent(discoveryAgent);
       
        return transport;

    }
View Full Code Here

        } else {

            // It might be a composite URI.
            try {
                CompositeData data = URISupport.parseComposite(this.brokerURL);
                if( buildFromMap(IntrospectionSupport.extractProperties(data.getParameters(), "jms.")) ) {
                    this.brokerURL = data.toURI();
                }
            } catch (URISyntaxException e) {
            }
        }
    }
View Full Code Here

        } else {

            // It might be a composite URI.
            try {
                CompositeData data = URISupport.parseComposite(this.brokerURL);
                if (buildFromMap(IntrospectionSupport.extractProperties(data.getParameters(), "jms."))) {
                    this.brokerURL = data.toURI();
                }
            } catch (URISyntaxException e) {
            }
        }
    }
View Full Code Here

        } else {

            // It might be a composite URI.
            try {
                CompositeData data = URISupport.parseComposite(this.brokerURL);
                if (buildFromMap(IntrospectionSupport.extractProperties(data.getParameters(), "jms."))) {
                    this.brokerURL = data.toURI();
                }
            } catch (URISyntaxException e) {
            }
        }
    }
View Full Code Here

import org.apache.activemq.util.URISupport.CompositeData;

public class URISupportTest extends TestCase {

    public void testEmptyCompositePath() throws Exception {
        CompositeData data = URISupport.parseComposite(new URI("broker:()/localhost?persistent=false"));
        assertEquals(0, data.getComponents().length);
    }
View Full Code Here

        CompositeData data = URISupport.parseComposite(new URI("broker:()/localhost?persistent=false"));
        assertEquals(0, data.getComponents().length);
    }

    public void testCompositePath() throws Exception {
        CompositeData data = URISupport.parseComposite(new URI("test:(path)/path"));
        assertEquals("path", data.getPath());
        data = URISupport.parseComposite(new URI("test:path"));
        assertNull(data.getPath());
    }
View Full Code Here

        data = URISupport.parseComposite(new URI("test:path"));
        assertNull(data.getPath());
    }

    public void testSimpleComposite() throws Exception {
        CompositeData data = URISupport.parseComposite(new URI("test:part1"));
        assertEquals(1, data.getComponents().length);
    }
View Full Code Here

        assertEquals(1, data.getComponents().length);
    }

    public void testComposite() throws Exception {
        URI uri = new URI("test:(part1://host,part2://(sub1://part,sube2:part))");
        CompositeData data = URISupport.parseComposite(uri);
        assertEquals(2, data.getComponents().length);
    }
View Full Code Here

TOP

Related Classes of org.apache.activemq.util.URISupport.CompositeData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.