|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.wpi.prc.server.transitioner.RemoteTransitioner
public class RemoteTransitioner
The RemoteTransitoner is intended to run on a different machine than the PRCServer to reduce the load on that machine. The RemoteTransitioner maintains its own connections to the database, performs all localTransitioner functions, and communicates with the PRCServer via XML-RPC calls. Since HSQLDB only allows a single process to access the database at any given time, projects that use the HSQLDB database cannot use a RemoteTransitioner. These projects should use the LocalTransitioner instead.
Field Summary | |
---|---|
private static int |
EXIT_ERROR
|
private static int |
EXIT_SUCCESS
|
private Transitioner |
localTransitioner
|
private Project |
project
|
private static RemoteTransitioner |
remoteTransitioner
|
private boolean |
running
|
private org.apache.xmlrpc.WebServer |
xmlrpcServer
|
Constructor Summary | |
---|---|
private |
RemoteTransitioner()
Initializes the remote transitioner. |
Method Summary | |
---|---|
void |
addIngressResult(Result r)
Enqueues a result in the ingress result queue. |
void |
addIngressWorkUnit(WorkUnit wu)
Enqueues a work unit in 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. |
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. |
TransitionerQueue<WorkUnit> |
getRetiredWorkQueue()
|
TransitionerQueue<Result> |
getValidResultQueue()
|
WorkUnit |
getWorkUnit(Volunteer v)
Gets the next work unit to be processed. |
private void |
initXmlRpcServer()
Initializes the XML-RPC server. |
static RemoteTransitioner |
instance()
Hibernate must be configured before getting the singleton instance of this class. |
boolean |
isRunning()
|
static void |
main(java.lang.String[] args)
Main control for the remote transitioner. |
void |
markResultInvalid(Result invalidResult)
Marks a result as invalid. |
void |
markResultValid(Result validResult)
Marks a Result as valid. |
void |
run()
Starts the remote transitioner. |
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. |
void |
shutdown()
Performs any tasks necessary to clearnly shut down the remote transitioner. |
void |
stopServer()
Stops the XML-RPC server. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int EXIT_SUCCESS
private static final int EXIT_ERROR
private static RemoteTransitioner remoteTransitioner
private Transitioner localTransitioner
private Project project
private org.apache.xmlrpc.WebServer xmlrpcServer
private boolean running
Constructor Detail |
---|
private RemoteTransitioner() throws MissingConfigurationFileException
MissingConfigurationFileException
Method Detail |
---|
private void initXmlRpcServer()
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 void addIngressWorkUnit(WorkUnit wu)
Transitioner
addIngressWorkUnit
in interface Transitioner
wu
- The work unit to add.public void addIngressResult(Result r)
Transitioner
addIngressResult
in interface Transitioner
r
- The result to add.public Result[] getAssociatedIngressResults(WorkUnit wu)
Transitioner
getAssociatedIngressResults
in interface Transitioner
wu
- The WorkUnit for which to find all associated ingress Results.
public Result[] getAssociatedPendingResults(WorkUnit wu)
Transitioner
getAssociatedPendingResults
in interface Transitioner
wu
- The WorkUnit for which to find all associated pending Results.
public WorkUnit getWorkUnit(Volunteer v) throws EmptyQueueException
Transitioner
getWorkUnit
in interface Transitioner
v
- The volunteer who will receive t
EmptyQueueException
public WorkUnit getCanonicalWorkUnit() throws EmptyQueueException
Transitioner
getCanonicalWorkUnit
in interface Transitioner
EmptyQueueException
public Result getResult() throws EmptyQueueException
Transitioner
getResult
in interface Transitioner
EmptyQueueException
public void markResultValid(Result validResult)
Transitioner
markResultValid
in interface Transitioner
validResult
- The result from the ingress result queue to be marked valid.public void markResultInvalid(Result invalidResult)
Transitioner
markResultInvalid
in interface Transitioner
invalidResult
- The result to be marked invalid.public void selectCanonicalResult(Result canonicalResult)
Transitioner
selectCanonicalResult
in interface Transitioner
canonicalResult
- The canonical result to select.public void run()
public boolean isRunning()
public void shutdown()
shutdown
in interface Transitioner
public void stopServer()
public static RemoteTransitioner instance() throws MissingConfigurationFileException
MissingConfigurationFileException
public static void main(java.lang.String[] args)
args
- Command-line arguments.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |