当前位置: 首页>>代码示例>>Java>>正文


Java WireFormat类代码示例

本文整理汇总了Java中org.apache.activemq.wireformat.WireFormat的典型用法代码示例。如果您正苦于以下问题:Java WireFormat类的具体用法?Java WireFormat怎么用?Java WireFormat使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


WireFormat类属于org.apache.activemq.wireformat包,在下文中一共展示了WireFormat类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getCommandInfo

import org.apache.activemq.wireformat.WireFormat; //导入依赖的package包/类
private String getCommandInfo(KahaSubscriptionCommand command) {
    KahaDestination destination = command.getDestination();
    String result = getDestinationInfo(destination);

    if(command.hasSubscriptionInfo()) {
        try {
            Buffer buffer = command.getSubscriptionInfo();
            ByteSequence sequence = new ByteSequence(buffer.getData(), buffer.getOffset(), buffer.getLength());
            WireFormat wireFormat = new OpenWireFormat();
            SubscriptionInfo subscriptionInfo = (SubscriptionInfo)wireFormat.unmarshal(sequence);

            result += ", ClientId: " + subscriptionInfo.getClientId();
        } catch (Throwable throwable) {
            showException(throwable);
        }
    }

    result += ", SubKey: " + command.getSubscriptionKey();

    return result;
}
 
开发者ID:Hill30,项目名称:amq-kahadb-tool,代码行数:22,代码来源:KahaDBJournalsReader.java

示例2: createSslTransportServer

import org.apache.activemq.wireformat.WireFormat; //导入依赖的package包/类
protected SslTransportServer createSslTransportServer(final URI location, SSLServerSocketFactory serverSocketFactory) throws IOException, URISyntaxException {
    return new SslTransportServer(this, location, serverSocketFactory) {

        @Override
        protected Transport createTransport(Socket socket, WireFormat format) throws IOException {
            return new SslTransport(format, (SSLSocket)socket) {

                private X509Certificate[] cachedPeerCerts;

                @Override
                public void doConsume(Object command) {
                    StompFrame frame = (StompFrame) command;
                    if (cachedPeerCerts == null) {
                        cachedPeerCerts = getPeerCertificates();
                    }
                    frame.setTransportContext(cachedPeerCerts);
                    super.doConsume(command);
                }
            };
        }
    };
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:23,代码来源:StompSslTransportFactory.java

示例3: createTcpTransportServer

import org.apache.activemq.wireformat.WireFormat; //导入依赖的package包/类
@Override
protected TcpTransportServer createTcpTransportServer(URI location, ServerSocketFactory serverSocketFactory) throws IOException, URISyntaxException {
    return new NIOSSLTransportServer(context, this, location, serverSocketFactory) {

        @Override
        protected Transport createTransport(Socket socket, WireFormat format) throws IOException {
            StompNIOSSLTransport transport = new StompNIOSSLTransport(format, socket);
            if (context != null) {
                transport.setSslContext(context);
            }

            transport.setNeedClientAuth(isNeedClientAuth());
            transport.setWantClientAuth(isWantClientAuth());

            return transport;
        }
    };
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:19,代码来源:StompNIOSSLTransportFactory.java

示例4: createTransport

import org.apache.activemq.wireformat.WireFormat; //导入依赖的package包/类
/**
 * Overriding to use SslTransports.
 */
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 SslTransport to use", e);
        }
    }
    SocketFactory socketFactory = createSocketFactory();
    return new SslTransport(wf, (SSLSocketFactory)socketFactory, location, localLocation, false);
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:21,代码来源:SslTransportFactory.java

示例5: createTransport

import org.apache.activemq.wireformat.WireFormat; //导入依赖的package包/类
@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);
      }
   }
   SocketFactory socketFactory = createSocketFactory();
   return createTcpFaultyTransport(wf, socketFactory, location, localLocation);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:19,代码来源:TcpFaultyTransportFactory.java

示例6: createWireFormat

import org.apache.activemq.wireformat.WireFormat; //导入依赖的package包/类
public WireFormat createWireFormat() {
    WireFormatInfo info = new WireFormatInfo();
    info.setVersion(version);

    try {
        info.setStackTraceEnabled(stackTraceEnabled);
        info.setCacheEnabled(cacheEnabled);
        info.setTcpNoDelayEnabled(tcpNoDelayEnabled);
        info.setTightEncodingEnabled(tightEncodingEnabled);
        info.setSizePrefixDisabled(sizePrefixDisabled);
        info.setMaxInactivityDuration(maxInactivityDuration);
        info.setMaxInactivityDurationInitalDelay(maxInactivityDurationInitalDelay);
        info.setCacheSize(cacheSize);
        info.setMaxFrameSize(maxFrameSize);
    } catch (Exception e) {
        IllegalStateException ise = new IllegalStateException("Could not configure WireFormatInfo");
        ise.initCause(e);
        throw ise;
    }

    OpenWireFormat f = new OpenWireFormat(version);
    f.setMaxFrameSize(maxFrameSize);
    f.setPreferedWireFormatInfo(info);
    return f;
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:26,代码来源:OpenWireFormatFactory.java

示例7: serverConfigure

import org.apache.activemq.wireformat.WireFormat; //导入依赖的package包/类
@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();
    }

    // MutexTransport mutex = transport.narrow(MutexTransport.class);
    // if (mutex != null) {
    // mutex.setSyncOnCommand(true);
    // }

    return transport;
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:18,代码来源:AMQPSslTransportFactory.java

示例8: createTcpTransportServer

import org.apache.activemq.wireformat.WireFormat; //导入依赖的package包/类
@Override
protected TcpTransportServer createTcpTransportServer(URI location, ServerSocketFactory serverSocketFactory) throws IOException, URISyntaxException {
    return new TcpTransportServer(this, location, serverSocketFactory) {
        protected Transport createTransport(Socket socket, WireFormat format) throws IOException {
            AmqpNioSslTransport transport = new AmqpNioSslTransport(format, socket);
            if (context != null) {
                transport.setSslContext(context);
            }
            return transport;
        }

        @Override
        public boolean isSslServer() {
            return true;
        }
    };
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:18,代码来源:AmqpNioSslTransportFactory.java

示例9: createTransport

import org.apache.activemq.wireformat.WireFormat; //导入依赖的package包/类
/**
 * Overriding to use SslTransports.
 */
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 SslTransport to use", e);
        }
    }
    SocketFactory socketFactory = createSocketFactory();
    return new SslTransport(wf, (SSLSocketFactory) socketFactory, location, localLocation, false);
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:22,代码来源:NIOSSLTransportFactory.java

示例10: configure

import org.apache.activemq.wireformat.WireFormat; //导入依赖的package包/类
/**
 * Configures the transport
 *
 * @param acceptServer true if this transport is used purely as an 'accept'
 *                transport for new connections which work like TCP
 *                SocketServers where new connections spin up a new separate
 *                UDP transport
 */
protected Transport configure(Transport transport, WireFormat format, Map options, boolean acceptServer) throws Exception {
    IntrospectionSupport.setProperties(transport, options);
    UdpTransport udpTransport = (UdpTransport)transport;

    OpenWireFormat openWireFormat = asOpenWireFormat(format);

    if (udpTransport.isTrace()) {
        transport = TransportLoggerSupport.createTransportLogger(transport);
    }

    transport = new InactivityMonitor(transport, format);

    if (!acceptServer && format instanceof OpenWireFormat) {
        transport = configureClientSideNegotiator(transport, format, udpTransport);
    }

    // deal with fragmentation

    if (acceptServer) {
        // lets not support a buffer of messages to enable reliable
        // messaging on the 'accept server' transport
        udpTransport.setReplayEnabled(false);

        // we don't want to do reliable checks on this transport as we
        // delegate to one that does
        transport = new CommandJoiner(transport, openWireFormat);
        return transport;
    } else {
        ReliableTransport reliableTransport = new ReliableTransport(transport, udpTransport);
        Replayer replayer = reliableTransport.getReplayer();
        reliableTransport.setReplayStrategy(createReplayStrategy(replayer));

        // Joiner must be on outside as the inbound messages must be
        // processed by the reliable transport first
        return new CommandJoiner(reliableTransport, openWireFormat);
    }
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:46,代码来源:UdpTransportFactory.java

示例11: StompTransportFilter

import org.apache.activemq.wireformat.WireFormat; //导入依赖的package包/类
public StompTransportFilter(Transport next, WireFormat wireFormat, BrokerContext brokerContext) {
    super(next);
    this.protocolConverter = new ProtocolConverter(this, brokerContext);

    if (wireFormat instanceof StompWireFormat) {
        this.wireFormat = (StompWireFormat) wireFormat;
    }
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:9,代码来源:StompTransportFilter.java

示例12: createInactivityMonitor

import org.apache.activemq.wireformat.WireFormat; //导入依赖的package包/类
@Override
protected Transport createInactivityMonitor(Transport transport, WireFormat format) {
    StompInactivityMonitor monitor = new StompInactivityMonitor(transport, format);

    StompTransportFilter filter = (StompTransportFilter) transport.narrow(StompTransportFilter.class);
    filter.setInactivityMonitor(monitor);

    return monitor;
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:10,代码来源:StompTransportFactory.java

示例13: serverConfigure

import org.apache.activemq.wireformat.WireFormat; //导入依赖的package包/类
@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;
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:13,代码来源:StompSslTransportFactory.java

示例14: createTcpTransportServer

import org.apache.activemq.wireformat.WireFormat; //导入依赖的package包/类
protected TcpTransportServer createTcpTransportServer(URI location, ServerSocketFactory serverSocketFactory) throws IOException, URISyntaxException {
    return new TcpTransportServer(this, location, serverSocketFactory) {
        protected Transport createTransport(Socket socket, WireFormat format) throws IOException {
            return new StompNIOTransport(format, socket);
        }
    };
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:8,代码来源:StompNIOTransportFactory.java

示例15: createTransport

import org.apache.activemq.wireformat.WireFormat; //导入依赖的package包/类
@Override
protected Transport createTransport(Socket socket, WireFormat format) throws IOException {
   Transport transport;
   transport = new NIOTransport(format, socket);
   debugTransportFilter = new DebugTransportFilter(transport);
   return debugTransportFilter;
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:8,代码来源:CheckDuplicateMessagesOnDuplexTest.java


注:本文中的org.apache.activemq.wireformat.WireFormat类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。