Apache Tomcat 7.0.28

org.apache.catalina.tribes.group.interceptors
Class MessageDispatch15Interceptor

java.lang.Object
  extended by org.apache.catalina.tribes.group.ChannelInterceptorBase
      extended by org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor
          extended by org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor
All Implemented Interfaces:
Runnable, ChannelInterceptor, Heartbeat, MembershipListener

public class MessageDispatch15Interceptor
extends MessageDispatchInterceptor

Same implementation as the MessageDispatchInterceptor except it uses an atomic long for the currentSize calculation and uses a thread pool for message sending.

Version:
1.0
Author:
Filip Hanik

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.catalina.tribes.ChannelInterceptor
ChannelInterceptor.InterceptorEvent
 
Field Summary
protected  AtomicLong currentSize
           
protected  ThreadPoolExecutor executor
           
protected  long keepAliveTime
           
protected  int maxSpareThreads
           
protected  int maxThreads
           
protected  LinkedBlockingQueue<Runnable> runnablequeue
           
 
Fields inherited from class org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor
alwaysSend, maxQueueSize, msgDispatchThread, queue, run, useDeepClone
 
Fields inherited from class org.apache.catalina.tribes.group.ChannelInterceptorBase
optionFlag
 
Constructor Summary
MessageDispatch15Interceptor()
           
 
Method Summary
 long addAndGetCurrentSize(long inc)
           
 boolean addToQueue(ChannelMessage msg, Member[] destination, InterceptorPayload payload)
           
 long getCurrentSize()
           
 long getKeepAliveTime()
           
 int getMaxSpareThreads()
           
 int getMaxThreads()
           
 LinkObject removeFromQueue()
           
 long setAndGetCurrentSize(long value)
           
 void setKeepAliveTime(long keepAliveTime)
           
 void setMaxSpareThreads(int maxSpareThreads)
           
 void setMaxThreads(int maxThreads)
           
 void startQueue()
           
 void stopQueue()
           
 
Methods inherited from class org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor
getMaxQueueSize, getUseDeepClone, isAlwaysSend, run, sendAsyncData, sendMessage, setAlwaysSend, setMaxQueueSize, setOptionFlag, setUseDeepClone, start, stop
 
Methods inherited from class org.apache.catalina.tribes.group.ChannelInterceptorBase
accept, fireInterceptorEvent, getLocalMember, getMember, getMembers, getNext, getOptionFlag, getPrevious, hasMembers, heartbeat, memberAdded, memberDisappeared, messageReceived, okToProcess, setNext, setPrevious
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentSize

protected AtomicLong currentSize

executor

protected ThreadPoolExecutor executor

maxThreads

protected int maxThreads

maxSpareThreads

protected int maxSpareThreads

keepAliveTime

protected long keepAliveTime

runnablequeue

protected LinkedBlockingQueue<Runnable> runnablequeue
Constructor Detail

MessageDispatch15Interceptor

public MessageDispatch15Interceptor()
Method Detail

getCurrentSize

public long getCurrentSize()
Overrides:
getCurrentSize in class MessageDispatchInterceptor

addAndGetCurrentSize

public long addAndGetCurrentSize(long inc)
Overrides:
addAndGetCurrentSize in class MessageDispatchInterceptor

setAndGetCurrentSize

public long setAndGetCurrentSize(long value)
Overrides:
setAndGetCurrentSize in class MessageDispatchInterceptor

addToQueue

public boolean addToQueue(ChannelMessage msg,
                          Member[] destination,
                          InterceptorPayload payload)
Overrides:
addToQueue in class MessageDispatchInterceptor

removeFromQueue

public LinkObject removeFromQueue()
Overrides:
removeFromQueue in class MessageDispatchInterceptor

startQueue

public void startQueue()
Overrides:
startQueue in class MessageDispatchInterceptor

stopQueue

public void stopQueue()
Overrides:
stopQueue in class MessageDispatchInterceptor

getKeepAliveTime

public long getKeepAliveTime()

getMaxSpareThreads

public int getMaxSpareThreads()

getMaxThreads

public int getMaxThreads()

setKeepAliveTime

public void setKeepAliveTime(long keepAliveTime)

setMaxSpareThreads

public void setMaxSpareThreads(int maxSpareThreads)

setMaxThreads

public void setMaxThreads(int maxThreads)

Apache Tomcat 7.0.28

Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.