use of cbit.vcell.server.SimulationService in project vcell by virtualcell.
the class SimulationDispatcher method init.
public void init() {
//
// set up consumer for WorkerEvent messages
//
QueueListener workerEventListener = new QueueListener() {
public void onQueueMessage(VCMessage vcMessage, VCMessageSession session) throws RollbackException {
onWorkerEventMessage(vcMessage, session);
}
};
VCMessageSelector workerEventSelector = null;
String threadName = "Worker Event Consumer";
workerEventConsumer = new VCQueueConsumer(VCellQueue.WorkerEventQueue, workerEventListener, workerEventSelector, threadName, MessageConstants.PREFETCH_LIMIT_WORKER_EVENT);
vcMessagingService.addMessageConsumer(workerEventConsumer);
//
// set up consumer for Simulation Request (non-blocking RPC) messages
//
SimulationService simServiceImpl = new SimulationServiceImpl();
VCMessageSelector simRequestSelector = null;
threadName = "Sim Request Consumer";
this.rpcMessageHandler = new VCRpcMessageHandler(simServiceImpl, VCellQueue.SimReqQueue);
simRequestConsumer = new VCQueueConsumer(VCellQueue.SimReqQueue, rpcMessageHandler, simRequestSelector, threadName, MessageConstants.PREFETCH_LIMIT_SIM_REQUEST);
vcMessagingService.addMessageConsumer(simRequestConsumer);
this.dispatcherQueueSession = vcMessagingService.createProducerSession();
this.dispatchThread = new DispatchThread();
this.dispatchThread.start();
initControlTopicListener();
this.simMonitorThreadSession = vcMessagingService.createProducerSession();
this.simMonitor = new SimulationMonitor();
}
Aggregations