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

  • Reactive rest calls using spring rest template
  • getSupportFragmentManager (FragmentActivity)
  • setScale (BigDecimal)
  • compareTo (BigDecimal)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • 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