|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jppf.server.nio.AbstractNioContext<S>
org.jppf.server.nio.SimpleNioContext<ClassState>
org.jppf.server.nio.classloader.ClassContext
public class ClassContext
Context object associated with a socket channel used by the class server of the JPPF driver.
| Field Summary | |
|---|---|
protected ChannelWrapper<?> |
currentRequest
The request currently processed. |
protected List<ChannelWrapper<?>> |
pendingRequests
The list of pending resource requests for a resource provider. |
protected boolean |
provider
Determines whether this context relates to a provider or node connection. |
protected JPPFResourceWrapper |
resource
The resource read from or written to the associated channel. |
| Fields inherited from class org.jppf.server.nio.AbstractNioContext |
|---|
connectionUuid, message, readByteCount, state, uuid, writeByteCount |
| Constructor Summary | |
|---|---|
ClassContext()
|
|
| Method Summary | |
|---|---|
void |
addRequest(ChannelWrapper<?> request)
Add a new pending request to this resource provider. |
JPPFResourceWrapper |
deserializeResource()
Deserialize a resource wrapper from an array of bytes. |
ChannelWrapper<?> |
getCurrentRequest()
Get the request currently processed. |
int |
getNbPendingRequests()
Get the number of pending resource requests for a resource provider. |
List<ChannelWrapper<?>> |
getPendingRequests()
Get the list of pending resource requests for a resource provider. |
JPPFResourceWrapper |
getResource()
Get the resource read from or written to the associated channel. |
void |
handleException(ChannelWrapper<?> channel)
Handle the cleanup when an exception occurs on the channel. |
protected void |
handleProviderError()
Handle the scenario where an exception occurs while sendinf a request to or receiving a response from a provider, and a node channel is wating for the response. |
boolean |
isProvider()
Determine whether this context relates to a provider or node connection. |
protected void |
resetNodeState(ChannelWrapper<?> request,
ClassNioServer server)
Reset the state of the requesting node channel, after an error occurred on the provider which attempted to provide a response. |
protected void |
sendNullResponse(ChannelWrapper<?> request)
Send a null response to a request node connection. |
void |
serializeResource(ChannelWrapper<?> wrapper)
Serialize a resource wrapper to an array of bytes. |
void |
setCurrentRequest(ChannelWrapper<?> currentRequest)
Set the request currently processed. |
void |
setPendingRequests(List<ChannelWrapper<?>> pendingRequests)
Set the list of pending resource requests for a resource provider. |
void |
setProvider(boolean provider)
Specify whether this context relates to a provider or node connection. |
void |
setResource(JPPFResourceWrapper resource)
Set the resource read from or written to the associated channel. |
| Methods inherited from class org.jppf.server.nio.SimpleNioContext |
|---|
readMessage, writeMessage |
| Methods inherited from class org.jppf.server.nio.AbstractNioContext |
|---|
getChannel, getConnectionUuid, getMessage, getShortClassName, getState, getUuid, setChannel, setConnectionUuid, setMessage, setState, setUuid |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected JPPFResourceWrapper resource
protected List<ChannelWrapper<?>> pendingRequests
protected ChannelWrapper<?> currentRequest
protected boolean provider
| Constructor Detail |
|---|
public ClassContext()
| Method Detail |
|---|
public JPPFResourceWrapper deserializeResource()
throws Exception
JPPFResourceWrapper instance.
Exception - if an error occurs while deserializing.
public void serializeResource(ChannelWrapper<?> wrapper)
throws Exception
wrapper - the channel through which the resource is sent.
Exception - if an error occurs while serializing.public void handleException(ChannelWrapper<?> channel)
channel - the channel that threw the exception.public JPPFResourceWrapper getResource()
JPPFResourceWrapper instance.public void setResource(JPPFResourceWrapper resource)
resource - a JPPFResourceWrapper instance.public void addRequest(ChannelWrapper<?> request)
request - the request as a SelectionKey instance.public ChannelWrapper<?> getCurrentRequest()
SelectionKey instance.public void setCurrentRequest(ChannelWrapper<?> currentRequest)
currentRequest - a SelectionKey instance.public int getNbPendingRequests()
public List<ChannelWrapper<?>> getPendingRequests()
List of SelectionKey instances.public void setPendingRequests(List<ChannelWrapper<?>> pendingRequests)
pendingRequests - a List of SelectionKey instances.public boolean isProvider()
public void setProvider(boolean provider)
provider - true if this is a provider context, false otherwise.protected void handleProviderError()
protected void resetNodeState(ChannelWrapper<?> request,
ClassNioServer server)
request - the requestinhg node channel.server - the server handling the node.protected void sendNullResponse(ChannelWrapper<?> request)
request - the selection key wrapping the requesting channel.
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||