public class SCOPE extends Protocol
Modifier and Type | Class and Description |
---|---|
protected class |
SCOPE.ExpiryTask |
protected static class |
SCOPE.MessageQueue |
protected class |
SCOPE.QueueThread |
static class |
SCOPE.ScopeHeader |
Modifier and Type | Field and Description |
---|---|
protected String |
cluster_name |
protected long |
expiration_interval |
protected long |
expiration_time |
protected Future<?> |
expiry_task |
protected Address |
local_addr |
protected ConcurrentMap<Address,ConcurrentMap<Short,SCOPE.MessageQueue>> |
queues
Used to find the correct AckReceiverWindow on message reception and deliver it in the right order
|
protected ThreadFactory |
thread_factory |
protected ThreadGroup |
thread_group |
protected String |
thread_naming_pattern |
protected Executor |
thread_pool |
protected long |
thread_pool_keep_alive_time |
protected int |
thread_pool_max_threads |
protected int |
thread_pool_min_threads |
protected TimeScheduler |
timer |
Constructor and Description |
---|
SCOPE() |
Modifier and Type | Method and Description |
---|---|
void |
clearQueue(Address member) |
protected static ExecutorService |
createThreadPool(int min_threads,
int max_threads,
long keep_alive_time,
ThreadFactory factory) |
Object |
down(Event evt)
An event is to be sent down the stack.
|
String |
dumpScopes() |
void |
expire(short scope)
Multicasts an EXPIRE message to all members, and - on reception - each member removes the scope locally
|
int |
getNumActiveThreads() |
int |
getNumberOfMessages() |
int |
getNumberOfReceiverScopes() |
protected SCOPE.MessageQueue |
getOrCreateQueue(Address sender,
short scope) |
long |
getThreadPoolKeepAliveTime() |
int |
getThreadPoolMaxThreads() |
int |
getThreadPoolMinThreads() |
void |
init()
Called after instance has been created (null constructor) and before protocol is started.
|
void |
removeAllQueues() |
void |
removeScope(Address member,
short scope) |
void |
setThreadPoolKeepAliveTime(long time) |
void |
setThreadPoolMaxThreads(int size) |
void |
setThreadPoolMinThreads(int size) |
protected static void |
shutdownThreadPool(Executor thread_pool) |
void |
start()
This method is called on a
Channel.connect(String) . |
protected void |
startExpiryTask() |
void |
stop()
This method is called on a
Channel.disconnect() . |
protected void |
stopExpiryTask() |
Object |
up(Event evt)
An event was received from the layer below.
|
destroy, dumpStats, enableStats, getConfigurableObjects, getDownProtocol, getId, getLevel, getName, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getValue, isErgonomics, printStats, providedDownServices, providedUpServices, requiredDownServices, requiredUpServices, resetStatistics, resetStats, setDownProtocol, setErgonomics, setId, setLevel, setProtocolStack, setSocketFactory, setUpProtocol, setValue, setValues, statsEnabled
protected int thread_pool_min_threads
protected int thread_pool_max_threads
protected long thread_pool_keep_alive_time
protected String thread_naming_pattern
protected long expiration_time
protected long expiration_interval
protected Future<?> expiry_task
protected final ConcurrentMap<Address,ConcurrentMap<Short,SCOPE.MessageQueue>> queues
protected String cluster_name
protected Address local_addr
protected Executor thread_pool
protected ThreadGroup thread_group
protected ThreadFactory thread_factory
protected TimeScheduler timer
public int getNumberOfReceiverScopes()
public int getNumberOfMessages()
public void setThreadPoolMinThreads(int size)
public int getThreadPoolMinThreads()
public void setThreadPoolMaxThreads(int size)
public int getThreadPoolMaxThreads()
public void setThreadPoolKeepAliveTime(long time)
public long getThreadPoolKeepAliveTime()
public void removeAllQueues()
public void expire(short scope)
scope
- public void removeScope(Address member, short scope)
public String dumpScopes()
public int getNumActiveThreads()
public void init() throws Exception
Protocol
public void start() throws Exception
Protocol
Channel.connect(String)
. Starts work.
Protocols are connected and queues are ready to receive events.
Will be called from bottom to top. This call will replace
the START and START_OK events.start
in class Protocol
Exception
- Thrown if protocol cannot be started successfully. This will cause the ProtocolStack
to fail, so Channel.connect(String)
will throw an exceptionpublic void stop()
Protocol
Channel.disconnect()
. Stops work (e.g. by closing multicast socket).
Will be called from top to bottom. This means that at the time of the method invocation the
neighbor protocol below is still working. This method will replace the
STOP, STOP_OK, CLEANUP and CLEANUP_OK events. The ProtocolStack guarantees that
when this method is called all messages in the down queue will have been flushedpublic Object down(Event evt)
Protocol
down_prot.down()
. In case of a GET_ADDRESS event (which tries to
retrieve the stack's address from one of the bottom layers), the layer may need to send
a new response event back up the stack using up_prot.up()
.public Object up(Event evt)
Protocol
down_prot.down()
or c) the event (or another event) is sent up
the stack using up_prot.up()
.protected SCOPE.MessageQueue getOrCreateQueue(Address sender, short scope)
protected void startExpiryTask()
protected void stopExpiryTask()
protected static ExecutorService createThreadPool(int min_threads, int max_threads, long keep_alive_time, ThreadFactory factory)
protected static void shutdownThreadPool(Executor thread_pool)
public void clearQueue(Address member)
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.