/** * Overriding to allow for proper configuration through reflection but delegate to get common * configuration */ @Override @SuppressWarnings("rawtypes") public Transport compositeConfigure(Transport transport, WireFormat format, Map options) { SslTransport sslTransport = transport.narrow(SslTransport.class); IntrospectionSupport.setProperties(sslTransport, options); return super.compositeConfigure(transport, format, options); }
@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); } }
@Override protected Transport createTransport(URI location, WireFormat wf) throws UnknownHostException, IOException { URI localLocation = null; String path = location.getPath(); // see if the path is a local URI location if (path != null && path.length() > 0) { int localPortIndex = path.indexOf(':'); try { Integer.parseInt(path.substring(localPortIndex + 1, path.length())); String localString = location.getScheme() + ":/" + path; localLocation = new URI(localString); } catch (Exception e) { LOG.warn("path isn't a valid local location for TcpTransport to use", e.getMessage()); if(LOG.isDebugEnabled()) { LOG.debug("Failure detail", e); } } } SocketFactory socketFactory = createSocketFactory(); return createTcpTransport(wf, socketFactory, location, localLocation); }
@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); }
@SuppressWarnings("rawtypes") @Override public Transport serverConfigure(Transport transport, WireFormat format, HashMap options) throws Exception { transport = super.serverConfigure(transport, format, options); // strip off the mutex transport. if (transport instanceof MutexTransport) { transport = ((MutexTransport) transport).getNext(); } return transport; }
public Transport compositeConfigure(Transport transport, WireFormat format, Map options) { TcpTransport 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 = TransportLoggerFactory.getInstance().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 = new InactivityMonitor(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); }
@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); }
@SuppressWarnings("rawtypes") @Override public Transport serverConfigure(Transport transport, WireFormat format, HashMap options) throws Exception { transport = super.serverConfigure(transport, format, options); // strip off the mutex transport. if (transport instanceof MutexTransport) { transport = ((MutexTransport) transport).getNext(); } return transport; }
@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); } }
@Override public Transport compositeConfigure(Transport transport, WireFormat format, Map options) { //transport = new StompTransportFilter(transport, new LegacyFrameTranslator()); 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); }
@Override protected Transport createTransport(URI location, WireFormat wf) throws UnknownHostException, IOException { URI localLocation = null; String path = location.getPath(); // see if the path is a local URI location if (path != null && path.length() > 0) { int localPortIndex = path.indexOf(':'); try { Integer.parseInt(path.substring(localPortIndex + 1, path.length())); String localString = location.getScheme() + ":/" + path; localLocation = new URI(localString); } catch (Exception e) { LOG.warn("path isn't a valid local location for TcpTransport to use", e.getMessage()); if(LOG.isDebugEnabled()) { LOG.debug("Failure detail", e); } } } SocketFactory socketFactory = createSocketFactory(); return createTcpTransport(wf, socketFactory, location, localLocation); }
@SuppressWarnings("rawtypes") @Override public Transport serverConfigure(Transport transport, WireFormat format, HashMap options) throws Exception { transport = super.serverConfigure(transport, format, options); MutexTransport mutex = transport.narrow(MutexTransport.class); if (mutex != null) { mutex.setSyncOnCommand(true); } return transport; }
@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); } }
@Override @SuppressWarnings("rawtypes") public Transport compositeConfigure(Transport transport, WireFormat format, Map options) { transport = new MQTTTransportFilter(transport, format, brokerService); 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); }
protected Transport createTransport(URI location, WireFormat wf) throws UnknownHostException, IOException { URI localLocation = null; String path = location.getPath(); // see if the path is a local URI location if (path != null && path.length() > 0) { int localPortIndex = path.indexOf(':'); try { Integer.parseInt(path.substring(localPortIndex + 1, path.length())); String localString = location.getScheme() + ":/" + path; localLocation = new URI(localString); } catch (Exception e) { LOG.warn("path isn't a valid local location for TcpTransport to use", e.getMessage()); if(LOG.isDebugEnabled()) { LOG.debug("Failure detail", e); } } } SocketFactory socketFactory = createSocketFactory(); return createTcpTransport(wf, socketFactory, location, localLocation); }
@SuppressWarnings("rawtypes") @Override public Transport serverConfigure(Transport transport, WireFormat format, HashMap options) throws Exception { transport = super.serverConfigure(transport, format, options); MutexTransport mutex = transport.narrow(MutexTransport.class); if (mutex != null) { mutex.setSyncOnCommand(true); } return transport; }
@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); } }
/** * Overriding to allow for proper configuration through reflection but delegate to get common * configuration */ @Override @SuppressWarnings("rawtypes") public Transport compositeConfigure(Transport transport, WireFormat format, Map options) { SslTransport sslTransport = transport.narrow(SslTransport.class); IntrospectionSupport.setProperties(sslTransport, options); return super.compositeConfigure(transport, format, options); }