org.apache.catalina.tribes.group.interceptors

Class MessageDispatchInterceptor

public class MessageDispatchInterceptor extends ChannelInterceptorBase implements Runnable

The message dispatcher is a way to enable asynchronous communication through a channel. The dispatcher will look for the Channel.SEND_OPTIONS_ASYNCHRONOUS flag to be set, if it is, it will queue the message for delivery and immediately return to the sender.

Version: 1.0

Author: Filip Hanik

Field Summary
protected booleanalwaysSend
protected longcurrentSize
protected static Loglog
protected longmaxQueueSize
protected ThreadmsgDispatchThread
protected FastQueuequeue
protected booleanrun
protected booleanuseDeepClone
Constructor Summary
MessageDispatchInterceptor()
Method Summary
longaddAndGetCurrentSize(long inc)
booleanaddToQueue(ChannelMessage msg, Member[] destination, InterceptorPayload payload)
longgetCurrentSize()
longgetMaxQueueSize()
booleangetUseDeepClone()
booleanisAlwaysSend()
LinkObjectremoveFromQueue()
voidrun()
protected LinkObjectsendAsyncData(LinkObject link)
voidsendMessage(Member[] destination, ChannelMessage msg, InterceptorPayload payload)
voidsetAlwaysSend(boolean alwaysSend)
longsetAndGetCurrentSize(long value)
voidsetMaxQueueSize(long maxQueueSize)
voidsetOptionFlag(int flag)
voidsetUseDeepClone(boolean useDeepClone)
voidstart(int svc)
voidstartQueue()
voidstop(int svc)
voidstopQueue()

Field Detail

alwaysSend

protected boolean alwaysSend

currentSize

protected long currentSize

log

protected static Log log

maxQueueSize

protected long maxQueueSize

msgDispatchThread

protected Thread msgDispatchThread

queue

protected FastQueue queue

run

protected boolean run

useDeepClone

protected boolean useDeepClone

Constructor Detail

MessageDispatchInterceptor

public MessageDispatchInterceptor()

Method Detail

addAndGetCurrentSize

public long addAndGetCurrentSize(long inc)

addToQueue

public boolean addToQueue(ChannelMessage msg, Member[] destination, InterceptorPayload payload)

getCurrentSize

public long getCurrentSize()

getMaxQueueSize

public long getMaxQueueSize()

getUseDeepClone

public boolean getUseDeepClone()

isAlwaysSend

public boolean isAlwaysSend()

removeFromQueue

public LinkObject removeFromQueue()

run

public void run()

sendAsyncData

protected LinkObject sendAsyncData(LinkObject link)

sendMessage

public void sendMessage(Member[] destination, ChannelMessage msg, InterceptorPayload payload)

setAlwaysSend

public void setAlwaysSend(boolean alwaysSend)

setAndGetCurrentSize

public long setAndGetCurrentSize(long value)

setMaxQueueSize

public void setMaxQueueSize(long maxQueueSize)

setOptionFlag

public void setOptionFlag(int flag)

setUseDeepClone

public void setUseDeepClone(boolean useDeepClone)

start

public void start(int svc)

startQueue

public void startQueue()

stop

public void stop(int svc)

stopQueue

public void stopQueue()
Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.