Package org.jamesii.core.distributed.simulationserver

Examples of org.jamesii.core.distributed.simulationserver.ISimulationServer


   *
   * @return the simulation run host
   */
  private ISimulationServer getHostOfSimulationRun(
      ComputationTaskIDObject simulationRunId) {
    ISimulationServer host =
        (ISimulationServer) serviceRegistry.getServicesForPurpose(
            simulationRunId).get(0);
    if (host == null) {
      report("Simulation with ID " + simulationRunId
          + " not found on this server!!!");
View Full Code Here


   *           the remote exception
   */
  protected void start(ComputationTaskIDObject simulationID)
      throws RemoteException {

    ISimulationServer host = getHostOfSimulationRun(simulationID);

    report("Starting Simulation " + simulationID + " on remote host: " + host);

    host.startSimulationRun(simulationID);
  }
View Full Code Here

   *           the remote exception
   */
  @Override
  public void stop(ComputationTaskIDObject simulationID) throws RemoteException {

    ISimulationServer host = getHostOfSimulationRun(simulationID);

    report("Stopping Simulation run " + simulationID + " on remote host: "
        + host);

    host.stopProc(simulationID);
  }
View Full Code Here

  }

  @Override
  public <D> D getSimulationRunProperty(ComputationTaskIDObject simulationID,
      String property) throws RemoteException {
    ISimulationServer host = getHostOfSimulationRun(simulationID);
    return host.getSimulationRunProperty(simulationID, property);
  }
View Full Code Here

  @Override
  public Partition getPartition(ComputationTaskIDObject simulationID)
      throws RemoteException {

    ISimulationServer host = getHostOfSimulationRun(simulationID);

    return host.getPartition(simulationID);
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  @Override
  public <D> D executeRunnableCommand(ComputationTaskIDObject simulationID,
      String command, Object[] args) {
    ISimulationServer host = getHostOfSimulationRun(simulationID);
    try {
      return (D) host.executeRunnableCommand(simulationID, command, args);
    } catch (RemoteException re) {
      SimSystem.report(re);
    }
    return null;
  }
View Full Code Here

   */
  private static final long serialVersionUID = -604266211071106087L;

  @Override
  public IServiceView create(ParameterBlock params, Context context) {
    ISimulationServer server = null;
    Contribution contr = Contribution.EDITOR;
    if (params != null) {
      server =
              params
                  .getSubBlockValue(ServiceViewFactory.SERVICE);
View Full Code Here

  @Override
  public void setupObservers() {
    IMediator mediator = new Mediator();
    try {
      ISimulationServer simServer = (ISimulationServer) getServer();
      simServer.setManagementMediator(mediator);
      simServer.registerRemoteObserver(new SimulationManagementObserver(this));
    } catch (RemoteException e) {
      SimSystem.report(e);
    }

  }
View Full Code Here

            new String[] { "" }, null, null, this) {

          @Override
          public void execute() {
            synchronized (this) {
              ISimulationServer simServer = (ISimulationServer) getServer();
              ComputationTaskIDObject info =
                  (ComputationTaskIDObject) getSelectedNodeInfo().getInfo();
              try {
                simServer.startSimulationRun(info);
              } catch (RemoteException e) {
                SimSystem.report(e);
              }
            }
          }
        };
    action.setEnabled(getSelectedNodeInfo() != null);
    actions.add(action);

    action =
        new AbstractAction("simulation.pause", "pause", pauseIcon,
            new String[] { "" }, null, null, this) {

          @Override
          public void execute() {
            synchronized (this) {
              ISimulationServer simServer = (ISimulationServer) getServer();
              ComputationTaskIDObject info =
                  (ComputationTaskIDObject) getSelectedNodeInfo().getInfo();
              try {
                simServer.executeRunnableCommand(info, "pause", null);
              } catch (RemoteException e) {
                SimSystem.report(e);
              }
            }
          }
        };
    action.setEnabled(getSelectedNodeInfo() != null);
    actions.add(action);

    action =
        new AbstractAction("simulation.stop", "stop", stopIcon,
            new String[] { "" }, null, null, this) {

          @Override
          public void execute() {
            synchronized (this) {
              ISimulationServer simServer = (ISimulationServer) getServer();
              ComputationTaskIDObject info =
                  (ComputationTaskIDObject) getSelectedNodeInfo().getInfo();
              try {
                simServer.stopProc(info);
              } catch (RemoteException e) {
                SimSystem.report(e);
              }
            }
          }
View Full Code Here

TOP

Related Classes of org.jamesii.core.distributed.simulationserver.ISimulationServer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.