public static Map<String, Map<String, Object>> extractWireFormatOptions(Map<String, String> options ) { Map<String, Map<String, Object>> wireFormatOptions = new HashMap<>(); if (options != null) { wireFormatOptions.put(OPENWIRE, IntrospectionSupport.extractProperties(options, "wireFormat.default.")); wireFormatOptions.put(STOMP, IntrospectionSupport.extractProperties(options, "wireFormat.stomp.")); wireFormatOptions.put(AMQP, IntrospectionSupport.extractProperties(options, "wireFormat.amqp.")); wireFormatOptions.put(MQTT, IntrospectionSupport.extractProperties(options, "wireFormat.mqtt.")); wireFormatOptions.put(ALL, IntrospectionSupport.extractProperties(options, "wireFormat.")); } return wireFormatOptions; }
public Transport doConnect(URI location) throws Exception { try { Map<String, String> options = new HashMap<String, String>(URISupport.parseParameters(location)); if( !options.containsKey("wireFormat.host") ) { options.put("wireFormat.host", location.getHost()); } WireFormat wf = createWireFormat(options); Transport transport = createTransport(location, wf); Transport rc = configure(transport, wf, options); //remove auto IntrospectionSupport.extractProperties(options, "auto."); if (!options.isEmpty()) { throw new IllegalArgumentException("Invalid connect parameters: " + options); } return rc; } catch (URISyntaxException e) { throw IOExceptionSupport.create(e); } }
Map<String,Object> jmsOptionsMap = IntrospectionSupport.extractProperties(map, "jms."); if (buildFromMap(jmsOptionsMap)) { if (!jmsOptionsMap.isEmpty()) { Map<String,Object> jmsOptionsMap = IntrospectionSupport.extractProperties(data.getParameters(), "jms."); if (buildFromMap(jmsOptionsMap)) { if (!jmsOptionsMap.isEmpty()) {
public FailoverTransport createTransport(Map<String, String> parameters) throws IOException { FailoverTransport transport = new FailoverTransport(); Map<String, Object> nestedExtraQueryOptions = IntrospectionSupport.extractProperties(parameters, "nested."); IntrospectionSupport.setProperties(transport, parameters); try { transport.setNestedExtraQueryOptions(URISupport.createQueryString(nestedExtraQueryOptions)); } catch (URISyntaxException e) { } return transport; }
/** * Overriding to use SslTransportServer and allow for proper reflection. */ @Override public TransportServer doBind(final URI location) throws IOException { try { Map<String, String> options = new HashMap<String, String>(URISupport.parseParameters(location)); Map<String, Object> autoProperties = IntrospectionSupport.extractProperties(options, "auto."); this.enabledProtocols = AutoTransportUtils.parseProtocols((String) autoProperties.get("protocols")); ServerSocketFactory serverSocketFactory = createServerSocketFactory(); AutoSslTransportServer server = createAutoSslTransportServer(location, (SSLServerSocketFactory)serverSocketFactory); if (options.get("allowLinkStealing") != null){ allowLinkStealingSet = true; } IntrospectionSupport.setProperties(server, options); server.setAutoTransportOptions(IntrospectionSupport.extractProperties(options, "auto.")); server.setTransportOption(IntrospectionSupport.extractProperties(options, "transport.")); server.setWireFormatOptions(AutoTransportUtils.extractWireFormatOptions(options)); server.bind(); return server; } catch (URISyntaxException e) { throw IOExceptionSupport.create(e); } }
@Override public TransportServer doBind(final URI location) throws IOException { try { Map<String, String> options = new HashMap<String, String>(URISupport.parseParameters(location)); Map<String, Object> autoProperties = IntrospectionSupport.extractProperties(options, "auto."); this.enabledProtocols = AutoTransportUtils.parseProtocols((String) autoProperties.get("protocols")); ServerSocketFactory serverSocketFactory = createServerSocketFactory(); AutoTcpTransportServer server = createTcpTransportServer(location, serverSocketFactory); //server.setWireFormatFactory(createWireFormatFactory(options)); server.setWireFormatFactory(new OpenWireFormatFactory()); if (options.get("allowLinkStealing") != null){ allowLinkStealingSet = true; } IntrospectionSupport.setProperties(server, options); server.setTransportOption(IntrospectionSupport.extractProperties(options, "transport.")); server.setWireFormatOptions(AutoTransportUtils.extractWireFormatOptions(options)); server.bind(); return server; } catch (URISyntaxException e) { throw IOExceptionSupport.create(e); } }
@Override public TransportServer doBind(final URI location) throws IOException { try { Map<String, String> options = new HashMap<String, String>(URISupport.parseParameters(location)); Map<String, Object> autoProperties = IntrospectionSupport.extractProperties(options, "auto."); this.enabledProtocols = AutoTransportUtils.parseProtocols((String) autoProperties.get("protocols")); ServerSocketFactory serverSocketFactory = createServerSocketFactory(); AutoTcpTransportServer server = createTcpTransportServer(location, serverSocketFactory); //server.setWireFormatFactory(createWireFormatFactory(options)); server.setWireFormatFactory(new OpenWireFormatFactory()); if (options.get("allowLinkStealing") != null){ allowLinkStealingSet = true; } IntrospectionSupport.setProperties(server, options); server.setTransportOption(IntrospectionSupport.extractProperties(options, "transport.")); server.setWireFormatOptions(AutoTransportUtils.extractWireFormatOptions(options)); server.bind(); return server; } catch (URISyntaxException e) { throw IOExceptionSupport.create(e); } }
@Override public TransportServer doBind(final URI location) throws IOException { try { if (SslContext.getCurrentSslContext() != null) { try { context = SslContext.getCurrentSslContext().getSSLContext(); } catch (Exception e) { throw new IOException(e); } } Map<String, String> options = new HashMap<String, String>(URISupport.parseParameters(location)); Map<String, Object> autoProperties = IntrospectionSupport.extractProperties(options, "auto."); this.enabledProtocols = AutoTransportUtils.parseProtocols((String) autoProperties.get("protocols")); ServerSocketFactory serverSocketFactory = createServerSocketFactory(); AutoTcpTransportServer server = createTcpTransportServer(location, serverSocketFactory); server.setWireFormatFactory(new OpenWireFormatFactory()); if (options.get("allowLinkStealing") != null){ allowLinkStealingSet = true; } IntrospectionSupport.setProperties(server, options); server.setAutoTransportOptions(IntrospectionSupport.extractProperties(options, "auto.")); server.setTransportOption(IntrospectionSupport.extractProperties(options, "transport.")); server.setWireFormatOptions(AutoTransportUtils.extractWireFormatOptions(options)); server.bind(); return server; } catch (URISyntaxException e) { throw IOExceptionSupport.create(e); } }
/** * Overriding to use SslTransportServer and allow for proper reflection. */ @Override public TransportServer doBind(final URI location) throws IOException { try { Map<String, String> options = new HashMap<String, String>(URISupport.parseParameters(location)); ServerSocketFactory serverSocketFactory = createServerSocketFactory(); SslTransportServer server = createSslTransportServer(location, (SSLServerSocketFactory)serverSocketFactory); server.setWireFormatFactory(createWireFormatFactory(options)); IntrospectionSupport.setProperties(server, options); Map<String, Object> transportOptions = IntrospectionSupport.extractProperties(options, "transport."); server.setTransportOption(transportOptions); server.bind(); return server; } catch (URISyntaxException e) { throw IOExceptionSupport.create(e); } }
@Override public TransportServer doBind(final URI location) throws IOException { try { Map<String, String> options = new HashMap<String, String>(URISupport.parseParameters(location)); ServerSocketFactory serverSocketFactory = createServerSocketFactory(); TcpTransportServer server = createTcpTransportServer(location, serverSocketFactory); server.setWireFormatFactory(createWireFormatFactory(options)); IntrospectionSupport.setProperties(server, options); Map<String, Object> transportOptions = IntrospectionSupport.extractProperties(options, "transport."); server.setTransportOption(transportOptions); server.bind(); return server; } catch (URISyntaxException e) { throw IOExceptionSupport.create(e); } }
brokerURI = new URI(config); } else { Map<String, Object> brokerOptions = IntrospectionSupport.extractProperties(options, "broker."); brokerURI = new URI("broker://()/" + host + "?" + URISupport.createQueryString(brokerOptions));
Map<String, Object> options = IntrospectionSupport.extractProperties( new HashMap<String, Object>(destination.getOptions()), "producer."); IntrospectionSupport.setProperties(this.info, options);
@Override @SuppressWarnings("rawtypes") public Transport compositeConfigure(Transport transport, WireFormat format, Map options) { TcpTransport tcpTransport = transport.narrow(TcpTransport.class); IntrospectionSupport.setProperties(tcpTransport, options); Map<String, Object> socketOptions = IntrospectionSupport.extractProperties(options, "socket."); tcpTransport.setSocketOptions(socketOptions); if (tcpTransport.isTrace()) { try { transport = TransportLoggerSupport.createTransportLogger(transport, tcpTransport.getLogWriterName(), tcpTransport.isDynamicManagement(), tcpTransport.isStartLogging(), tcpTransport.getJmxPort()); } catch (Throwable e) { LOG.error("Could not create TransportLogger object for: " + tcpTransport.getLogWriterName() + ", reason: " + e, e); } } boolean useInactivityMonitor = "true".equals(getOption(options, "useInactivityMonitor", "true")); if (useInactivityMonitor && isUseInactivityMonitor(transport)) { transport = createInactivityMonitor(transport, format); IntrospectionSupport.setProperties(transport, options); } // Only need the WireFormatNegotiator if using openwire if (format instanceof OpenWireFormat) { transport = new WireFormatNegotiator(transport, (OpenWireFormat)format, tcpTransport.getMinmumWireFormatVersion()); } return super.compositeConfigure(transport, format, options); }
Map<String, Object> options = IntrospectionSupport.extractProperties( new HashMap<String, Object>(dest.getOptions()), "consumer."); IntrospectionSupport.setProperties(this.info, options);
public static Map<String, Map<String, Object>> extractWireFormatOptions(Map<String, String> options ) { Map<String, Map<String, Object>> wireFormatOptions = new HashMap<>(); if (options != null) { wireFormatOptions.put(OPENWIRE, IntrospectionSupport.extractProperties(options, "wireFormat.default.")); wireFormatOptions.put(STOMP, IntrospectionSupport.extractProperties(options, "wireFormat.stomp.")); wireFormatOptions.put(AMQP, IntrospectionSupport.extractProperties(options, "wireFormat.amqp.")); wireFormatOptions.put(MQTT, IntrospectionSupport.extractProperties(options, "wireFormat.mqtt.")); wireFormatOptions.put(ALL, IntrospectionSupport.extractProperties(options, "wireFormat.")); } return wireFormatOptions; }
public FailoverTransport createTransport(Map<String, String> parameters) throws IOException { FailoverTransport transport = new FailoverTransport(); Map<String, Object> nestedExtraQueryOptions = IntrospectionSupport.extractProperties(parameters, "nested."); IntrospectionSupport.setProperties(transport, parameters); try { transport.setNestedExtraQueryOptions(URISupport.createQueryString(nestedExtraQueryOptions)); } catch (URISyntaxException e) { } return transport; }
public FailoverTransport createTransport(Map<String, String> parameters) throws IOException { FailoverTransport transport = new FailoverTransport(); Map<String, Object> nestedExtraQueryOptions = IntrospectionSupport.extractProperties(parameters, "nested."); IntrospectionSupport.setProperties(transport, parameters); try { transport.setNestedExtraQueryOptions(URISupport.createQueryString(nestedExtraQueryOptions)); } catch (URISyntaxException e) { } return transport; }
public FailoverTransport createTransport(Map<String, String> parameters) throws IOException { FailoverTransport transport = new FailoverTransport(); Map<String, Object> nestedExtraQueryOptions = IntrospectionSupport.extractProperties(parameters, "nested."); IntrospectionSupport.setProperties(transport, parameters); try { transport.setNestedExtraQueryOptions(URISupport.createQueryString(nestedExtraQueryOptions)); } catch (URISyntaxException e) { } return transport; }
@Override @SuppressWarnings("rawtypes") public Transport compositeConfigure(Transport transport, WireFormat format, Map options) { AmqpTransportFilter amqpTransport = new AmqpTransportFilter(transport, format, brokerService); Map<String, Object> wireFormatOptions = IntrospectionSupport.extractProperties(options, "wireFormat."); IntrospectionSupport.setProperties(amqpTransport, options); IntrospectionSupport.setProperties(amqpTransport.getWireFormat(), wireFormatOptions); return super.compositeConfigure(amqpTransport, format, options); }
@Override @SuppressWarnings("rawtypes") public Transport compositeConfigure(Transport transport, WireFormat format, Map options) { AmqpTransportFilter amqpTransport = new AmqpTransportFilter(transport, format, brokerService); Map<String, Object> wireFormatOptions = IntrospectionSupport.extractProperties(options, "wireFormat."); IntrospectionSupport.setProperties(amqpTransport, options); IntrospectionSupport.setProperties(amqpTransport.getWireFormat(), wireFormatOptions); return super.compositeConfigure(amqpTransport, format, options); }