예제 #1
0
 public void stopClients() {
   if (outputClient != null) {
     try {
       outputClient.stop();
     } catch (Exception e) {
     }
   }
   if (inputClient != null) {
     try {
       inputClient.stop();
     } catch (Exception e) {
     }
   }
 }
예제 #2
0
  public SimulationParameters(int simNum, LaBoGridConfiguration laboConf, DistributedAgent da)
      throws LBException {

    this.simNum = simNum;
    this.laboConf = laboConf;

    simDesc = laboConf.getExperienceDescription().getSimulationDescription(simNum);

    LBConfiguration lbConf = laboConf.getLBConfiguration(simDesc.getLBConfigurationId());
    latticeClass = lbConf.getLatticeDescription().getClassName();
    solidClass = lbConf.getSolidDescription().getClassName();

    String chainId = simDesc.getProcessingChainId();
    ProcessingChainDescription pcd = laboConf.getProcessingChain(chainId);
    powerDesc = SimulationDescription.getPowerDescriptor(latticeClass, pcd);
    procChain = ProcessingChain.getOperatorsChain(pcd, false);

    // Set output client.
    IODescription outDesc = simDesc.getOutput();
    if (outDesc != null) {

      try {
        outputClient = outDesc.getOutputClient();
        outputClient.setDistributedAgent(da);
      } catch (Exception e) {
        throw new LBException("Could not start output client", e);
      }
    }

    // Set input client.
    IODescription inDesc = simDesc.getInput();
    if (inDesc != null) {

      try {
        inputClient = inDesc.getInputClient();
        inputClient.setDistributedAgent(da);
      } catch (Exception e) {
        throw new LBException("Could not start input client", e);
      }
    }
  }
예제 #3
0
 public void getFileFromInput(String fileUID, File dest, InputClientCallBack cb)
     throws InputClientException, IOException {
   inputClient.get(fileUID, dest, cb);
 }
예제 #4
0
 public void stopInputClient() throws Exception {
   if (inputClient != null) {
     inputClient.stop();
     inputClient.join();
   }
 }
예제 #5
0
 public void startInputClient() throws Exception {
   if (inputClient != null) {
     inputClient.start();
   }
 }
예제 #6
0
 public void submitMessageToInputClient(InputClientMessage o) {
   if (inputClient != null) {
     inputClient.submitInputClientMessage(o);
   }
 }