Author: samindaw
Date: Mon Nov 19 16:58:01 2012
New Revision: 1411307
URL: http://svn.apache.org/viewvc?rev=1411307&view=rev
Log:
refactoring monitor & stub out of xbaya
Added:
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/stub/
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/stub/interpretor/
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/stub/interpretor/NameValue.java
(with props)
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/stub/interpretor/WorkflowInterpretorCallbackHandler.java
(with props)
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/stub/interpretor/WorkflowInterpretorStub.java
(with props)
Removed:
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/event/
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/NameValue.java
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorCallbackHandler.java
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorStub.java
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/monitor/
Modified:
airavata/trunk/modules/airavata-client/pom.xml
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataClient.java
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ExecutionManager.java
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ExecutionManagerImpl.java
airavata/trunk/modules/distribution/pom.xml
airavata/trunk/modules/distribution/src/main/assembly/bin-assembly.xml
airavata/trunk/modules/workflow-model/workflow-model-core/src/main/java/org/apache/airavata/workflow/model/wf/WorkflowInput.java
airavata/trunk/modules/ws-messenger/pom.xml
airavata/trunk/modules/xbaya-gui/pom.xml
airavata/trunk/modules/xbaya-gui/pom_jnlp.xml
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/GUIWorkflowInterpreterInteractorImpl.java
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterConfiguration.java
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorEventListener.java
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorMessageReceiverInOut.java
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/lead/LeadContextHeaderHelper.java
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/modifier/WorkflowModifier.java
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WorkflowModificationTestCase.java
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/XBayaGUI.java
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/dynamic/DynamicWorkflowRunnerWindow.java
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/ws/ServiceInteractionWindow.java
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/monitor/MonitorConfigurationWindow.java
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/monitor/MonitorWindow.java
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/WorkflowInterpreterLaunchWindow.java
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/ws/WSNodeGUI.java
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/RunMenuItem.java
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/monitor/MonitorEventHandler.java
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/monitor/MonitorStarter.java
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/views/MonitorPanel.java
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/XBayaUtil.java
airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/workflow/WorkflowClient.java
airavata/trunk/modules/xbaya-gui/src/main/resources/airavata-server.properties
airavata/trunk/modules/xbaya-gui/src/main/resources/xbaya-jnlp-template.vm
airavata/trunk/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/utils/WorkflowTestUtils.java
Modified: airavata/trunk/modules/airavata-client/pom.xml
URL:
http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-client/pom.xml?rev=1411307&r1=1411306&r2=1411307&view=diff
==============================================================================
--- airavata/trunk/modules/airavata-client/pom.xml (original)
+++ airavata/trunk/modules/airavata-client/pom.xml Mon Nov 19 16:58:01 2012
@@ -29,6 +29,11 @@
<version>${project.version}</version>
</dependency>
<dependency>
+ <groupId>org.apache.airavata</groupId>
+ <artifactId>airavata-message-monitor</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-codegen</artifactId>
<version>${axis2.version}</version>
@@ -45,11 +50,6 @@
</dependency>
<dependency>
<groupId>org.apache.airavata</groupId>
- <artifactId>airavata-xbaya-gui</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.airavata</groupId>
<artifactId>airavata-rest-client</artifactId>
<version>${project.version}</version>
</dependency>
Modified:
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataClient.java
URL:
http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataClient.java?rev=1411307&r1=1411306&r2=1411307&view=diff
==============================================================================
---
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataClient.java
(original)
+++
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/AiravataClient.java
Mon Nov 19 16:58:01 2012
@@ -42,7 +42,6 @@ import java.util.UUID;
import javax.jcr.Node;
import javax.jcr.NodeIterator;
-import javax.jcr.PathNotFoundException;
import javax.jcr.Property;
import javax.jcr.PropertyIterator;
import javax.jcr.RepositoryException;
@@ -62,6 +61,8 @@ import org.apache.airavata.client.impl.E
import org.apache.airavata.client.impl.ProvenanceManagerImpl;
import org.apache.airavata.client.impl.UserManagerImpl;
import org.apache.airavata.client.impl.WorkflowManagerImpl;
+import org.apache.airavata.client.stub.interpretor.NameValue;
+import org.apache.airavata.client.stub.interpretor.WorkflowInterpretorStub;
import org.apache.airavata.common.utils.Version;
import org.apache.airavata.common.utils.XMLUtil;
import
org.apache.airavata.common.workflow.execution.context.WorkflowContextHeaderBuilder;
@@ -78,11 +79,9 @@ import org.apache.airavata.workflow.mode
import org.apache.airavata.workflow.model.graph.util.GraphUtil;
import org.apache.airavata.workflow.model.wf.Workflow;
import org.apache.airavata.workflow.model.wf.WorkflowInput;
-import org.apache.airavata.xbaya.interpretor.NameValue;
-import org.apache.airavata.xbaya.interpretor.WorkflowInterpretorStub;
-import org.apache.airavata.xbaya.monitor.Monitor;
-import org.apache.airavata.xbaya.monitor.MonitorConfiguration;
-import org.apache.airavata.xbaya.monitor.MonitorEventListener;
+import org.apache.airavata.ws.monitor.Monitor;
+import org.apache.airavata.ws.monitor.MonitorConfiguration;
+import org.apache.airavata.ws.monitor.MonitorEventListener;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.impl.llom.util.AXIOMUtil;
import org.apache.axis2.AxisFault;
Modified:
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ExecutionManager.java
URL:
http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ExecutionManager.java?rev=1411307&r1=1411306&r2=1411307&view=diff
==============================================================================
---
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ExecutionManager.java
(original)
+++
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/api/ExecutionManager.java
Mon Nov 19 16:58:01 2012
@@ -27,8 +27,8 @@ import org.apache.airavata.common.workfl
import
org.apache.airavata.core.gfac.context.invocation.impl.DefaultExecutionContext;
import org.apache.airavata.workflow.model.wf.Workflow;
import org.apache.airavata.workflow.model.wf.WorkflowInput;
-import org.apache.airavata.xbaya.monitor.Monitor;
-import org.apache.airavata.xbaya.monitor.MonitorEventListener;
+import org.apache.airavata.ws.monitor.Monitor;
+import org.apache.airavata.ws.monitor.MonitorEventListener;
public interface ExecutionManager {
/**
Modified:
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ExecutionManagerImpl.java
URL:
http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ExecutionManagerImpl.java?rev=1411307&r1=1411306&r2=1411307&view=diff
==============================================================================
---
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ExecutionManagerImpl.java
(original)
+++
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/impl/ExecutionManagerImpl.java
Mon Nov 19 16:58:01 2012
@@ -33,8 +33,8 @@ import org.apache.airavata.common.workfl
import
org.apache.airavata.core.gfac.context.invocation.impl.DefaultExecutionContext;
import org.apache.airavata.workflow.model.wf.Workflow;
import org.apache.airavata.workflow.model.wf.WorkflowInput;
-import org.apache.airavata.xbaya.monitor.Monitor;
-import org.apache.airavata.xbaya.monitor.MonitorEventListener;
+import org.apache.airavata.ws.monitor.Monitor;
+import org.apache.airavata.ws.monitor.MonitorEventListener;
public class ExecutionManagerImpl implements ExecutionManager {
private AiravataClient client;
Added:
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/stub/interpretor/NameValue.java
URL:
http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/stub/interpretor/NameValue.java?rev=1411307&view=auto
==============================================================================
---
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/stub/interpretor/NameValue.java
(added)
+++
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/stub/interpretor/NameValue.java
Mon Nov 19 16:58:01 2012
@@ -0,0 +1,559 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.airavata.client.stub.interpretor;
+
+
+// http://silktree.cs.indiana.edu:18080/axis2/services/WorkflowInterpretor
+public class NameValue implements org.apache.axis2.databinding.ADBBean {
+ /*
+ * This type was generated from the piece of schema that had name =
NameValue Namespace URI =
+ * http://interpretor.xbaya.airavata.apache.org Namespace Prefix = ns1
+ */
+
+ private static String generatePrefix(String namespace) {
+ if (namespace.equals("http://interpretor.xbaya.airavata.apache.org")) {
+ return "ns1";
+ }
+ return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix();
+ }
+
+ /**
+ * field for Name
+ */
+
+ protected String localName;
+
+ /*
+ * This tracker boolean wil be used to detect whether the user called the
set method for this attribute. It will be
+ * used to determine whether to include this field in the serialized XML
+ */
+ protected boolean localNameTracker = false;
+
+ /**
+ * Auto generated getter method
+ *
+ * @return java.lang.String
+ */
+ public String getName() {
+ return localName;
+ }
+
+ /**
+ * Auto generated setter method
+ *
+ * @param param
+ * Name
+ */
+ public void setName(String param) {
+
+ if (param != null) {
+ // update the setting tracker
+ localNameTracker = true;
+ } else {
+ localNameTracker = true;
+
+ }
+
+ this.localName = param;
+
+ }
+
+ /**
+ * field for Value
+ */
+
+ protected String localValue;
+
+ /*
+ * This tracker boolean wil be used to detect whether the user called the
set method for this attribute. It will be
+ * used to determine whether to include this field in the serialized XML
+ */
+ protected boolean localValueTracker = false;
+
+ /**
+ * Auto generated getter method
+ *
+ * @return java.lang.String
+ */
+ public String getValue() {
+ return localValue;
+ }
+
+ /**
+ * Auto generated setter method
+ *
+ * @param param
+ * Value
+ */
+ public void setValue(String param) {
+
+ if (param != null) {
+ // update the setting tracker
+ localValueTracker = true;
+ } else {
+ localValueTracker = true;
+
+ }
+
+ this.localValue = param;
+
+ }
+
+ /**
+ * isReaderMTOMAware
+ *
+ * @return true if the reader supports MTOM
+ */
+ public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader
reader) {
+ boolean isReaderMTOMAware = false;
+
+ try {
+ isReaderMTOMAware = Boolean.TRUE.equals(reader
+
.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE));
+ } catch (IllegalArgumentException e) {
+ isReaderMTOMAware = false;
+ }
+ return isReaderMTOMAware;
+ }
+
+ /**
+ *
+ * @param parentQName
+ * @param factory
+ * @return org.apache.axiom.om.OMElement
+ */
+ public org.apache.axiom.om.OMElement getOMElement(final
javax.xml.namespace.QName parentQName,
+ final org.apache.axiom.om.OMFactory factory) throws
org.apache.axis2.databinding.ADBException {
+
+ org.apache.axiom.om.OMDataSource dataSource = new
org.apache.axis2.databinding.ADBDataSource(this, parentQName) {
+
+ public void
serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter
xmlWriter)
+ throws javax.xml.stream.XMLStreamException {
+ NameValue.this.serialize(parentQName, factory, xmlWriter);
+ }
+ };
+ return new
org.apache.axiom.om.impl.llom.OMSourcedElementImpl(parentQName, factory,
dataSource);
+
+ }
+
+ public void serialize(final javax.xml.namespace.QName parentQName, final
org.apache.axiom.om.OMFactory factory,
+ org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter
xmlWriter)
+ throws javax.xml.stream.XMLStreamException,
org.apache.axis2.databinding.ADBException {
+ serialize(parentQName, factory, xmlWriter, false);
+ }
+
+ public void serialize(final javax.xml.namespace.QName parentQName, final
org.apache.axiom.om.OMFactory factory,
+ org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter
xmlWriter, boolean serializeType)
+ throws javax.xml.stream.XMLStreamException,
org.apache.axis2.databinding.ADBException {
+
+ String prefix = null;
+ String namespace = null;
+
+ prefix = parentQName.getPrefix();
+ namespace = parentQName.getNamespaceURI();
+
+ if ((namespace != null) && (namespace.trim().length() > 0)) {
+ String writerPrefix = xmlWriter.getPrefix(namespace);
+ if (writerPrefix != null) {
+ xmlWriter.writeStartElement(namespace,
parentQName.getLocalPart());
+ } else {
+ if (prefix == null) {
+ prefix = generatePrefix(namespace);
+ }
+
+ xmlWriter.writeStartElement(prefix,
parentQName.getLocalPart(), namespace);
+ xmlWriter.writeNamespace(prefix, namespace);
+ xmlWriter.setPrefix(prefix, namespace);
+ }
+ } else {
+ xmlWriter.writeStartElement(parentQName.getLocalPart());
+ }
+
+ if (serializeType) {
+
+ String namespacePrefix = registerPrefix(xmlWriter,
"http://interpretor.xbaya.airavata.apache.org");
+ if ((namespacePrefix != null) && (namespacePrefix.trim().length()
> 0)) {
+ writeAttribute("xsi",
"http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix
+ + ":NameValue", xmlWriter);
+ } else {
+ writeAttribute("xsi",
"http://www.w3.org/2001/XMLSchema-instance", "type", "NameValue", xmlWriter);
+ }
+
+ }
+ if (localNameTracker) {
+ namespace = "";
+ if (!namespace.equals("")) {
+ prefix = xmlWriter.getPrefix(namespace);
+
+ if (prefix == null) {
+ prefix = generatePrefix(namespace);
+
+ xmlWriter.writeStartElement(prefix, "name", namespace);
+ xmlWriter.writeNamespace(prefix, namespace);
+ xmlWriter.setPrefix(prefix, namespace);
+
+ } else {
+ xmlWriter.writeStartElement(namespace, "name");
+ }
+
+ } else {
+ xmlWriter.writeStartElement("name");
+ }
+
+ if (localName == null) {
+ // write the nil attribute
+
+ writeAttribute("xsi",
"http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter);
+
+ } else {
+
+ xmlWriter.writeCharacters(localName);
+
+ }
+
+ xmlWriter.writeEndElement();
+ }
+ if (localValueTracker) {
+ namespace = "";
+ if (!namespace.equals("")) {
+ prefix = xmlWriter.getPrefix(namespace);
+
+ if (prefix == null) {
+ prefix = generatePrefix(namespace);
+
+ xmlWriter.writeStartElement(prefix, "value", namespace);
+ xmlWriter.writeNamespace(prefix, namespace);
+ xmlWriter.setPrefix(prefix, namespace);
+
+ } else {
+ xmlWriter.writeStartElement(namespace, "value");
+ }
+
+ } else {
+ xmlWriter.writeStartElement("value");
+ }
+
+ if (localValue == null) {
+ // write the nil attribute
+
+ writeAttribute("xsi",
"http://www.w3.org/2001/XMLSchema-instance", "nil", "1", xmlWriter);
+
+ } else {
+
+ xmlWriter.writeCharacters(localValue);
+
+ }
+
+ xmlWriter.writeEndElement();
+ }
+ xmlWriter.writeEndElement();
+
+ }
+
+ /**
+ * Util method to write an attribute with the ns prefix
+ */
+ private void writeAttribute(String prefix, String namespace, String
attName, String attValue,
+ javax.xml.stream.XMLStreamWriter xmlWriter) throws
javax.xml.stream.XMLStreamException {
+ if (xmlWriter.getPrefix(namespace) == null) {
+ xmlWriter.writeNamespace(prefix, namespace);
+ xmlWriter.setPrefix(prefix, namespace);
+
+ }
+
+ xmlWriter.writeAttribute(namespace, attName, attValue);
+
+ }
+
+ /**
+ * Util method to write an attribute without the ns prefix
+ */
+ private void writeAttribute(String namespace, String attName, String
attValue,
+ javax.xml.stream.XMLStreamWriter xmlWriter) throws
javax.xml.stream.XMLStreamException {
+ if (namespace.equals("")) {
+ xmlWriter.writeAttribute(attName, attValue);
+ } else {
+ registerPrefix(xmlWriter, namespace);
+ xmlWriter.writeAttribute(namespace, attName, attValue);
+ }
+ }
+
+ /**
+ * Util method to write an attribute without the ns prefix
+ */
+ private void writeQNameAttribute(String namespace, String attName,
javax.xml.namespace.QName qname,
+ javax.xml.stream.XMLStreamWriter xmlWriter) throws
javax.xml.stream.XMLStreamException {
+
+ String attributeNamespace = qname.getNamespaceURI();
+ String attributePrefix = xmlWriter.getPrefix(attributeNamespace);
+ if (attributePrefix == null) {
+ attributePrefix = registerPrefix(xmlWriter, attributeNamespace);
+ }
+ String attributeValue;
+ if (attributePrefix.trim().length() > 0) {
+ attributeValue = attributePrefix + ":" + qname.getLocalPart();
+ } else {
+ attributeValue = qname.getLocalPart();
+ }
+
+ if (namespace.equals("")) {
+ xmlWriter.writeAttribute(attName, attributeValue);
+ } else {
+ registerPrefix(xmlWriter, namespace);
+ xmlWriter.writeAttribute(namespace, attName, attributeValue);
+ }
+ }
+
+ /**
+ * method to handle Qnames
+ */
+
+ private void writeQName(javax.xml.namespace.QName qname,
javax.xml.stream.XMLStreamWriter xmlWriter)
+ throws javax.xml.stream.XMLStreamException {
+ String namespaceURI = qname.getNamespaceURI();
+ if (namespaceURI != null) {
+ String prefix = xmlWriter.getPrefix(namespaceURI);
+ if (prefix == null) {
+ prefix = generatePrefix(namespaceURI);
+ xmlWriter.writeNamespace(prefix, namespaceURI);
+ xmlWriter.setPrefix(prefix, namespaceURI);
+ }
+
+ if (prefix.trim().length() > 0) {
+ xmlWriter.writeCharacters(prefix + ":"
+ +
org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname));
+ } else {
+ // i.e this is the default namespace
+
xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname));
+ }
+
+ } else {
+
xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname));
+ }
+ }
+
+ private void writeQNames(javax.xml.namespace.QName[] qnames,
javax.xml.stream.XMLStreamWriter xmlWriter)
+ throws javax.xml.stream.XMLStreamException {
+
+ if (qnames != null) {
+ // we have to store this data until last moment since it is not
+ // possible to write any
+ // namespace data after writing the charactor data
+ StringBuffer stringToWrite = new StringBuffer();
+ String namespaceURI = null;
+ String prefix = null;
+
+ for (int i = 0; i < qnames.length; i++) {
+ if (i > 0) {
+ stringToWrite.append(" ");
+ }
+ namespaceURI = qnames[i].getNamespaceURI();
+ if (namespaceURI != null) {
+ prefix = xmlWriter.getPrefix(namespaceURI);
+ if ((prefix == null) || (prefix.length() == 0)) {
+ prefix = generatePrefix(namespaceURI);
+ xmlWriter.writeNamespace(prefix, namespaceURI);
+ xmlWriter.setPrefix(prefix, namespaceURI);
+ }
+
+ if (prefix.trim().length() > 0) {
+ stringToWrite.append(prefix).append(":")
+
.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i]));
+ } else {
+
stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil
+ .convertToString(qnames[i]));
+ }
+ } else {
+
stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i]));
+ }
+ }
+ xmlWriter.writeCharacters(stringToWrite.toString());
+ }
+
+ }
+
+ /**
+ * Register a namespace prefix
+ */
+ private String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter,
String namespace)
+ throws javax.xml.stream.XMLStreamException {
+ String prefix = xmlWriter.getPrefix(namespace);
+
+ if (prefix == null) {
+ prefix = generatePrefix(namespace);
+
+ while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) !=
null) {
+ prefix =
org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix();
+ }
+
+ xmlWriter.writeNamespace(prefix, namespace);
+ xmlWriter.setPrefix(prefix, namespace);
+ }
+
+ return prefix;
+ }
+
+ /**
+ * databinding method to get an XML representation of this object
+ *
+ */
+ public javax.xml.stream.XMLStreamReader
getPullParser(javax.xml.namespace.QName qName)
+ throws org.apache.axis2.databinding.ADBException {
+
+ java.util.ArrayList elementList = new java.util.ArrayList();
+ java.util.ArrayList attribList = new java.util.ArrayList();
+
+ if (localNameTracker) {
+ elementList.add(new javax.xml.namespace.QName("", "name"));
+
+ elementList.add(localName == null ? null :
org.apache.axis2.databinding.utils.ConverterUtil
+ .convertToString(localName));
+ }
+ if (localValueTracker) {
+ elementList.add(new javax.xml.namespace.QName("", "value"));
+
+ elementList.add(localValue == null ? null :
org.apache.axis2.databinding.utils.ConverterUtil
+ .convertToString(localValue));
+ }
+
+ return new
org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName,
elementList.toArray(),
+ attribList.toArray());
+
+ }
+
+ /**
+ * Factory class that keeps the parse method
+ */
+ public static class Factory {
+
+ /**
+ * static method to create the object Precondition: If this object is
an element, the current or next start
+ * element starts this object and any intervening reader events are
ignorable If this object is not an element,
+ * it is a complex type and the reader is at the event just after the
outer start element Postcondition: If this
+ * object is an element, the reader is positioned at its end element
If this object is a complex type, the
+ * reader is positioned at the end element of its outer element
+ */
+ public static NameValue parse(javax.xml.stream.XMLStreamReader reader)
throws Exception {
+ NameValue object = new NameValue();
+
+ String nillableValue = null;
+ try {
+
+ while (!reader.isStartElement() && !reader.isEndElement())
+ reader.next();
+
+ if
(reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type")
!= null) {
+ String fullTypeName =
reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type");
+ if (fullTypeName != null) {
+ String nsPrefix = null;
+ if (fullTypeName.indexOf(":") > -1) {
+ nsPrefix = fullTypeName.substring(0,
fullTypeName.indexOf(":"));
+ }
+ nsPrefix = nsPrefix == null ? "" : nsPrefix;
+
+ String type =
fullTypeName.substring(fullTypeName.indexOf(":") + 1);
+
+ if (!"NameValue".equals(type)) {
+ // find namespace for the prefix
+ String nsUri =
reader.getNamespaceContext().getNamespaceURI(nsPrefix);
+ return (NameValue)
WorkflowInterpretorStub.ExtensionMapper.getTypeObject(nsUri, type,
+ reader);
+ }
+
+ }
+
+ }
+
+ new java.util.Vector();
+
+ reader.next();
+
+ while (!reader.isStartElement() && !reader.isEndElement())
+ reader.next();
+
+ if (reader.isStartElement() && new
javax.xml.namespace.QName("", "name").equals(reader.getName())) {
+
+ nillableValue =
reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil");
+ if (!"true".equals(nillableValue) &&
!"1".equals(nillableValue)) {
+
+ String content = reader.getElementText();
+
+
object.setName(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content));
+
+ } else {
+
+ reader.getElementText(); // throw away text nodes if
+ // any.
+ }
+
+ reader.next();
+
+ } // End of if for expected property start element
+
+ else {
+
+ }
+
+ while (!reader.isStartElement() && !reader.isEndElement())
+ reader.next();
+
+ if (reader.isStartElement() && new
javax.xml.namespace.QName("", "value").equals(reader.getName())) {
+
+ nillableValue =
reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil");
+ if (!"true".equals(nillableValue) &&
!"1".equals(nillableValue)) {
+
+ String content = reader.getElementText();
+
+
object.setValue(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content));
+
+ } else {
+
+ reader.getElementText(); // throw away text nodes if
+ // any.
+ }
+
+ reader.next();
+
+ } // End of if for expected property start element
+
+ else {
+
+ }
+
+ while (!reader.isStartElement() && !reader.isEndElement())
+ reader.next();
+
+ if (reader.isStartElement())
+ // A start element we are not expecting indicates a
+ // trailing invalid property
+ throw new
org.apache.axis2.databinding.ADBException("Unexpected subelement "
+ + reader.getLocalName());
+
+ } catch (javax.xml.stream.XMLStreamException e) {
+ throw new Exception(e);
+ }
+
+ return object;
+ }
+
+ }// end of factory class
+
+}
Propchange:
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/stub/interpretor/NameValue.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/stub/interpretor/WorkflowInterpretorCallbackHandler.java
URL:
http://svn.apache.org/viewvc/airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/stub/interpretor/WorkflowInterpretorCallbackHandler.java?rev=1411307&view=auto
==============================================================================
---
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/stub/interpretor/WorkflowInterpretorCallbackHandler.java
(added)
+++
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/stub/interpretor/WorkflowInterpretorCallbackHandler.java
Mon Nov 19 16:58:01 2012
@@ -0,0 +1,72 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.client.stub.interpretor;
+
+/**
+ * WorkflowInterpretorCallbackHandler Callback class, Users can extend this
class and implement their own receiveResult
+ * and receiveError methods.
+ */
+public abstract class WorkflowInterpretorCallbackHandler {
+
+ protected Object clientData;
+
+ /**
+ * User can pass in any object that needs to be accessed once the
NonBlocking Web service call is finished and
+ * appropriate method of this CallBack is called.
+ *
+ * @param clientData
+ * Object mechanism by which the user can pass in user data
that will be avilable at the time this
+ * callback is called.
+ */
+ public WorkflowInterpretorCallbackHandler(Object clientData) {
+ this.clientData = clientData;
+ }
+
+ /**
+ * Please use this constructor if you don't want to set any clientData
+ */
+ public WorkflowInterpretorCallbackHandler() {
+ this.clientData = null;
+ }
+
+ /**
+ * Get the client data
+ */
+
+ public Object getClientData() {
+ return clientData;
+ }
+
+ /**
+ * auto generated Axis2 call back method for launchWorkflow method
override this method for handling normal response
+ * from launchWorkflow operation
+ */
+ public void receiveResultlaunchWorkflow(java.lang.String result) {
+ }
+
+ /**
+ * auto generated Axis2 Error handler override this method for handling
error response from launchWorkflow operation
+ */
+ public void receiveErrorlaunchWorkflow(java.lang.Exception e) {
+ }
+
+}
Propchange:
airavata/trunk/modules/airavata-client/src/main/java/org/apache/airavata/client/stub/interpretor/WorkflowInterpretorCallbackHandler.java
------------------------------------------------------------------------------
svn:mime-type = text/plain