Examples of MonitorConfiguration


Examples of edu.indiana.extreme.xbaya.monitor.MonitorConfiguration

            }
        }

        this.workflow = this.engine.getWorkflow();

        MonitorConfiguration notifConfig = this.engine.getMonitor()
                .getConfiguration();
        if (notifConfig.getBrokerURL() == null) {
            this.engine.getErrorWindow().error(
                    ErrorMessages.BROKER_URL_NOT_SET_ERROR);
            return;
        }
        boolean compile = true;

        if (compile) {
            // Check if the workflow is valid before the user types in input
            // values.
            BPELScript bpel = new BPELScript(this.workflow);

            // Check if there is any errors in the workflow first.
            ArrayList<String> warnings = new ArrayList<String>();
            if (!bpel.validate(warnings)) {
                StringBuilder buf = new StringBuilder();
                for (String warning : warnings) {
                    buf.append("- ");
                    buf.append(warning);
                    buf.append("\n");
                }
                this.engine.getErrorWindow().warning(buf.toString());
                return;
            }

            try {
                // Generate a BPEL process.
                bpel.create(BPELScriptType.GPEL);
                this.workflow.setGpelProcess(bpel.getGpelProcess());
                this.workflow.setWorkflowWSDL(bpel.getWorkflowWSDL()
                        .getWsdlDefinitions());
            } catch (GraphException e) {
                this.engine.getErrorWindow().error(
                        ErrorMessages.GRAPH_NOT_READY_ERROR, e);
                return;
            }
        } else {
            if (this.workflow.getWorkflowWSDL() == null) {
                this.engine.getErrorWindow().error(
                        ErrorMessages.WORKFLOW_WSDL_NOT_EXIST);
                return;
            }
        }

        // Enable/Disable redeploy button
        boolean enable = this.workflow.getGPELTemplateID() != null;
        this.redeployAndInvokeButton.setEnabled(enable);

        // Create a GUI without depending on the graph.
        List<WSComponentPort> inputs;
        try {
            inputs = this.workflow.getInputs();
        } catch (ComponentException e) {
            // This should not happen when we create WSDL here, but if we use
            // precompiled workflow, it might happen.
            this.engine.getErrorWindow().error(
                    ErrorMessages.WORKFLOW_WSDL_ERROR, e);
            return;
        }
        List<Double> columnWeights = new ArrayList<Double>();
        for (WSComponentPort input : inputs) {
            String id = input.getName();
            QName type = input.getType();
            JLabel paramLabel = new JLabel(id, SwingConstants.TRAILING);
            JLabel typeLabel = new JLabel(type.getLocalPart());
            XBayaTextComponent paramField;
            if (LEADTypes.isKnownType(type)) {
                paramField = new XBayaTextField();
                columnWeights.add(new Double(0));
            } else {
                paramField = new XBayaTextArea();
                columnWeights.add(new Double(1.0));
            }
            paramLabel.setLabelFor(paramField.getSwingComponent());

            // default value
            Object value = input.getDefaultValue();
            String valueString = null;
            if (value != null) {
                if (value instanceof XmlElement) {
                    XmlElement valueElement = (XmlElement) value;
                    valueString = XMLUtil.xmlElementToString(valueElement);
                } else {
                    // Only string comes here for now.
                    valueString = value.toString();
                }
            }

            if (valueString == null) {
                // show some sample URI to ease inputs.
                final String sampleURI = "gsiftp://rainier.extreme.indiana.edu//tmp/foo.txt";
                if (LEADTypes.isURIType(type)) {
                    valueString = sampleURI;
                } else if (LEADTypes.isURIArrayType(type)) {
                    StringBuffer buf = new StringBuffer();
                    for (int i = 0; i < 4; i++) {
                        buf.append(sampleURI).append(" ");
                    }
                    valueString = buf.toString();
                }
            }
            paramField.setText(valueString);

            this.parameterPanel.add(paramLabel);
            this.parameterPanel.add(typeLabel);
            this.parameterPanel.add(paramField);
            this.parameterTextFields.add(paramField);
        }
        List<Double> rowWeights = new ArrayList<Double>();
        rowWeights.add(new Double(0));
        rowWeights.add(new Double(0));
        rowWeights.add(new Double(1));
        this.parameterPanel.layout(columnWeights, rowWeights);

        XBayaConfiguration configuration = this.engine.getConfiguration();
        MonitorConfiguration monitorConfiguration = this.engine.getMonitor()
                .getConfiguration();


        // DSC URL
        this.dscTextField.setText(configuration.getDSCURL());
View Full Code Here

Examples of edu.indiana.extreme.xbaya.monitor.MonitorConfiguration

   * Shows the dialog.
   */
  public void show() {
    this.workflow = this.engine.getWorkflow();

    MonitorConfiguration notifConfig = this.engine.getMonitor().getConfiguration();
    if (notifConfig.getBrokerURL() == null) {
      this.engine.getErrorWindow().error(ErrorMessages.BROKER_URL_NOT_SET_ERROR);
      return;
    }

    // Create input fields
View Full Code Here

Examples of edu.indiana.extreme.xbaya.monitor.MonitorConfiguration

    // Use topic as a base of workflow instance ID so that the monitor can
    // find it.
    URI workfowInstanceID = URI.create(StringUtil.convertToJavaIdentifier(topic));
    this.workflow.setGPELInstanceID(workfowInstanceID);

    MonitorConfiguration notifConfig = this.engine.getMonitor().getConfiguration();
    notifConfig.setTopic(topic);
    arguments.add("-" + JythonScript.TOPIC_VARIABLE);
    arguments.add(topic);
    Collection<WSNode> wsNodes = GraphUtil.getWSNodes(this.engine.getWorkflow().getGraph());
    // This is to enable service interaction with the back end
    if (this.interactChkBox.isSelected()) {
      LinkedList<String> nodeIDs = new LinkedList<String>();
      for (WSNode node : wsNodes) {
        nodeIDs.add(node.getID());
        ((WSNodeGUI) node.getGUI()).setInteractiveMode(true);
      }
      notifConfig.setInteractiveNodeIDs(nodeIDs);
    } else {
      for (WSNode node : wsNodes) {
        ((WSNodeGUI) node.getGUI()).setInteractiveMode(false);
      }
    }

    // TODO error check for user inputs

    final List<InputNode> inputNodes = GraphUtil.getInputNodes(this.workflow.getGraph());
    final org.xmlpull.v1.builder.XmlElement inputs = builder.newFragment("inputs");
    ODEClient client = new ODEClient();
    for (int i = 0; i < inputNodes.size(); i++) {
      InputNode inputNode = inputNodes.get(i);
      XBayaTextField parameterTextField = this.parameterTextFields.get(i);
      String id = inputNode.getID();
      String value = parameterTextField.getText();
      inputNode.setDefaultValue(value);
    }

    final String xregistryUrl = this.xRegistryTextField.getText();
    if (null != xregistryUrl && !"".equals(xregistryUrl)) {
      try {
        this.engine.getConfiguration().setXRegistryURL(new URI(xregistryUrl));
      } catch (URISyntaxException e) {
        this.engine.getErrorWindow().error(e);
      }
    }

    final String gFacUrl = this.gfacTextField.getText();
    if (null != gFacUrl && !"".equals(gFacUrl)) {
      try {
        this.engine.getConfiguration().setGFacURL(new URI(gFacUrl));
      } catch (URISyntaxException e) {
        this.engine.getErrorWindow().error(e);
      }
    }
    this.engine.getConfiguration().setTopic(topic);

   
    /*
     * Load host description from xregistry and add to interpreter
     */   
    LeadResourceMapping mapping = null;
    String host = this.resourceSelectionComboBox.getText();
    if (host != null && !host.isEmpty()) {
      System.out.println("YEAHHH");
      XRegistryAccesser xregistryAccesser = new XRegistryAccesser(this.engine);

      HostDescriptionRegistrationWindow hostWindow = HostDescriptionRegistrationWindow.getInstance();

      if (!hostWindow.isEngineSet()) {
        hostWindow.setXBayaEngine(this.engine);
      }

      HostBean hostBean = xregistryAccesser.getHostBean(host);
     
      mapping = new LeadResourceMapping(host);
      try{
        mapping.setGatekeeperEPR(new URI(hostBean.getGateKeeperendPointReference()));
      }catch(Exception e){
        this.engine.getErrorWindow().error(e);
      }
     
    }
   
    final LeadResourceMapping resourceMapping = mapping;
    final String topicString = topic;
    new Thread() {
      /**
       * @see java.lang.Thread#run()
       */
      @Override
      public void run() {

        boolean remote = false;

        if (remote) {

          try {
            DynamicWorkflowRunnerWindow.this.engine.getMonitor().getConfiguration().setTopic(topicString);

            DynamicWorkflowRunnerWindow.this.engine.getMonitor().start();
          } catch (MonitorException e1) {
            DynamicWorkflowRunnerWindow.this.engine.getErrorWindow().error(e1);
          }
          try {

            WorkflowInterpretorStub stub = new WorkflowInterpretorStub("http://silktree.cs.indiana.edu:18080/axis2/services/WorkflowInterpretor?wsdl");
            NameValue[] configurations = new NameValue[6];
            configurations[0] = new NameValue();
            configurations[0].setName(HeaderConstants.HEADER_ELEMENT_GFAC);
            configurations[0].setValue(engine.getConfiguration().getGFacURL().toString());
            configurations[1] = new NameValue();
            configurations[1].setName(HeaderConstants.HEADER_ELEMENT_XREGISTRY);
            if (null == engine.getConfiguration().getXRegistryURL()) {
              configurations[1].setValue(XBayaConstants.DEFAULT_XREGISTRY_URL.toString());
            } else {
              configurations[1].setValue(engine.getConfiguration().getXRegistryURL().toString());
            }
            configurations[2] = new NameValue();
            configurations[2].setName(HeaderConstants.HEADER_ELEMENT_PROXYSERVER);
            configurations[2].setValue(engine.getConfiguration().getMyProxyServer());

            configurations[3] = new NameValue();
            configurations[3].setName(HeaderConstants.HEADER_ELEMENT_BROKER);
            configurations[3].setValue(engine.getConfiguration().getBrokerURL().toString());

            configurations[4] = new NameValue();
            configurations[4].setName(HeaderConstants.HEADER_ELEMENT_MSGBOX);
            configurations[4].setValue(engine.getConfiguration().getMessageBoxURL().toString());

            configurations[5] = new NameValue();
            configurations[5].setName(HeaderConstants.HEADER_ELEMENT_DSC);
            configurations[5].setValue(engine.getConfiguration().getDSCURL().toString());

            NameValue[] inputNameVals = new NameValue[inputNodes.size()];
            for (int i = 0; i < inputNodes.size(); i++) {
              inputNameVals[i] = new NameValue();
              InputNode inputNode = inputNodes.get(i);
              String id = inputNode.getID();
              String value = inputNode.getDefaultValue().toString();
              inputNameVals[i].setName(id);
              inputNameVals[i].setValue(value);
            }

            // WorkflowInterpretorSkeleton skel = new
            // WorkflowInterpretorSkeleton();
            //
            // skel.launchWorkflow(workflow.toXMLText(),
            // topicString,
            // "changeme", "chathura", inputNameVals,
            // configurations);

            String myProxyUsername = engine.getMyProxyClient().getUsername();
            String myProxyPass = engine.getMyProxyClient().getPassphrase();

            stub.launchWorkflow(workflow.toXMLText(), topicString, myProxyPass, myProxyUsername, inputNameVals, configurations);
          } catch (Exception e) {
            DynamicWorkflowRunnerWindow.this.engine.getErrorWindow().error(e);
          }
        } else {

          WorkflowInterpreter workflowInterpreter = new WorkflowInterpreter(DynamicWorkflowRunnerWindow.this.engine, topicString);
          try {
            MonitorConfiguration notifConfig = DynamicWorkflowRunnerWindow.this.engine.getMonitor().getConfiguration();
            notifConfig.setTopic(topicString);
            DynamicWorkflowRunnerWindow.this.engine.getMonitor().start();

            DynamicWorkflowRunnerWindow.this.engine.getGUI().addDynamicExecutionToolsToToolbar();

            if(resourceMapping!=null)
View Full Code Here

Examples of edu.indiana.extreme.xbaya.monitor.MonitorConfiguration

 

  private void runInThread(final Workflow workflow,
      final List<WSComponentPort> inputs, LeadResourceMapping resourceMapping) {
    MonitorConfiguration monitorConfiguration = this.engine.getMonitor()
        .getConfiguration();
    XBayaConfiguration configuration = this.engine.getConfiguration();
   

    // Create the invoker
    LEADWorkflowInvoker invoker = null;
    try {
     
      WsdlDefinitions wsdl = workflow.getOdeInvokableWSDL(configuration.getDSCURL(), configuration.getODEURL());
     
      LeadContextHeader leadContext = WSDLUtil.buildLeadContextHeader(this.engine,
          monitorConfiguration, StringUtil.convertToJavaIdentifier(engine
              .getWorkflow().getName()),resourceMapping);
      ///////////////////////////////////////
      leadContext.setExperimentId(monitorConfiguration.getTopic());
     
     
      //////////////////////////////////////////////////////////////
     
      URI messageBoxURL = null;
      if (monitorConfiguration.isPullMode()) {
        messageBoxURL = monitorConfiguration.getMessageBoxURL();
      }

      // create an invoker with LEAD Context
      GsiInvoker secureInvoker = null;
      if (this.engine.getWorkflowClient().isSecure()) {
View Full Code Here

Examples of edu.indiana.extreme.xbaya.monitor.MonitorConfiguration

        this.parameterTextFields = parameterTextFields;
        this.gfacTextField = new XBayaTextField();
        this.script = new JythonScript(this.workflow, this.engine
                .getConfiguration());

        MonitorConfiguration notifConfig = this.engine.getMonitor()
                .getConfiguration();
        if (notifConfig.getBrokerURL() == null) {
            this.engine.getErrorWindow().error(
                    ErrorMessages.BROKER_URL_NOT_SET_ERROR);
            return;
        }
View Full Code Here

Examples of edu.indiana.extreme.xbaya.monitor.MonitorConfiguration

    public void show() {
        this.workflow = this.engine.getWorkflow();
        this.script = new JythonScript(this.workflow, this.engine
                .getConfiguration());

        MonitorConfiguration notifConfig = this.engine.getMonitor()
                .getConfiguration();
        if (notifConfig.getBrokerURL() == null) {
            this.engine.getErrorWindow().error(
                    ErrorMessages.BROKER_URL_NOT_SET_ERROR);
            return;
        }

        // Check if the workflow is valid before the user types in input
        // values.
        ArrayList<String> warnings = new ArrayList<String>();
        if (!this.script.validate(warnings)) {
            StringBuilder buf = new StringBuilder();
            for (String warning : warnings) {
                buf.append("- ");
                buf.append(warning);
                buf.append("\n");
            }
            this.engine.getErrorWindow().warning(buf.toString());
            return;
        }

        // Create a script here. It might throw some exception because the
        // validation is not perfect.
        try {
            this.script.create();
        } catch (GraphException e) {
            this.engine.getErrorWindow().error(
                    ErrorMessages.GRAPH_NOT_READY_ERROR, e);
            hide();
            return;
        } catch (RuntimeException e) {
            this.engine.getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR,
                    e);
            hide();
            return;
        } catch (Error e) {
            this.engine.getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR,
                    e);
            hide();
            return;
        }

        // Create input fields
        Collection<InputNode> inputNodes = GraphUtil
                .getInputNodes(this.workflow.getGraph());
        for (InputNode node : inputNodes) {
            String id = node.getID();
            QName parameterType = node.getParameterType();
            JLabel nameLabel = new JLabel(id);
            JLabel typeField = new JLabel(parameterType.getLocalPart());
            XBayaTextField paramField = new XBayaTextField();
            Object value = node.getDefaultValue();

            String valueString;
            if (value == null) {
                valueString = "";
            } else {
                if (value instanceof XmlElement) {
                    XmlElement valueElement = (XmlElement) value;
                    valueString = XMLUtil.xmlElementToString(valueElement);
                } else {
                    // Only string comes here for now.
                    valueString = value.toString();
                }
            }
            paramField.setText(valueString);
            this.parameterPanel.add(nameLabel);
            this.parameterPanel.add(typeField);
            this.parameterPanel.add(paramField);
            this.parameterTextFields.add(paramField);
        }
        this.parameterPanel.layout(inputNodes.size(), 3, GridPanel.WEIGHT_NONE,
                2);

        this.topicTextField.setText(notifConfig.getTopic());

        XBayaConfiguration config = this.engine.getConfiguration();

        URI gfacURL = config.getGFacURL();
        this.gfacTextField.setText(StringUtil.toString(gfacURL));
View Full Code Here

Examples of edu.indiana.extreme.xbaya.monitor.MonitorConfiguration

        // find it.
        URI workfowInstanceID = URI.create(StringUtil
                .convertToJavaIdentifier(topic));
        this.workflow.setGPELInstanceID(workfowInstanceID);

        MonitorConfiguration notifConfig = this.engine.getMonitor()
                .getConfiguration();
        notifConfig.setTopic(topic);
        arguments.add("-" + JythonScript.TOPIC_VARIABLE);
        arguments.add(topic);

        // TODO error check for user inputs

        List<InputNode> inputNodes = GraphUtil.getInputNodes(this.workflow
                .getGraph());
        for (int i = 0; i < inputNodes.size(); i++) {
            InputNode inputNode = inputNodes.get(i);
            XBayaTextField parameterTextField = this.parameterTextFields.get(i);
            String id = inputNode.getID();
            String value = parameterTextField.getText();
            arguments.add("-" + id);
            arguments.add(value);
        }

        XBayaConfiguration config = this.engine.getConfiguration();

        String gfacString = this.gfacTextField.getText();
        if (gfacString.length() != 0) {
            try {
                URI uri = new URI(gfacString).parseServerAuthority();
                config.setGFacURL(uri);
            } catch (URISyntaxException e) {
                this.engine.getErrorWindow().error(
                        ErrorMessages.GFAC_URL_WRONG, e);
                return;
            }
            arguments.add("-" + JythonScript.GFAC_VARIABLE);
            arguments.add(gfacString);
        }
       
        arguments.add("-" + JythonScript.BROKER_URL_VARIABLE);
        arguments.add(notifConfig.getBrokerURL().toString());

        if (notifConfig.isPullMode()) {
            arguments.add("-" + JythonScript.MESSAGE_BOX_URL_VARIABLE);
            arguments.add(notifConfig.getMessageBoxURL().toString());
        }

        try {
            for (WSNode node : GraphUtil.getWSNodes(this.workflow.getGraph())) {
                WSComponent component = node.getComponent();
View Full Code Here

Examples of edu.indiana.extreme.xbaya.monitor.MonitorConfiguration

   * Shows the dialog.
   */
  public void show() {
    this.workflow = this.engine.getWorkflow();

    MonitorConfiguration notifConfig = this.engine.getMonitor()
        .getConfiguration();
    if (notifConfig.getBrokerURL() == null) {
      this.engine.getErrorWindow().error(
          ErrorMessages.BROKER_URL_NOT_SET_ERROR);
      return;
    }

View Full Code Here

Examples of edu.indiana.extreme.xbaya.monitor.MonitorConfiguration

    // find it.
    URI workfowInstanceID = URI.create(StringUtil
        .convertToJavaIdentifier(topic));
    this.workflow.setGPELInstanceID(workfowInstanceID);

    MonitorConfiguration notifConfig = this.engine.getMonitor()
        .getConfiguration();
    notifConfig.setTopic(topic);
    arguments.add("-" + JythonScript.TOPIC_VARIABLE);
    arguments.add(topic);
    Collection<WSNode> wsNodes = GraphUtil.getWSNodes(this.engine
        .getWorkflow().getGraph());
    for (WSNode node : wsNodes) {
View Full Code Here

Examples of edu.indiana.extreme.xbaya.monitor.MonitorConfiguration

          }

          LeadContextHeader leadCtxHeader = null;
          try {
            if (this.mode == GUI_MODE) {
              leadCtxHeader = WSDLUtil.buildLeadContextHeader(this.workflow, this.configuration, this.engine.getMyLead(), new MonitorConfiguration(this.configuration.getBrokerURL(), this.topic, true, this.configuration.getMessageBoxURL()), wsNode.getID(), null);
            } else {
              leadCtxHeader = WSDLUtil.buildLeadContextHeader(this.workflow, this.configuration,
              // Set the userdn in the right proxy if necessary
                  new MyLead(new MyLeadConfiguration(), proxy), new MonitorConfiguration(this.configuration.getBrokerURL(), this.topic, true, this.configuration.getMessageBoxURL()), wsNode.getID(), null);
            }
          } catch (URISyntaxException e) {
            throw new XBayaException(e);
          }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.