diff options
Diffstat (limited to 'sca-java-2.x/trunk/modules/implementation-script/src')
3 files changed, 36 insertions, 17 deletions
diff --git a/sca-java-2.x/trunk/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/ScriptImplementation.java b/sca-java-2.x/trunk/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/ScriptImplementation.java index 543f852ef2..d34dde61eb 100644 --- a/sca-java-2.x/trunk/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/ScriptImplementation.java +++ b/sca-java-2.x/trunk/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/ScriptImplementation.java @@ -43,8 +43,4 @@ public interface ScriptImplementation extends Implementation { String getLanguage(); - String getURI(); - - void setURI(String uri); - } diff --git a/sca-java-2.x/trunk/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/impl/ScriptImplementationImpl.java b/sca-java-2.x/trunk/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/impl/ScriptImplementationImpl.java index 10821db972..a610e77147 100644 --- a/sca-java-2.x/trunk/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/impl/ScriptImplementationImpl.java +++ b/sca-java-2.x/trunk/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/impl/ScriptImplementationImpl.java @@ -32,20 +32,20 @@ import org.apache.tuscany.sca.implementation.script.ScriptImplementation; public class ScriptImplementationImpl extends ImplementationImpl implements ScriptImplementation { public static final QName TYPE = new QName(Base.SCA11_TUSCANY_NS, "implementation.script"); - private String uri; - private String language; - private String location; + private String script; // Relative URI to the script + private String language; // Scripting lang + private String location; // Resolved location of the script public ScriptImplementationImpl() { super(TYPE); } public String getScript() { - return uri; + return script; } - public void setScript(String uri) { - this.uri = uri; + public void setScript(String script) { + this.script = script; } public String getLocation() { @@ -64,16 +64,39 @@ public class ScriptImplementationImpl extends ImplementationImpl implements Scri return language; } - public String getURI() { - return uri; + @Override + public String toString() { + return "Script : " + getScript(); } - public void setURI(String uri) { - this.uri = uri; + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((language == null) ? 0 : language.hashCode()); + result = prime * result + ((script == null) ? 0 : script.hashCode()); + return result; } @Override - public String toString() { - return "Script : " + getURI(); + public boolean equals(Object obj) { + if (this == obj) + return true; + if (!super.equals(obj)) + return false; + if (getClass() != obj.getClass()) + return false; + ScriptImplementationImpl other = (ScriptImplementationImpl)obj; + if (language == null) { + if (other.language != null) + return false; + } else if (!language.equals(other.language)) + return false; + if (script == null) { + if (other.script != null) + return false; + } else if (!script.equals(other.script)) + return false; + return true; } } diff --git a/sca-java-2.x/trunk/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/xml/ScriptImplementationProcessor.java b/sca-java-2.x/trunk/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/xml/ScriptImplementationProcessor.java index 18d3bfa4aa..273306894b 100644 --- a/sca-java-2.x/trunk/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/xml/ScriptImplementationProcessor.java +++ b/sca-java-2.x/trunk/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/xml/ScriptImplementationProcessor.java @@ -159,7 +159,7 @@ public class ScriptImplementationProcessor implements StAXArtifactProcessor<Scri */ private void error(Monitor monitor, String message, Object model, Object... messageParameters) { if (monitor != null) { - Problem problem = monitor.createProblem(this.getClass().getName(), "impl-widget-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters); + Problem problem = monitor.createProblem(this.getClass().getName(), "impl-script-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters); monitor.problem(problem); } } |