|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.wpi.prc.server.transitioner.RemoteTransitionerProxy
public class RemoteTransitionerProxy
The RemoteTransitionerProxy is used when the Transitioner component is executed on a different machine than the PRCServer. The RemoteTransitionerProxy uses XML-RPC calls to communicate with the Transitioner process on another machine. If the Transitioner will be run on the same machine, use the LocalTransitioner instead.
Field Summary | |
---|---|
private static int |
RETRY_DELAY
|
private org.apache.xmlrpc.XmlRpcClient |
xmlrpcClient
|
Constructor Summary | |
---|---|
RemoteTransitionerProxy(java.lang.String transitionerURI)
Private constructor ensures that only one instance of RemoteTransitionerProxy exists. |
Method Summary | |
---|---|
void |
addIngressResult(Result r)
Adds a result to the tail of the pending result queue. |
void |
addIngressWorkUnit(WorkUnit wu)
Adds a work unit to the tail of the ingress work queue. |
Result[] |
getAssociatedIngressResults(WorkUnit wu)
Finds all ingress Results associated with a given WorkUnit. |
Result[] |
getAssociatedPendingResults(WorkUnit wu)
Finds all pending Results associated with a given WorkUnit. |
private Result[] |
getAssociatedResults(WorkUnit wu,
java.lang.String resultType)
Gets the set of results associated with the given work unit. |
TransitionerQueue<WorkUnit> |
getCanonicalWorkQueue()
|
WorkUnit |
getCanonicalWorkUnit()
Gets the first WorkUnit that has enough Results. |
TransitionerQueue<Result> |
getIngressResultQueue()
|
TransitionerQueue<WorkUnit> |
getIngressWorkQueue()
|
TransitionerQueue<Result> |
getPendingResultQueue()
|
TransitionerQueue<WorkUnit> |
getPendingWorkQueue()
|
Result |
getResult()
Gets the first result that needs to be validated. |
private TransitionerQueue<Result> |
getResultQueue(java.lang.String queueType)
Gets a result queue from the remote transitioner. |
TransitionerQueue<Result> |
getRetiredResultQueue()
|
TransitionerQueue<WorkUnit> |
getRetiredWorkQueue()
|
TransitionerQueue<Result> |
getValidResultQueue()
|
private TransitionerQueue<WorkUnit> |
getWorkQueue(java.lang.String queueType)
Gets a work queue from the remote transitioner. |
WorkUnit |
getWorkUnit(Volunteer v)
Gets the next work unit to be processed. |
void |
markResultInvalid(Result invalidResult)
Marks a result as invalid. |
void |
markResultValid(Result validResult)
Marks a Result as valid. |
void |
selectCanonicalResult(Result canonicalResult)
Designates a canonical Result by removing all related results from the ingress and pending queues, adding the canonical result to the valid queue, and retiring the canonical result's work unit. |
private java.lang.Object |
sendRPC(java.lang.String methodName,
java.util.Vector params)
Executes an XML-RPC on the remote transitioner. |
void |
shutdown()
Performs any necessary tasks to safely shut down the Transitioner. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int RETRY_DELAY
private org.apache.xmlrpc.XmlRpcClient xmlrpcClient
Constructor Detail |
---|
public RemoteTransitionerProxy(java.lang.String transitionerURI) throws java.net.MalformedURLException
java.net.MalformedURLException
Method Detail |
---|
public TransitionerQueue<WorkUnit> getIngressWorkQueue()
getIngressWorkQueue
in interface Transitioner
public TransitionerQueue<WorkUnit> getPendingWorkQueue()
getPendingWorkQueue
in interface Transitioner
public TransitionerQueue<WorkUnit> getCanonicalWorkQueue()
getCanonicalWorkQueue
in interface Transitioner
public TransitionerQueue<WorkUnit> getRetiredWorkQueue()
getRetiredWorkQueue
in interface Transitioner
public TransitionerQueue<Result> getIngressResultQueue()
getIngressResultQueue
in interface Transitioner
public TransitionerQueue<Result> getPendingResultQueue()
getPendingResultQueue
in interface Transitioner
public TransitionerQueue<Result> getValidResultQueue()
getValidResultQueue
in interface Transitioner
public TransitionerQueue<Result> getRetiredResultQueue()
public void addIngressWorkUnit(WorkUnit wu)
addIngressWorkUnit
in interface Transitioner
wu
- The work unit to add.public void addIngressResult(Result r)
addIngressResult
in interface Transitioner
r
- The result to add.public Result[] getAssociatedIngressResults(WorkUnit wu)
getAssociatedIngressResults
in interface Transitioner
wu
- The WorkUnit for which to find all associated ingress Results.
public Result[] getAssociatedPendingResults(WorkUnit wu)
getAssociatedPendingResults
in interface Transitioner
wu
- The WorkUnit for which to find all associated pending Results.
public WorkUnit getWorkUnit(Volunteer v) throws EmptyQueueException
getWorkUnit
in interface Transitioner
v
- The volunteer who will receive t
EmptyQueueException
public WorkUnit getCanonicalWorkUnit() throws EmptyQueueException
getCanonicalWorkUnit
in interface Transitioner
EmptyQueueException
public Result getResult() throws EmptyQueueException
getResult
in interface Transitioner
EmptyQueueException
public void markResultValid(Result validResult)
markResultValid
in interface Transitioner
validResult
- The result from the ingress result queue to be marked valid.public void markResultInvalid(Result invalidResult)
markResultInvalid
in interface Transitioner
invalidResult
- The result to be marked invalid.public void selectCanonicalResult(Result canonicalResult)
selectCanonicalResult
in interface Transitioner
canonicalResult
- The canonical result to select.private TransitionerQueue<WorkUnit> getWorkQueue(java.lang.String queueType)
queueType
- The type of queue to get: IngressWorkQueue, PendingWorkQueue, CanonicalWorkQueue, RetiredWorkQueue
private TransitionerQueue<Result> getResultQueue(java.lang.String queueType)
queueType
- The type of queue to get: IngressResultQueue, PendingResultQueue, ValidResultQueue, or RetiredResultQueue
private Result[] getAssociatedResults(WorkUnit wu, java.lang.String resultType)
wu
- The work unit for which to find associated results.resultType
- The type of results to get: Ingress or Pending.
private java.lang.Object sendRPC(java.lang.String methodName, java.util.Vector params)
methodName
- The name of the method to execute.params
- Parameters to pass to the method.
public void shutdown()
shutdown
in interface Transitioner
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |