Search in sources :

Example 1 with SimulationService

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();
}
Also used : QueueListener(cbit.vcell.message.VCQueueConsumer.QueueListener) VCMessageSelector(cbit.vcell.message.VCMessageSelector) VCMessage(cbit.vcell.message.VCMessage) VCMessageSession(cbit.vcell.message.VCMessageSession) VCRpcMessageHandler(cbit.vcell.message.VCRpcMessageHandler) SimulationService(cbit.vcell.server.SimulationService) VCQueueConsumer(cbit.vcell.message.VCQueueConsumer)

Aggregations

VCMessage (cbit.vcell.message.VCMessage)1 VCMessageSelector (cbit.vcell.message.VCMessageSelector)1 VCMessageSession (cbit.vcell.message.VCMessageSession)1 VCQueueConsumer (cbit.vcell.message.VCQueueConsumer)1 QueueListener (cbit.vcell.message.VCQueueConsumer.QueueListener)1 VCRpcMessageHandler (cbit.vcell.message.VCRpcMessageHandler)1 SimulationService (cbit.vcell.server.SimulationService)1