Search in sources :

Example 6 with VCDestination

use of cbit.vcell.message.VCDestination in project vcell by virtualcell.

the class SimulationControllerImpl method onWorkerEvent.

/**
 * Insert the method's description here.
 * Creation date: (3/11/2004 10:44:18 AM)
 * @param newJobStatus cbit.vcell.messaging.db.SimulationJobStatus
 * @param progress java.lang.Double
 * @param timePoint java.lang.Double
 */
public void onWorkerEvent(WorkerEvent workerEvent) {
    try {
        LocalVCMessageListener localVCMessageListener = new LocalVCMessageListener() {

            public void onLocalVCMessage(VCDestination destination, VCMessage objectMessage) {
                if (destination == VCellTopic.ClientStatusTopic && objectMessage.getObjectContent() instanceof SimulationJobStatus) {
                    onClientStatusTopic_SimulationJobStatus(objectMessage);
                } else {
                    throw new RuntimeException("SimulationControllerImpl.onWorkerEvent().localMessageListener::  expecting object message with SimulationJobStatus to topic " + VCellTopic.ClientStatusTopic.getName() + ": received \"" + objectMessage.show() + "\"");
                }
            }
        };
        LocalVCMessageAdapter vcMessageSession = new LocalVCMessageAdapter(localVCMessageListener);
        simulationDispatcherEngine.onWorkerEvent(workerEvent, simulationDatabase, vcMessageSession);
        vcMessageSession.deliverAll();
    } catch (Exception e) {
        lg.error(e.getMessage(), e);
    }
}
Also used : VCDestination(cbit.vcell.message.VCDestination) LocalVCMessageListener(cbit.vcell.message.local.LocalVCMessageAdapter.LocalVCMessageListener) VCMessage(cbit.vcell.message.VCMessage) SimulationJobStatus(cbit.vcell.server.SimulationJobStatus) PermissionException(org.vcell.util.PermissionException) ObjectNotFoundException(org.vcell.util.ObjectNotFoundException) SQLException(java.sql.SQLException) VCMessagingException(cbit.vcell.message.VCMessagingException) SolverException(cbit.vcell.solver.SolverException) AuthenticationException(org.vcell.util.AuthenticationException) DataAccessException(org.vcell.util.DataAccessException) JMSException(javax.jms.JMSException) FileNotFoundException(java.io.FileNotFoundException) RemoteException(java.rmi.RemoteException) ConfigurationException(org.vcell.util.ConfigurationException) LocalVCMessageAdapter(cbit.vcell.message.local.LocalVCMessageAdapter)

Aggregations

VCDestination (cbit.vcell.message.VCDestination)6 VCMessage (cbit.vcell.message.VCMessage)4 LocalVCMessageAdapter (cbit.vcell.message.local.LocalVCMessageAdapter)3 LocalVCMessageListener (cbit.vcell.message.local.LocalVCMessageAdapter.LocalVCMessageListener)3 SimulationJobStatus (cbit.vcell.server.SimulationJobStatus)3 VCellQueue (cbit.vcell.message.VCellQueue)2 VCSimulationIdentifier (cbit.vcell.solver.VCSimulationIdentifier)2 Destination (javax.jms.Destination)2 MessageConsumer (javax.jms.MessageConsumer)2 VCMessagingDelegate (cbit.vcell.message.VCMessagingDelegate)1 VCMessagingException (cbit.vcell.message.VCMessagingException)1 VCMessagingService (cbit.vcell.message.VCMessagingService)1 VCRpcRequest (cbit.vcell.message.VCRpcRequest)1 AdminDBTopLevel (cbit.vcell.modeldb.AdminDBTopLevel)1 DatabaseServerImpl (cbit.vcell.modeldb.DatabaseServerImpl)1 LocalAdminDbServer (cbit.vcell.modeldb.LocalAdminDbServer)1 SolverException (cbit.vcell.solver.SolverException)1 Configuration (freemarker.template.Configuration)1 DefaultObjectWrapper (freemarker.template.DefaultObjectWrapper)1 File (java.io.File)1