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

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

Best Java code snippets using org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor.getCurrentSize (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.interceptorsMessageDispatchInterceptorgetCurrentSize

Popular methods of MessageDispatchInterceptor

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

Popular in Java

  • Finding current android device location
  • findViewById (Activity)
  • getSharedPreferences (Context)
  • scheduleAtFixedRate (Timer)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • JButton (javax.swing)
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Top 12 Jupyter Notebook extensions
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