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 java.util.Queue<java.lang.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 java.util.Map<Executing.Owner,java.lang.Runnable> |
_awaitingReturn
This is a map on the client side that shows for which
owner(consumer, request) the runnable they are currently using.
|
protected java.util.concurrent.locks.Lock |
_consumerLock
This lock is to protect the incoming run requests and the incoming
consumer queues
|
protected java.util.Queue<Address> |
_consumersAvailable
This is stored on the coordinator side.
|
protected java.util.concurrent.ConcurrentMap<java.lang.Runnable,java.lang.Thread> |
_runnableThreads
This is a server side map to show which threads are running for a
given runnable.
|
protected java.util.Map<java.lang.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 java.util.Queue<Address> |
_runRequests
This is stored on the coordinator side.
|
protected java.util.concurrent.BlockingQueue<java.lang.Runnable> |
_tasks
This is a server side queue of all the tasks to pass off.
|
protected boolean |
bypass_bundling |
protected static java.util.concurrent.atomic.AtomicInteger |
counter
This keeps track of all the requests we send.
|
protected Address |
local_addr |
protected java.util.concurrent.ConcurrentMap<java.util.concurrent.Future<?>,ExecutorNotification> |
notifiers |
protected View |
view |
Constructor and Description |
---|
Executing() |
Modifier and Type | Method and Description |
---|---|
void |
addExecutorListener(java.util.concurrent.Future<?> future,
ExecutorNotification listener) |
java.lang.Object |
down(Event evt)
An event is to be sent down the stack.
|
java.lang.String |
getAddress() |
boolean |
getBypassBundling() |
java.lang.String |
getView() |
protected void |
handleConsumerFoundResponse(Address consumer) |
protected void |
handleConsumerReadyRequest(Address source) |
protected void |
handleExceptionResponse(Address source,
Executing.Request req) |
protected void |
handleInterruptRequest(Address source,
short requestId) |
protected void |
handleNewConsumer(Address sender) |
protected void |
handleNewRunRequest(Address sender) |
protected void |
handleRemoveConsumer(Address sender) |
protected void |
handleRemoveRunRequest(Address sender) |
protected void |
handleTaskRejectedResponse(Address source,
short requestId) |
protected void |
handleTaskRequest(Address source) |
protected void |
handleTaskSubmittedRequest(java.lang.Runnable runnable,
Address source,
short requestId) |
protected void |
handleValueResponse(Address source,
Executing.Request req) |
protected void |
handleView(View view) |
protected abstract void |
sendNewConsumerRequest(Address source) |
protected abstract void |
sendNewRunRequest(Address source) |
protected abstract void |
sendRemoveConsumerRequest(Address source) |
protected abstract void |
sendRemoveRunRequest(Address source) |
protected void |
sendRequest(Address dest,
Executing.Type type,
short requestId,
java.lang.Object object) |
protected abstract void |
sendToCoordinator(Executing.Type type,
java.lang.Object obj) |
void |
setBypassBundling(boolean bypass_bundling) |
java.lang.Object |
up(Event evt)
An event was received from the layer below.
|
destroy, downThreadEnabled, dumpStats, enableStats, getConfigurableObjects, getDownProtocol, getId, getLevel, getName, getProperties, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getValue, init, isErgonomics, printStats, providedDownServices, providedUpServices, requiredDownServices, requiredUpServices, resetStats, setDownProtocol, setErgonomics, setId, setLevel, setProperties, setPropertiesInternal, setProperty, setProtocolStack, setSocketFactory, setUpProtocol, setValue, setValues, start, statsEnabled, stop, upThreadEnabled
protected boolean bypass_bundling
protected Address local_addr
protected View view
protected final java.util.Queue<java.lang.Runnable> _awaitingConsumer
protected final java.util.concurrent.ConcurrentMap<java.util.concurrent.Future<?>,ExecutorNotification> notifiers
protected final java.util.Map<java.lang.Runnable,Executing.Owner> _running
protected final java.util.Map<Executing.Owner,java.lang.Runnable> _awaitingReturn
protected java.util.concurrent.BlockingQueue<java.lang.Runnable> _tasks
protected final java.util.concurrent.ConcurrentMap<java.lang.Runnable,java.lang.Thread> _runnableThreads
protected java.util.concurrent.locks.Lock _consumerLock
protected java.util.Queue<Address> _runRequests
protected java.util.Queue<Address> _consumersAvailable
protected static final java.util.concurrent.atomic.AtomicInteger counter
public boolean getBypassBundling()
public void setBypassBundling(boolean bypass_bundling)
public void addExecutorListener(java.util.concurrent.Future<?> future, ExecutorNotification listener)
public java.lang.String getAddress()
public java.lang.String getView()
public java.lang.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 java.lang.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, java.lang.Object obj)
protected abstract void sendNewRunRequest(Address source)
protected abstract void sendRemoveRunRequest(Address source)
protected abstract void sendNewConsumerRequest(Address source)
protected abstract void sendRemoveConsumerRequest(Address source)
protected void handleTaskRequest(Address source)
protected void handleConsumerReadyRequest(Address source)
protected void handleConsumerFoundResponse(Address consumer)
protected void handleTaskSubmittedRequest(java.lang.Runnable runnable, Address source, short requestId)
protected void handleTaskRejectedResponse(Address source, short requestId)
protected void handleValueResponse(Address source, Executing.Request req)
protected void handleExceptionResponse(Address source, Executing.Request req)
protected void handleInterruptRequest(Address source, short requestId)
protected void handleNewRunRequest(Address sender)
protected void handleRemoveRunRequest(Address sender)
protected void handleNewConsumer(Address sender)
protected void handleRemoveConsumer(Address sender)
protected void sendRequest(Address dest, Executing.Type type, short requestId, java.lang.Object object)
Copyright ? 1998-2009 Bela Ban / Red Hat. All Rights Reserved.