Package org.apache.activemq.command

Examples of org.apache.activemq.command.WireFormatInfo


            public void transportResumed() {
            }
        });
        clientTransport.start();
        WireFormatInfo info = new WireFormatInfo();
        info.setVersion(OpenWireFormat.DEFAULT_VERSION);
        info.setMaxInactivityDuration(1000);
        clientTransport.oneway(info);

        assertEquals(0, serverErrorCount.get());
        assertEquals(0, clientErrorCount.get());
View Full Code Here


            public void transportInterupted() {
            }
            public void transportResumed() {
            }});
        clientTransport.start();
        WireFormatInfo info = new WireFormatInfo();
        info.seMaxInactivityDuration(1000);
        clientTransport.oneway(info);
       
        assertEquals(0, serverErrorCount.get());
        assertEquals(0, clientErrorCount.get());
       
View Full Code Here

import org.apache.activemq.command.WireFormatInfo;

public class WireFormatInfoData extends DataFileGenerator {

    protected Object createObject() throws IOException {
        WireFormatInfo rc = new WireFormatInfo();
        rc.setResponseRequired(false);
        rc.setCacheEnabled(true);
        rc.setVersion(1);
        return rc;
    }
View Full Code Here

   
    public void start() throws Exception {
        super.start();
        if( firstStart.compareAndSet(true, false) ) {
          try {
            WireFormatInfo info = wireFormat.getPreferedWireFormatInfo();
                if (log.isDebugEnabled()) {
                    log.debug("Sending: " + info);
                }
              sendWireFormat(info);
          } finally {
View Full Code Here

    public void onCommand(Object o) {
      Command command = (Command) o;
        if( command.isWireFormatInfo() ) {
            WireFormatInfo info = (WireFormatInfo) command;
            if (log.isDebugEnabled()) {
                log.debug("Received WireFormat: " + info);
            }
           
            try {
                wireInfoSentDownLatch.await();
               
                if (log.isDebugEnabled()) {
                    log.debug(this + " before negotiation: " + wireFormat);
                }
                if( !info.isValid() ) {
                    onException(new IOException("Remote wire format magic is invalid"));
                } else if( info.getVersion() < minimumVersion ) {
                    onException(new IOException("Remote wire format ("+info.getVersion()+") is lower the minimum version required ("+minimumVersion+")"));
                }
               
                wireFormat.renegotiateWireFormat(info);
               
                if (log.isDebugEnabled()) {
View Full Code Here

    private boolean sizePrefixDisabled=false;
    private long maxInactivityDuration=30*1000;
    private int cacheSize=1024;
   
    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.seMaxInactivityDuration(maxInactivityDuration);
            info.setCacheSize(cacheSize);
    } catch (Exception e) {
      IllegalStateException ise = new IllegalStateException("Could not configure WireFormatInfo");
            ise.initCause(e);
            throw ise;
    }
View Full Code Here

        // Read the command directly from the reader, assuming UTF8 encoding
        ServletInputStream sis = request.getInputStream();
        Command command = (Command) wireFormat.unmarshalText(new InputStreamReader(sis, "UTF-8"));

        if (command instanceof WireFormatInfo) {
            WireFormatInfo info = (WireFormatInfo) command;
            if (!canProcessWireFormatVersion(info.getVersion())) {
                response.sendError(HttpServletResponse.SC_NOT_FOUND, "Cannot process wire format of version: "
                        + info.getVersion());
            }

        } else {

            BlockingQueueTransport transport = getTransportChannel(request, response);
View Full Code Here

        // Read the command directly from the reader
        Command command = (Command) wireFormat.unmarshalText(request.getReader());

        if (command instanceof WireFormatInfo) {
            WireFormatInfo info = (WireFormatInfo) command;
            if (!canProcessWireFormatVersion(info.getVersion())) {
                response.sendError(HttpServletResponse.SC_NOT_FOUND, "Cannot process wire format of version: " + info.getVersion());
            }

        } else {

            BlockingQueueTransport transport = getTransportChannel(request, response);
View Full Code Here

        // Read the command directly from the reader
        Command command = (Command)wireFormat.unmarshalText(request.getReader());

        if (command instanceof WireFormatInfo) {
            WireFormatInfo info = (WireFormatInfo)command;
            if (!canProcessWireFormatVersion(info.getVersion())) {
                response.sendError(HttpServletResponse.SC_NOT_FOUND, "Cannot process wire format of version: " + info.getVersion());
            }

        } else {

            BlockingQueueTransport transport = getTransportChannel(request, response);
View Full Code Here

import org.apache.activemq.command.WireFormatInfo;

public class WireFormatInfoData extends DataFileGenerator {

    protected Object createObject() throws IOException {
        WireFormatInfo rc = new WireFormatInfo();
        rc.setResponseRequired(false);
        rc.setCacheEnabled(true);
        rc.setVersion(1);
        return rc;
    }
View Full Code Here

TOP

Related Classes of org.apache.activemq.command.WireFormatInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.