public class MessageDispatchInterceptor extends ChannelInterceptorBase implements Runnable
Channel.SEND_OPTIONS_ASYNCHRONOUS flag to be set, if it is, it
will queue the message for delivery and immediately return to the sender.ChannelInterceptor.InterceptorEvent| Modifier and Type | Field and Description |
|---|---|
protected boolean |
alwaysSend |
protected AtomicLong |
currentSize |
protected ExecutorService |
executor |
protected long |
keepAliveTime |
protected long |
maxQueueSize |
protected int |
maxSpareThreads |
protected int |
maxThreads |
protected Thread |
msgDispatchThread
Deprecated.
Unused. Will be removed in Tomcat 8.5.x.
|
protected FastQueue |
queue
Deprecated.
Unused. Will be removed in Tomcat 8.5.x.
|
protected boolean |
run |
protected static StringManager |
sm |
protected boolean |
useDeepClone |
optionFlag| Constructor and Description |
|---|
MessageDispatchInterceptor() |
| Modifier and Type | Method and Description |
|---|---|
long |
addAndGetCurrentSize(long inc) |
boolean |
addToQueue(ChannelMessage msg,
Member[] destination,
InterceptorPayload payload) |
long |
getCurrentSize() |
long |
getKeepAliveTime() |
long |
getMaxQueueSize() |
int |
getMaxSpareThreads() |
int |
getMaxThreads() |
boolean |
getUseDeepClone() |
boolean |
isAlwaysSend() |
LinkObject |
removeFromQueue()
Deprecated.
Not used. The thread pool contains its own queue. This will
be removed in Tomcat 8.5.x onwards.
|
void |
run()
Deprecated.
Unused. Will be removed in 8.5.x
|
protected void |
sendAsyncData(ChannelMessage msg,
Member[] destination,
InterceptorPayload payload) |
protected LinkObject |
sendAsyncData(LinkObject link)
Deprecated.
Unused. Will be removed in 8.5.x
|
void |
sendMessage(Member[] destination,
ChannelMessage msg,
InterceptorPayload payload)
The
sendMessage method is called when a message is being sent to one more destinations. |
void |
setAlwaysSend(boolean alwaysSend) |
long |
setAndGetCurrentSize(long value) |
void |
setKeepAliveTime(long keepAliveTime) |
void |
setMaxQueueSize(long maxQueueSize) |
void |
setMaxSpareThreads(int maxSpareThreads) |
void |
setMaxThreads(int maxThreads) |
void |
setOptionFlag(int flag)
Sets the option flag
|
void |
setUseDeepClone(boolean useDeepClone) |
void |
start(int svc)
Starts up the channel.
|
void |
startQueue() |
void |
stop(int svc)
Shuts down the channel.
|
void |
stopQueue() |
fireInterceptorEvent, getChannel, getLocalMember, getMember, getMembers, getNext, getOptionFlag, getPrevious, hasMembers, heartbeat, memberAdded, memberDisappeared, messageReceived, okToProcess, setChannel, setNext, setPreviousprotected static final StringManager sm
protected long maxQueueSize
@Deprecated protected final FastQueue queue
protected volatile boolean run
@Deprecated protected Thread msgDispatchThread
protected boolean useDeepClone
protected boolean alwaysSend
protected final AtomicLong currentSize
protected ExecutorService executor
protected int maxThreads
protected int maxSpareThreads
protected long keepAliveTime
public void sendMessage(Member[] destination, ChannelMessage msg, InterceptorPayload payload) throws ChannelException
ChannelInterceptorsendMessage method is called when a message is being sent to one more destinations.
The interceptor can modify any of the parameters and then pass on the message down the stack by
invoking getNext().sendMessage(destination,msg,payload)getNext().sendMessage(destination,msg,payload)sendMessage in interface ChannelInterceptorsendMessage in class ChannelInterceptorBasedestination - Member[] - the destination for this messagemsg - ChannelMessage - the message to be sentpayload - InterceptorPayload - the payload, carrying an error handler and future useful data, can be nullChannelExceptionErrorHandler,
InterceptorPayloadpublic boolean addToQueue(ChannelMessage msg, Member[] destination, InterceptorPayload payload)
@Deprecated public LinkObject removeFromQueue()
public void startQueue()
public void stopQueue()
public void setOptionFlag(int flag)
ChannelInterceptorsetOptionFlag in interface ChannelInterceptorsetOptionFlag in class ChannelInterceptorBaseflag - intChannelInterceptor.getOptionFlag()public void setMaxQueueSize(long maxQueueSize)
public void setUseDeepClone(boolean useDeepClone)
public long getMaxQueueSize()
public boolean getUseDeepClone()
public long getCurrentSize()
public long addAndGetCurrentSize(long inc)
public long setAndGetCurrentSize(long value)
public long getKeepAliveTime()
public int getMaxSpareThreads()
public int getMaxThreads()
public void setKeepAliveTime(long keepAliveTime)
public void setMaxSpareThreads(int maxSpareThreads)
public void setMaxThreads(int maxThreads)
public boolean isAlwaysSend()
public void setAlwaysSend(boolean alwaysSend)
public void start(int svc)
throws ChannelException
ChannelInterceptorBasestart in interface ChannelInterceptorstart in class ChannelInterceptorBasesvc - int value of ChannelException - if a startup error occurs or the service is already started.Channelpublic void stop(int svc)
throws ChannelException
ChannelInterceptorBasestop in interface ChannelInterceptorstop in class ChannelInterceptorBasesvc - int value of ChannelException - if a startup error occurs or the service is already started.Channel@Deprecated public void run()
@Deprecated protected LinkObject sendAsyncData(LinkObject link)
protected void sendAsyncData(ChannelMessage msg, Member[] destination, InterceptorPayload payload)
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.