Tabnine Logo
MessageDispatchInterceptor.addToQueue
Code IndexAdd Tabnine to your IDE (free)

How to use
addToQueue
method
in
org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor

Best Java code snippets using org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor.addToQueue (Showing top 4 results out of 315)

origin: org.apache.tomcat/tomcat-tribes

@Override
public void sendMessage(Member[] destination, ChannelMessage msg, InterceptorPayload payload)
    throws ChannelException {
  boolean async = (msg.getOptions() &
      Channel.SEND_OPTIONS_ASYNCHRONOUS) == Channel.SEND_OPTIONS_ASYNCHRONOUS;
  if (async && run) {
    if ((getCurrentSize()+msg.getMessage().getLength()) > maxQueueSize) {
      if (alwaysSend) {
        super.sendMessage(destination,msg,payload);
        return;
      } else {
        throw new ChannelException(sm.getString("messageDispatchInterceptor.queue.full",
            Long.toString(maxQueueSize), Long.toString(getCurrentSize())));
      }
    }
    //add to queue
    if (useDeepClone) {
      msg = (ChannelMessage)msg.deepclone();
    }
    if (!addToQueue(msg, destination, payload)) {
      throw new ChannelException(
          sm.getString("messageDispatchInterceptor.unableAdd.queue"));
    }
    addAndGetCurrentSize(msg.getMessage().getLength());
  } else {
    super.sendMessage(destination, msg, payload);
  }
}
origin: org.apache.catalina.springsource/com.springsource.org.apache.catalina.tribes.springsource

public void sendMessage(Member[] destination, ChannelMessage msg, InterceptorPayload payload) throws ChannelException {
  boolean async = (msg.getOptions() & Channel.SEND_OPTIONS_ASYNCHRONOUS) == Channel.SEND_OPTIONS_ASYNCHRONOUS;
  if ( async && run ) {
    if ( (getCurrentSize()+msg.getMessage().getLength()) > maxQueueSize ) {
      if ( alwaysSend ) {
        super.sendMessage(destination,msg,payload);
        return;
      } else {
        throw new ChannelException("Asynchronous queue is full, reached its limit of " + maxQueueSize +" bytes, current:" + getCurrentSize() + " bytes.");
      }//end if
    }//end if
    //add to queue
    if ( useDeepClone ) msg = (ChannelMessage)msg.deepclone();
    if (!addToQueue(msg, destination, payload) ) {
      throw new ChannelException("Unable to add the message to the async queue, queue bug?");
    }
    addAndGetCurrentSize(msg.getMessage().getLength());
  } else {
    super.sendMessage(destination, msg, payload);
  }
}

origin: org.apache.geronimo.ext.tomcat/tribes

@Override
public void sendMessage(Member[] destination, ChannelMessage msg, InterceptorPayload payload) throws ChannelException {
  boolean async = (msg.getOptions() & Channel.SEND_OPTIONS_ASYNCHRONOUS) == Channel.SEND_OPTIONS_ASYNCHRONOUS;
  if ( async && run ) {
    if ( (getCurrentSize()+msg.getMessage().getLength()) > maxQueueSize ) {
      if ( alwaysSend ) {
        super.sendMessage(destination,msg,payload);
        return;
      } else {
        throw new ChannelException("Asynchronous queue is full, reached its limit of " + maxQueueSize +" bytes, current:" + getCurrentSize() + " bytes.");
      }//end if
    }//end if
    //add to queue
    if ( useDeepClone ) msg = (ChannelMessage)msg.deepclone();
    if (!addToQueue(msg, destination, payload) ) {
      throw new ChannelException("Unable to add the message to the async queue, queue bug?");
    }
    addAndGetCurrentSize(msg.getMessage().getLength());
  } else {
    super.sendMessage(destination, msg, payload);
  }
}

origin: codefollower/Tomcat-Research

@Override
public void sendMessage(Member[] destination, ChannelMessage msg, InterceptorPayload payload)
    throws ChannelException {
  boolean async = (msg.getOptions() &
      Channel.SEND_OPTIONS_ASYNCHRONOUS) == Channel.SEND_OPTIONS_ASYNCHRONOUS;
  if ( async && run ) {
    if ( (getCurrentSize()+msg.getMessage().getLength()) > maxQueueSize ) {
      if ( alwaysSend ) {
        super.sendMessage(destination,msg,payload);
        return;
      } else {
        throw new ChannelException("Asynchronous queue is full, reached its limit of " +
            maxQueueSize +" bytes, current:" + getCurrentSize() + " bytes.");
      }//end if
    }//end if
    //add to queue
    if ( useDeepClone ) msg = (ChannelMessage)msg.deepclone();
    if (!addToQueue(msg, destination, payload) ) {
      throw new ChannelException(
          "Unable to add the message to the async queue, queue bug?");
    }
    addAndGetCurrentSize(msg.getMessage().getLength());
  } else {
    super.sendMessage(destination, msg, payload);
  }
}
org.apache.catalina.tribes.group.interceptorsMessageDispatchInterceptoraddToQueue

Popular methods of MessageDispatchInterceptor

  • addAndGetCurrentSize
  • getCurrentSize
  • sendAsyncData
  • setAndGetCurrentSize
  • setOptionFlag
  • startQueue
  • stopQueue
  • removeFromQueue
  • <init>
  • getChannel

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getApplicationContext (Context)
  • findViewById (Activity)
  • requestLocationUpdates (LocationManager)
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now