public abstract class Executing extends Protocol
CENTRAL_EXECUTOR
Modifier and Type | Class and Description |
---|---|
static class |
Executing.ExecutorHeader |
static class |
Executing.Owner |
protected static class |
Executing.Request |
protected static class |
Executing.Type |
Modifier and Type | Field and Description |
---|---|
protected Queue<Runnable> |
_awaitingConsumer
This is a queue on the client side that holds all of the tasks that
are awaiting a consumer to pick them up
|
protected Map<Executing.Owner,Runnable> |
_awaitingReturn
This is a map on the client side that shows for which
owner(consumer, request) the runnable they are currently using.
|
protected ConcurrentMap<Long,Object> |
_consumerId
This is essentially a set on the consumer side of id's of all the threads
currently running as consumers.
|
protected Lock |
_consumerLock
This lock is to protect the incoming run requests and the incoming
consumer queues
|
protected Queue<Executing.Owner> |
_consumersAvailable
This is stored on the coordinator side.
|
protected ConcurrentMap<Runnable,Long> |
_requestId
This is a map on the client side showing for all of the current pending
requests
|
protected ConcurrentMap<Runnable,Thread> |
_runnableThreads
This is a server side map to show which threads are running for a
given runnable.
|
protected Map<Runnable,Executing.Owner> |
_running
This is a map on the server side that shows which owner is currently
tied to the runnable so we can return to them the results
|
protected Queue<Executing.Owner> |
_runRequests
This is stored on the coordinator side.
|
protected BlockingQueue<Runnable> |
_tasks
This is a server side queue of all the tasks to pass off.
|
protected boolean |
bypass_bundling |
protected static AtomicLong |
counter
This keeps track of all the requests we send.
|
protected Address |
local_addr |
protected ConcurrentMap<Future<?>,ExecutorNotification> |
notifiers |
protected View |
view |
Constructor and Description |
---|
Executing() |
Modifier and Type | Method and Description |
---|---|
void |
addExecutorListener(Future<?> future,
ExecutorNotification listener) |
Object |
down(Event evt)
An event is to be sent down the stack.
|
String |
getAddress() |
boolean |
getBypassBundling() |
String |
getView() |
protected void |
handleConsumerFoundResponse(long request,
Address address) |
protected void |
handleConsumerReadyRequest(long requestId,
Address address) |
protected void |
handleConsumerUnreadyRequest(long requestId,
Address address) |
protected void |
handleExceptionResponse(Address source,
long requestId,
Throwable throwable) |
protected void |
handleInterruptRequest(Address source,
long requestId) |
protected void |
handleNewConsumer(Executing.Owner sender) |
protected void |
handleNewRunRequest(Executing.Owner sender) |
protected void |
handleRemoveConsumer(Executing.Owner sender) |
protected void |
handleRemoveRunRequest(Executing.Owner sender) |
protected void |
handleTaskRejectedResponse(Address source,
long requestId) |
protected void |
handleTaskRequest(long requestId,
Address address) |
protected void |
handleTaskSubmittedRequest(Runnable runnable,
Address source,
long requestId) |
protected void |
handleValueResponse(Address source,
long requestId,
Object value) |
protected void |
handleView(View view) |
protected static <V,K> V |
removeKeyForValue(Map<V,K> map,
K value) |
protected abstract void |
sendNewConsumerRequest(Executing.Owner source) |
protected abstract void |
sendNewRunRequest(Executing.Owner source) |
protected abstract void |
sendRemoveConsumerRequest(Executing.Owner source) |
protected abstract void |
sendRemoveRunRequest(Executing.Owner source) |
protected void |
sendRequest(Address dest,
Executing.Type type,
long requestId,
Object object) |
protected abstract void |
sendToCoordinator(Executing.Type type,
long requestId,
Address address) |
void |
setBypassBundling(boolean bypass_bundling) |
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, init, isErgonomics, printStats, providedDownServices, providedUpServices, requiredDownServices, requiredUpServices, resetStatistics, resetStats, setDownProtocol, setErgonomics, setId, setLevel, setProtocolStack, setSocketFactory, setUpProtocol, setValue, setValues, start, statsEnabled, stop
protected boolean bypass_bundling
protected Address local_addr
protected View view
protected final Queue<Runnable> _awaitingConsumer
protected final ConcurrentMap<Runnable,Long> _requestId
protected final ConcurrentMap<Long,Object> _consumerId
protected final ConcurrentMap<Future<?>,ExecutorNotification> notifiers
protected final Map<Runnable,Executing.Owner> _running
protected final Map<Executing.Owner,Runnable> _awaitingReturn
protected BlockingQueue<Runnable> _tasks
protected final ConcurrentMap<Runnable,Thread> _runnableThreads
protected Lock _consumerLock
protected Queue<Executing.Owner> _runRequests
protected Queue<Executing.Owner> _consumersAvailable
protected static final AtomicLong counter
public boolean getBypassBundling()
public void setBypassBundling(boolean bypass_bundling)
public void addExecutorListener(Future<?> future, ExecutorNotification listener)
public String getAddress()
public String getView()
public 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()
.protected static <V,K> V removeKeyForValue(Map<V,K> map, K value)
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 void handleView(View view)
protected abstract void sendToCoordinator(Executing.Type type, long requestId, Address address)
protected abstract void sendNewRunRequest(Executing.Owner source)
protected abstract void sendRemoveRunRequest(Executing.Owner source)
protected abstract void sendNewConsumerRequest(Executing.Owner source)
protected abstract void sendRemoveConsumerRequest(Executing.Owner source)
protected void handleTaskRequest(long requestId, Address address)
protected void handleConsumerReadyRequest(long requestId, Address address)
protected void handleConsumerUnreadyRequest(long requestId, Address address)
protected void handleConsumerFoundResponse(long request, Address address)
protected void handleTaskSubmittedRequest(Runnable runnable, Address source, long requestId)
protected void handleTaskRejectedResponse(Address source, long requestId)
protected void handleValueResponse(Address source, long requestId, Object value)
protected void handleExceptionResponse(Address source, long requestId, Throwable throwable)
protected void handleInterruptRequest(Address source, long requestId)
protected void handleNewRunRequest(Executing.Owner sender)
protected void handleRemoveRunRequest(Executing.Owner sender)
protected void handleNewConsumer(Executing.Owner sender)
protected void handleRemoveConsumer(Executing.Owner sender)
protected void sendRequest(Address dest, Executing.Type type, long requestId, Object object)
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.