public Transport doCompositeConnect(URI location) throws Exception { try { Map<String, String> options = new HashMap<String, String>(URISupport.parseParameters(location)); WireFormat wf = createWireFormat(options); Transport transport = createTransport(location, wf); Transport rc = compositeConfigure(transport, wf, options); if (!options.isEmpty()) { throw new IllegalArgumentException("Invalid connect parameters: " + options); } return rc; } catch (URISyntaxException e) { throw IOExceptionSupport.create(e); } }
/** * Fully configures and adds all need transport filters so that the * transport can be used by the ActiveMQ message broker. The main difference * between this and the configure() method is that the broker does not issue * requests to the client so the ResponseCorrelator is not needed. * * @param transport * @param format * @param options * @return * @throws Exception */ @SuppressWarnings("rawtypes") public Transport serverConfigure(Transport transport, WireFormat format, HashMap options) throws Exception { if (options.containsKey(THREAD_NAME_FILTER)) { transport = new ThreadNameFilter(transport); } transport = compositeConfigure(transport, format, options); transport = new MutexTransport(transport); return transport; }
/** * Fully configures and adds all need transport filters so that the * transport can be used by the JMS client. * * @param transport * @param wf * @param options * @return * @throws Exception */ @SuppressWarnings("rawtypes") public Transport configure(Transport transport, WireFormat wf, Map options) throws Exception { transport = compositeConfigure(transport, wf, options); transport = new MutexTransport(transport); transport = new ResponseCorrelator(transport); return transport; }
@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); }
public Transport doCompositeConnect(URI location) throws Exception { try { Map<String, String> options = new HashMap<String, String>(URISupport.parseParameters(location)); WireFormat wf = createWireFormat(options); Transport transport = createTransport(location, wf); Transport rc = compositeConfigure(transport, wf, options); if (!options.isEmpty()) { throw new IllegalArgumentException("Invalid connect parameters: " + options); } return rc; } catch (URISyntaxException e) { throw IOExceptionSupport.create(e); } }
/** * Fully configures and adds all need transport filters so that the * transport can be used by the ActiveMQ message broker. The main difference * between this and the configure() method is that the broker does not issue * requests to the client so the ResponseCorrelator is not needed. * * @param transport * @param format * @param options * @return * @throws Exception */ @SuppressWarnings("rawtypes") public Transport serverConfigure(Transport transport, WireFormat format, HashMap options) throws Exception { if (options.containsKey(THREAD_NAME_FILTER)) { transport = new ThreadNameFilter(transport); } transport = compositeConfigure(transport, format, options); transport = new MutexTransport(transport); return transport; }
/** * Fully configures and adds all need transport filters so that the * transport can be used by the JMS client. * * @param transport * @param wf * @param options * @return * @throws Exception */ @SuppressWarnings("rawtypes") public Transport configure(Transport transport, WireFormat wf, Map options) throws Exception { transport = compositeConfigure(transport, wf, options); transport = new MutexTransport(transport); transport = new ResponseCorrelator(transport); return transport; }
public Transport doCompositeConnect(URI location) throws Exception { try { Map<String, String> options = new HashMap<String, String>(URISupport.parseParameters(location)); WireFormat wf = createWireFormat(options); Transport transport = createTransport(location, wf); Transport rc = compositeConfigure(transport, wf, options); if (!options.isEmpty()) { throw new IllegalArgumentException("Invalid connect parameters: " + options); } return rc; } catch (URISyntaxException e) { throw IOExceptionSupport.create(e); } }
public Transport doCompositeConnect(URI location) throws Exception { try { Map<String, String> options = new HashMap<String, String>(URISupport.parseParameters(location)); WireFormat wf = createWireFormat(options); Transport transport = createTransport(location, wf); Transport rc = compositeConfigure(transport, wf, options); if (!options.isEmpty()) { throw new IllegalArgumentException("Invalid connect parameters: " + options); } return rc; } catch (URISyntaxException e) { throw IOExceptionSupport.create(e); } }
/** * Fully configures and adds all need transport filters so that the * transport can be used by the JMS client. * * @param transport * @param wf * @param options * @return * @throws Exception */ @SuppressWarnings("rawtypes") public Transport configure(Transport transport, WireFormat wf, Map options) throws Exception { transport = compositeConfigure(transport, wf, options); transport = new MutexTransport(transport); transport = new ResponseCorrelator(transport); return transport; }
/** * Fully configures and adds all need transport filters so that the * transport can be used by the JMS client. * * @param transport * @param wf * @param options * @return * @throws Exception */ @SuppressWarnings("rawtypes") public Transport configure(Transport transport, WireFormat wf, Map options) throws Exception { transport = compositeConfigure(transport, wf, options); transport = new MutexTransport(transport); transport = new ResponseCorrelator(transport); return transport; }
/** * Fully configures and adds all need transport filters so that the * transport can be used by the JMS client. * * @param transport * @param wf * @param options * @return * @throws Exception */ public Transport configure(Transport transport, WireFormat wf, Map options) throws Exception { transport = compositeConfigure(transport, wf, options); transport = new MutexTransport(transport); transport = new ResponseCorrelator(transport); return transport; }
public Transport doCompositeConnect(URI location) throws Exception { try { Map<String, String> options = new HashMap<String, String>(URISupport.parseParameters(location)); WireFormat wf = createWireFormat(options); Transport transport = createTransport(location, wf); Transport rc = compositeConfigure(transport, wf, options); if (!options.isEmpty()) { throw new IllegalArgumentException("Invalid connect parameters: " + options); } return rc; } catch (URISyntaxException e) { throw IOExceptionSupport.create(e); } }
@Override @SuppressWarnings("rawtypes") public Transport compositeConfigure(Transport transport, WireFormat format, Map options) { transport = super.compositeConfigure(transport, format, options); HttpClientTransport httpTransport = transport.narrow(HttpClientTransport.class); if (httpTransport != null && httpTransport.isTrace()) { try { transport = TransportLoggerFactory.getInstance().createTransportLogger(transport); } catch (Throwable e) { LOG.error("Could not create TransportLogger object for: " + TransportLoggerFactory.defaultLogWriterName + ", reason: " + e, e); } } boolean useInactivityMonitor = "true".equals(getOption(options, "useInactivityMonitor", "true")); if (useInactivityMonitor) { transport = new HttpInactivityMonitor(transport); IntrospectionSupport.setProperties(transport, options); } return transport; } }
@Override @SuppressWarnings("rawtypes") public Transport compositeConfigure(Transport transport, WireFormat format, Map options) { transport = super.compositeConfigure(transport, format, options); HttpClientTransport httpTransport = transport.narrow(HttpClientTransport.class); if (httpTransport != null && httpTransport.isTrace()) { try { transport = TransportLoggerFactory.getInstance().createTransportLogger(transport); } catch (Throwable e) { LOG.error("Could not create TransportLogger object for: " + TransportLoggerFactory.defaultLogWriterName + ", reason: " + e, e); } } boolean useInactivityMonitor = "true".equals(getOption(options, "useInactivityMonitor", "true")); if (useInactivityMonitor) { transport = new HttpInactivityMonitor(transport); IntrospectionSupport.setProperties(transport, options); } return transport; } }
@SuppressWarnings("rawtypes") public Transport compositeConfigure(Transport transport, WireFormat format, Map options) { transport = super.compositeConfigure(transport, format, options); HttpClientTransport httpTransport = (HttpClientTransport)transport.narrow(HttpClientTransport.class); if(httpTransport != null && httpTransport.isTrace() ) { try { transport = TransportLoggerFactory.getInstance().createTransportLogger(transport); } catch (Throwable e) { LOG.error("Could not create TransportLogger object for: " + TransportLoggerFactory.defaultLogWriterName + ", reason: " + e, e); } } boolean useInactivityMonitor = "true".equals(getOption(options, "useInactivityMonitor", "true")); if (useInactivityMonitor) { transport = new InactivityMonitor(transport, null /* ignore wire format as no negotiation over http */); IntrospectionSupport.setProperties(transport, options); } return transport; } }
@Override @SuppressWarnings("rawtypes") public Transport compositeConfigure(Transport transport, WireFormat format, Map options) { transport = super.compositeConfigure(transport, format, options); HttpClientTransport httpTransport = transport.narrow(HttpClientTransport.class); if (httpTransport != null && httpTransport.isTrace()) { try { transport = TransportLoggerFactory.getInstance().createTransportLogger(transport); } catch (Throwable e) { LOG.error("Could not create TransportLogger object for: " + TransportLoggerFactory.defaultLogWriterName + ", reason: " + e, e); } } boolean useInactivityMonitor = "true".equals(getOption(options, "useInactivityMonitor", "true")); if (useInactivityMonitor) { transport = new HttpInactivityMonitor(transport); IntrospectionSupport.setProperties(transport, options); } 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); // Now wrap the filter with the monitor transport = createInactivityMonitor(amqpTransport, format); IntrospectionSupport.setProperties(transport, options); return super.compositeConfigure(transport, 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); // Now wrap the filter with the monitor transport = createInactivityMonitor(amqpTransport, format); IntrospectionSupport.setProperties(transport, options); return super.compositeConfigure(transport, format, 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); }