Author: lresende
Date: Tue Nov 13 12:51:44 2007
New Revision: 594637

URL: http://svn.apache.org/viewvc?rev=594637&view=rev
Log:
Overriding equals for BPEL Implementation and small cleanup

Modified:
    
incubator/tuscany/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/impl/BPELImplementationImpl.java

Modified: 
incubator/tuscany/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/impl/BPELImplementationImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/impl/BPELImplementationImpl.java?rev=594637&r1=594636&r2=594637&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/impl/BPELImplementationImpl.java
 (original)
+++ 
incubator/tuscany/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/impl/BPELImplementationImpl.java
 Tue Nov 13 12:51:44 2007
@@ -18,30 +18,18 @@
  */
 package org.apache.tuscany.sca.implementation.bpel.impl;
 
-import java.io.File;
-import java.io.InputStream;
-import java.net.URI;
 import java.util.Collections;
-import java.util.Date;
 import java.util.List;
-import java.util.Map;
 
-import javax.wsdl.Definition;
 import javax.xml.namespace.QName;
 
-import org.apache.ode.bpel.evt.BpelEvent;
-import org.apache.ode.bpel.iapi.Endpoint;
-import org.apache.ode.bpel.iapi.ProcessConf;
-import org.apache.ode.bpel.iapi.ProcessState;
 import org.apache.tuscany.sca.assembly.AssemblyFactory;
 import org.apache.tuscany.sca.assembly.ConstrainingType;
 import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.assembly.Reference;
 import org.apache.tuscany.sca.assembly.impl.ComponentTypeImpl;
 import org.apache.tuscany.sca.implementation.bpel.BPELImplementation;
 import org.apache.tuscany.sca.implementation.bpel.BPELProcessDefinition;
 import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory;
-import org.w3c.dom.Node;
 
 /**
  * The model representing a BPEL implementation in an SCA assembly model.
@@ -53,8 +41,6 @@
     private QName _processName;
     private BPELProcessDefinition _processDefinition;
 
-    private boolean unresolved;
-
     /**
      * Constructs a new BPEL implementation.
      */
@@ -101,87 +87,24 @@
         // The sample BPEL implementation does not support properties
         return Collections.emptyList();
     }
-
-    public boolean isUnresolved() {
-        return this.unresolved;
-    }
-
-    public void setUnresolved(boolean unresolved) {
-        this.unresolved = unresolved;
+    
+    @Override
+    public int hashCode() {
+        return String.valueOf(this.getProcess()).hashCode();
     }
 
-    private class ProcessConfImpl implements ProcessConf {
-        public QName getProcessId() {
-            return _processName;
-        }
-
-        public QName getType() {
-            return _processName;
-        }
-
-        public long getVersion() {
-            // TODO Versioniong?
-            return 0;
-        }
-
-        public boolean isTransient() {
-            return false;
-        }
-
-        public InputStream getCBPInputStream() {
-            return null; //new ByteArrayInputStream(_compiledProcess);
-        }
-
-        public String getBpelDocument() {
-            return null;
-        }
-
-        public URI getBaseURI() {
-            return null;
-        }
-
-        public Date getDeployDate() {
-            return null;
-        }
-
-        public String getDeployer() {
-            return null;
-        }
-
-        public ProcessState getState() {
-            return null;
-        }
-
-        public List<File> getFiles() {
-            return null;
-        }
-
-        public Map<QName, Node> getProperties() {
-            return null;
-        }
-
-        public String getPackage() {
-            return null;
-        }
-
-        public Definition getDefinitionForService(QName qName) {
-            return null;
-        }
-
-        public Definition getDefinitionForPortType(QName qName) {
-            return null;
-        }
-
-        public Map<String, Endpoint> getProvideEndpoints() {
-            return null;
-        }
-
-        public Map<String, Endpoint> getInvokeEndpoints() {
-            return null;
-        }
-
-        public boolean isEventEnabled(List<String> strings, BpelEvent.TYPE 
type) {
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == this) {
             return true;
+        } else if (obj instanceof BPELImplementation) {
+            if (getProcess() != null) {
+                return 
getProcess().equals(((BPELImplementation)obj).getProcess());
+            } else {
+                return ((BPELImplementation)obj).getProcess() == null;
+            }
+        } else {
+            return false;
         }
     }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to