public static MessageGroupMapFactory createMessageGroupMapFactory(String type) throws IOException { try { Map<String,String> properties = null; String factoryType = type.trim(); int p = factoryType.indexOf('?'); if (p >= 0){ String propertiesString = factoryType.substring(p+1); factoryType = factoryType.substring(0,p); properties = URISupport.parseQuery(propertiesString); } MessageGroupMapFactory result = (MessageGroupMapFactory)GROUP_FACTORY_FINDER.newInstance(factoryType); if (properties != null && result != null){ IntrospectionSupport.setProperties(result,properties); } return result; } catch (Throwable e) { throw IOExceptionSupport.create("Could not load " + type + " factory:" + e, e); } }
physicalName = physicalName.substring(0, p); try { options = URISupport.parseQuery(optstring); } catch (URISyntaxException e) { throw new IllegalArgumentException("Invalid destination name: " + physicalName + ", it's options are not encoded properly: " + e);
rc.path = stripPrefix(params.substring(0, p), "/"); rc.parameters = parseQuery(params.substring(p + 1)); } else { if (params.length() > 0) {
/** * Given a URI parse and extract any URI query options and return them as a Key / Value mapping. * * This method differs from the {@link parseQuery} method in that it handles composite URI types and * will extract the URI options from the outermost composite URI. * * @param uri * The URI whose query should be extracted and processed. * * @return A Mapping of the URI options. * @throws URISyntaxException */ public static Map<String, String> parseParameters(URI uri) throws URISyntaxException { if (!isCompositeURI(uri)) { return uri.getQuery() == null ? emptyMap() : parseQuery(stripPrefix(uri.getQuery(), "?")); } else { CompositeData data = URISupport.parseComposite(uri); Map<String, String> parameters = new HashMap<String, String>(); parameters.putAll(data.getParameters()); if (parameters.isEmpty()) { parameters = emptyMap(); } return parameters; } }
Map<String,String> map = URISupport.parseQuery(this.brokerURL.getQuery()); Map<String,Object> jmsOptionsMap = IntrospectionSupport.extractProperties(map, "jms."); if (buildFromMap(jmsOptionsMap)) {
static void populateProperties(Object value, URI url) throws IOException { String query = url.getQuery(); if (query != null) { try { Map map = URISupport.parseQuery(query); if (map != null && !map.isEmpty()) { IntrospectionSupport.setProperties(value, map); } } catch (URISyntaxException e) { e.printStackTrace(); throw new IOException(e.toString()); } } }
public static MessageGroupMapFactory createMessageGroupMapFactory(String type) throws IOException { try { Map<String,String> properties = null; String factoryType = type.trim(); int p = factoryType.indexOf('?'); if (p >= 0){ String propertiesString = factoryType.substring(p+1); factoryType = factoryType.substring(0,p); properties = URISupport.parseQuery(propertiesString); } MessageGroupMapFactory result = (MessageGroupMapFactory)GROUP_FACTORY_FINDER.newInstance(factoryType); if (properties != null && result != null){ IntrospectionSupport.setProperties(result,properties); } return result; } catch (Throwable e) { throw IOExceptionSupport.create("Could not load " + type + " factory:" + e, e); } }
public static MessageGroupMapFactory createMessageGroupMapFactory(String type) throws IOException { try { Map<String,String> properties = null; String factoryType = type.trim(); int p = factoryType.indexOf('?'); if (p >= 0){ String propertiesString = factoryType.substring(p+1); factoryType = factoryType.substring(0,p); properties = URISupport.parseQuery(propertiesString); } MessageGroupMapFactory result = (MessageGroupMapFactory)GROUP_FACTORY_FINDER.newInstance(factoryType); if (properties != null && result != null){ IntrospectionSupport.setProperties(result,properties); } return result; } catch (Throwable e) { throw IOExceptionSupport.create("Could not load " + type + " factory:" + e, e); } }
public static MessageGroupMapFactory createMessageGroupMapFactory(String type) throws IOException { try { Map<String,String> properties = null; String factoryType = type.trim(); int p = factoryType.indexOf('?'); if (p >= 0){ String propertiesString = factoryType.substring(p+1); factoryType = factoryType.substring(0,p); properties = URISupport.parseQuery(propertiesString); } MessageGroupMapFactory result = (MessageGroupMapFactory)GROUP_FACTORY_FINDER.newInstance(factoryType); if (properties != null && result != null){ IntrospectionSupport.setProperties(result,properties); } return result; } catch (Throwable e) { throw IOExceptionSupport.create("Could not load " + type + " factory:" + e, e); } }
IntrospectionSupport.setProperties(this, URISupport.parseQuery(uri)); uri = uri.substring(0, uri.lastIndexOf('?'));
public static Map<String, String> parseParameters(URI uri) throws URISyntaxException { if (!isCompositeURI(uri)) { return uri.getQuery() == null ? emptyMap() : parseQuery(stripPrefix(uri.getQuery(), "?")); } else { CompositeData data = URISupport.parseComposite(uri); Map<String, String> parameters = new HashMap<String, String>(); parameters.putAll(data.getParameters()); if (parameters.isEmpty()) { parameters = emptyMap(); } return parameters; } }
public BrokerService createBroker(URI config) throws Exception { String uri = config.getSchemeSpecificPart(); if (uri.lastIndexOf('?') != -1) { IntrospectionSupport.setProperties(this, URISupport.parseQuery(uri)); uri = uri.substring(0, uri.lastIndexOf('?'));
Map<String, String> query = parseQuery(ssp); String groupName = ssp.split("\\?")[0]; if (query.get("id") != null) {
public BrokerService createBroker(URI config) throws Exception { String uri = config.getSchemeSpecificPart(); if (uri.lastIndexOf('?') != -1) { IntrospectionSupport.setProperties(this, URISupport.parseQuery(uri)); uri = uri.substring(0, uri.lastIndexOf('?'));
public BrokerService createBroker(URI config) throws Exception { String uri = config.getSchemeSpecificPart(); if (uri.lastIndexOf('?') != -1) { IntrospectionSupport.setProperties(this, URISupport.parseQuery(uri)); uri = uri.substring(0, uri.lastIndexOf('?'));
Map<String, String> query = parseQuery(ssp); String groupName = ssp.split("\\?")[0]; if (query.get("id") != null) {
/** * Given a URI parse and extract any URI query options and return them as a Key / Value mapping. * * This method differs from the {@link parseQuery} method in that it handles composite URI types and * will extract the URI options from the outermost composite URI. * * @param uri * The URI whose query should be extracted and processed. * * @return A Mapping of the URI options. * @throws URISyntaxException */ public static Map<String, String> parseParameters(URI uri) throws URISyntaxException { if (!isCompositeURI(uri)) { return uri.getQuery() == null ? emptyMap() : parseQuery(stripPrefix(uri.getQuery(), "?")); } else { CompositeData data = URISupport.parseComposite(uri); Map<String, String> parameters = new HashMap<String, String>(); parameters.putAll(data.getParameters()); if (parameters.isEmpty()) { parameters = emptyMap(); } return parameters; } }
/** * Given a URI parse and extract any URI query options and return them as a Key / Value mapping. * * This method differs from the {@link parseQuery} method in that it handles composite URI types and * will extract the URI options from the outermost composite URI. * * @param uri * The URI whose query should be extracted and processed. * * @return A Mapping of the URI options. * @throws URISyntaxException */ public static Map<String, String> parseParameters(URI uri) throws URISyntaxException { if (!isCompositeURI(uri)) { return uri.getQuery() == null ? emptyMap() : parseQuery(stripPrefix(uri.getQuery(), "?")); } else { CompositeData data = URISupport.parseComposite(uri); Map<String, String> parameters = new HashMap<String, String>(); parameters.putAll(data.getParameters()); if (parameters.isEmpty()) { parameters = emptyMap(); } return parameters; } }
/** * Given a URI parse and extract any URI query options and return them as a Key / Value mapping. * * This method differs from the {@link parseQuery} method in that it handles composite URI types and * will extract the URI options from the outermost composite URI. * * @param uri * The URI whose query should be extracted and processed. * * @return A Mapping of the URI options. * @throws URISyntaxException */ public static Map<String, String> parseParameters(URI uri) throws URISyntaxException { if (!isCompositeURI(uri)) { return uri.getQuery() == null ? emptyMap() : parseQuery(stripPrefix(uri.getQuery(), "?")); } else { CompositeData data = URISupport.parseComposite(uri); Map<String, String> parameters = new HashMap<String, String>(); parameters.putAll(data.getParameters()); if (parameters.isEmpty()) { parameters = emptyMap(); } return parameters; } }
/** * Sets the <a * href="http://activemq.apache.org/configuring-transports.html">connection * URL</a> used to connect to the ActiveMQ broker. */ public void setBrokerURL(String brokerURL) { this.brokerURL = createURI(brokerURL); // Use all the properties prefixed with 'jms.' to set the connection // factory // options. if (this.brokerURL.getQuery() != null) { // It might be a standard URI or... try { Map map = URISupport.parseQuery(this.brokerURL.getQuery()); if (buildFromMap(IntrospectionSupport.extractProperties(map, "jms."))) { this.brokerURL = URISupport.createRemainingURI(this.brokerURL, map); } } catch (URISyntaxException e) { } } 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) { } } }