summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-09-05 07:25:39 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-09-05 07:25:39 +0000
commit2e5148cda5fd31d2fae0064c96ff46ebb9db267d (patch)
treec8c16b1b31e2b498536bda3379ada04464065703
parent8326a5461595122c55b93e1f9bf7716d285409a6 (diff)
Get the binding archetype working
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@992717 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--sca-java-2.x/trunk/archetypes/binding/src/main/resources/META-INF/maven/archetype-metadata.xml8
-rw-r--r--sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/META-INF/MANIFEST.MF6
-rw-r--r--sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/pom.xml47
-rw-r--r--sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/__bindingName__Binding.java74
-rw-r--r--sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/__bindingName__BindingFactory.java10
-rw-r--r--sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__BindingProviderFactory.java28
-rw-r--r--sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__ReferenceBindingProvider.java18
-rw-r--r--sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__ReferenceInvoker.java16
-rw-r--r--sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__ServiceBindingProvider.java20
-rw-r--r--sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__ServiceInvoker.java10
-rw-r--r--sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__Stash.java12
-rw-r--r--sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/META-INF/services/__package__.__bindingName__BindingFactory38
-rw-r--r--sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor2
-rw-r--r--sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema2
-rw-r--r--sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory2
-rw-r--r--sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/binding-__artifactId__.xsd (renamed from sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/binding-__bindingName__.xsd)13
-rw-r--r--sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/test/java/test/FooBindingTestCase.java6
-rw-r--r--sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/test/resources/helloworld.composite4
18 files changed, 131 insertions, 185 deletions
diff --git a/sca-java-2.x/trunk/archetypes/binding/src/main/resources/META-INF/maven/archetype-metadata.xml b/sca-java-2.x/trunk/archetypes/binding/src/main/resources/META-INF/maven/archetype-metadata.xml
index 94f44feb00..403803551b 100644
--- a/sca-java-2.x/trunk/archetypes/binding/src/main/resources/META-INF/maven/archetype-metadata.xml
+++ b/sca-java-2.x/trunk/archetypes/binding/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -33,25 +33,25 @@
<include>**/*.java</include>
</includes>
</fileSet>
- <fileSet filtered="true" packaged="true" encoding="UTF-8">
+ <fileSet filtered="true" encoding="UTF-8">
<directory>src/main/resources</directory>
<includes>
<include>**/*.*</include>
</includes>
</fileSet>
- <fileSet filtered="true" packaged="true" encoding="UTF-8">
+ <fileSet filtered="true" encoding="UTF-8">
<directory>src/test/java</directory>
<includes>
<include>**/*.java</include>
</includes>
</fileSet>
- <fileSet filtered="true" packaged="true" encoding="UTF-8">
+ <fileSet filtered="true" encoding="UTF-8">
<directory>src/test/resources</directory>
<includes>
<include>**/*.*</include>
</includes>
</fileSet>
- <fileSet filtered="true" packaged="true" encoding="UTF-8">
+ <fileSet filtered="true" encoding="UTF-8">
<directory>META-INF</directory>
<includes>
<include>MANIFEST.MF</include>
diff --git a/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/META-INF/MANIFEST.MF b/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/META-INF/MANIFEST.MF
index f895a144e6..2985b8c822 100644
--- a/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/META-INF/MANIFEST.MF
+++ b/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/META-INF/MANIFEST.MF
@@ -1,17 +1,17 @@
Manifest-Version: 1.0
SCA-Version: 1.1
-Bundle-Name: Apache Tuscany SCA Foo Binding
+Bundle-Name: Apache Tuscany SCA ${bindingName} Binding
Bundle-Vendor: The Apache Software Foundation
Bundle-Version: 2.0.0
Bundle-ManifestVersion: 2
Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-Description: Apache Tuscany SCA Foo Binding
+Bundle-Description: Apache Tuscany SCA ${bindingName} Binding
Import-Package: org.apache.tuscany.sca.assembly;version="2.0.0",
org.apache.tuscany.sca.core;version="2.0.0",
org.apache.tuscany.sca.interfacedef;version="2.0.0",
org.apache.tuscany.sca.invocation;version="2.0.0",
org.apache.tuscany.sca.provider;version="2.0.0",
org.apache.tuscany.sca.runtime;version="2.0.0"
-Bundle-SymbolicName: org.apache.tuscany.sca.binding.foo
+Bundle-SymbolicName: org.apache.tuscany.sca.binding.${artifactId}
Bundle-DocURL: http://www.apache.org/
Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6
diff --git a/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/pom.xml b/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/pom.xml
index e2c8982762..e038506cbd 100644
--- a/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/pom.xml
+++ b/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/pom.xml
@@ -1,22 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * 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.
---><project>
+<!--
+ * 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.
+-->
+<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.tuscany.sca</groupId>
@@ -24,9 +25,11 @@
<version>2.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
- <artifactId>${artifactId}</artifactId>
+
+ <artifactId>binding-${artifactId}</artifactId>
<groupId>${groupId}</groupId>
- <name>Apache Tuscany SCA Foo Binding Runtime</name>
+ <version>${version}</version>
+ <name>Apache Tuscany SCA ${bindingName} Binding Extension</name>
<dependencies>
@@ -34,12 +37,14 @@
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-assembly-xml</artifactId>
<version>2.0-SNAPSHOT</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-host-http</artifactId>
<version>2.0-SNAPSHOT</version>
+ <scope>provided</scope>
</dependency>
<dependency>
@@ -78,6 +83,4 @@
</dependency>
</dependencies>
- <version>${version}</version>
-
</project>
diff --git a/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/__bindingName__Binding.java b/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/__bindingName__Binding.java
index ea177ea446..d9cbdb954d 100644
--- a/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/__bindingName__Binding.java
+++ b/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/__bindingName__Binding.java
@@ -19,84 +19,34 @@
* specific language governing permissions and limitations
* under the License.
*/
-package ${package}.binding.foo;
+package ${package};
import javax.xml.namespace.QName;
-import ${package}.assembly.Binding;
-import ${package}.assembly.OperationSelector;
-import ${package}.assembly.WireFormat;
+import org.apache.tuscany.sca.provider.BaseBindingImpl;
/**
- * Represents a binding to an Foo service.
+ * Represents a binding to a ${bindingName} service.
*/
-public class FooBinding implements Binding {
+public class ${bindingName}Binding extends BaseBindingImpl {
- QName TYPE = new QName(SCA11_TUSCANY_NS, "binding.foo");
+ public static final QName TYPE = new QName(SCA11_TUSCANY_NS, "binding.${artifactId}");
- private String name;
- private String uri;
- private String bindingType;
+ private String someAttr;
- public String getBindingType() {
- return bindingType;
- }
-
- public void setBindingType(String bindingType) {
- this.bindingType = bindingType;
- }
-
- public String getName() {
- return name;
- }
-
- public String getURI() {
- return uri;
- }
-
- public void setURI(String uri) {
- this.uri = uri;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- @Override
- public Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
-
- public boolean isUnresolved() {
- return false;
- }
-
- public void setUnresolved(boolean arg0) {
+ public ${bindingName}Binding() {
}
public QName getType() {
return TYPE;
}
- public WireFormat getRequestWireFormat() {
- return null;
- }
-
- public void setRequestWireFormat(WireFormat wireFormat) {
- }
-
- public WireFormat getResponseWireFormat() {
- return null;
- }
-
- public void setResponseWireFormat(WireFormat wireFormat) {
+ public String getSomeAttr() {
+ return someAttr;
}
-
- public OperationSelector getOperationSelector() {
- return null;
+
+ public void setSomeAttr(String someAttr) {
+ this.someAttr = someAttr;
}
-
- public void setOperationSelector(OperationSelector operationSelector) {
- }
}
diff --git a/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/__bindingName__BindingFactory.java b/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/__bindingName__BindingFactory.java
index 933d208588..ae1cd88745 100644
--- a/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/__bindingName__BindingFactory.java
+++ b/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/__bindingName__BindingFactory.java
@@ -20,16 +20,16 @@
* under the License.
*/
-package ${package}.binding.foo;
+package ${package};
/**
- * Factory implementation to create Foo Models
+ * Factory implementation to create ${bindingName} Models
*/
-public class FooBindingFactory {
+public class ${bindingName}BindingFactory {
- public FooBinding createFooBinding() {
- return new FooBinding();
+ public ${bindingName}Binding create${bindingName}Binding() {
+ return new ${bindingName}Binding();
}
}
diff --git a/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__BindingProviderFactory.java b/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__BindingProviderFactory.java
index ec9e358b4d..93c6bf3c04 100644
--- a/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__BindingProviderFactory.java
+++ b/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__BindingProviderFactory.java
@@ -20,31 +20,31 @@
* under the License.
*/
-package ${package}.binding.foo.runtime;
+package ${package}.runtime;
-import ${package}.binding.foo.FooBinding;
-import ${package}.core.ExtensionPointRegistry;
-import ${package}.provider.BindingProviderFactory;
-import ${package}.provider.ReferenceBindingProvider;
-import ${package}.provider.ServiceBindingProvider;
-import ${package}.runtime.RuntimeEndpoint;
-import ${package}.runtime.RuntimeEndpointReference;
+import ${package}.${bindingName}Binding;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.provider.BindingProviderFactory;
+import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
+import org.apache.tuscany.sca.provider.ServiceBindingProvider;
+import org.apache.tuscany.sca.runtime.RuntimeEndpoint;
+import org.apache.tuscany.sca.runtime.RuntimeEndpointReference;
-public class FooBindingProviderFactory implements BindingProviderFactory<FooBinding> {
+public class ${bindingName}BindingProviderFactory implements BindingProviderFactory<${bindingName}Binding> {
- public FooBindingProviderFactory(ExtensionPointRegistry extensionPoints) {
+ public ${bindingName}BindingProviderFactory(ExtensionPointRegistry extensionPoints) {
}
- public Class<FooBinding> getModelType() {
- return FooBinding.class;
+ public Class<${bindingName}Binding> getModelType() {
+ return ${bindingName}Binding.class;
}
public ReferenceBindingProvider createReferenceBindingProvider(RuntimeEndpointReference endpoint) {
- return new FooReferenceBindingProvider(endpoint);
+ return new ${bindingName}ReferenceBindingProvider(endpoint);
}
public ServiceBindingProvider createServiceBindingProvider(RuntimeEndpoint endpoint) {
- return new FooServiceBindingProvider(endpoint);
+ return new ${bindingName}ServiceBindingProvider(endpoint);
}
}
diff --git a/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__ReferenceBindingProvider.java b/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__ReferenceBindingProvider.java
index 9615501203..dc2991014e 100644
--- a/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__ReferenceBindingProvider.java
+++ b/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__ReferenceBindingProvider.java
@@ -20,25 +20,25 @@
* under the License.
*/
-package ${package}.binding.foo.runtime;
+package ${package}.runtime;
-import ${package}.assembly.EndpointReference;
-import ${package}.interfacedef.InterfaceContract;
-import ${package}.interfacedef.Operation;
-import ${package}.invocation.Invoker;
-import ${package}.provider.ReferenceBindingProvider;
+import org.apache.tuscany.sca.assembly.EndpointReference;
+import org.apache.tuscany.sca.interfacedef.InterfaceContract;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.invocation.Invoker;
+import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
-public class FooReferenceBindingProvider implements ReferenceBindingProvider {
+public class ${bindingName}ReferenceBindingProvider implements ReferenceBindingProvider {
private EndpointReference endpoint;
private InterfaceContract contract;
- public FooReferenceBindingProvider(EndpointReference endpoint) {
+ public ${bindingName}ReferenceBindingProvider(EndpointReference endpoint) {
this.endpoint = endpoint;
}
public Invoker createInvoker(Operation operation) {
- return new FooReferenceInvoker(operation, endpoint);
+ return new ${bindingName}ReferenceInvoker(operation, endpoint);
}
public void start() {
diff --git a/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__ReferenceInvoker.java b/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__ReferenceInvoker.java
index 8f8eabb5f6..70def6e33b 100644
--- a/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__ReferenceInvoker.java
+++ b/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__ReferenceInvoker.java
@@ -20,19 +20,19 @@
* under the License.
*/
-package ${package}.binding.foo.runtime;
+package ${package}.runtime;
-import ${package}.assembly.EndpointReference;
-import ${package}.interfacedef.Operation;
-import ${package}.invocation.Invoker;
-import ${package}.invocation.Message;
+import org.apache.tuscany.sca.assembly.EndpointReference;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.invocation.Invoker;
+import org.apache.tuscany.sca.invocation.Message;
-public class FooReferenceInvoker implements Invoker {
+public class ${bindingName}ReferenceInvoker implements Invoker {
protected Operation operation;
protected EndpointReference endpoint;
- public FooReferenceInvoker(Operation operation, EndpointReference endpoint) {
+ public ${bindingName}ReferenceInvoker(Operation operation, EndpointReference endpoint) {
this.operation = operation;
this.endpoint = endpoint;
}
@@ -50,7 +50,7 @@ public class FooReferenceInvoker implements Invoker {
public Message doInvoke(Message msg) {
// Add some code here to make an invocation over the foo binding protocol
// For this sample we'll just get it from the static stash
- FooServiceInvoker fi = FooStash.getService(endpoint.getBinding().getURI());
+ ${bindingName}ServiceInvoker fi = ${bindingName}Stash.getService(endpoint.getBinding().getURI());
return fi.invokeService(msg);
}
}
diff --git a/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__ServiceBindingProvider.java b/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__ServiceBindingProvider.java
index b33591e44d..59d41091d8 100644
--- a/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__ServiceBindingProvider.java
+++ b/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__ServiceBindingProvider.java
@@ -20,19 +20,19 @@
* under the License.
*/
-package ${package}.binding.foo.runtime;
+package ${package}.runtime;
-import ${package}.binding.foo.FooBinding;
-import ${package}.interfacedef.InterfaceContract;
-import ${package}.provider.ServiceBindingProvider;
-import ${package}.runtime.RuntimeEndpoint;
+import ${package}.${bindingName}Binding;
+import org.apache.tuscany.sca.interfacedef.InterfaceContract;
+import org.apache.tuscany.sca.provider.ServiceBindingProvider;
+import org.apache.tuscany.sca.runtime.RuntimeEndpoint;
-public class FooServiceBindingProvider implements ServiceBindingProvider {
+public class ${bindingName}ServiceBindingProvider implements ServiceBindingProvider {
private RuntimeEndpoint endpoint;
private InterfaceContract contract;
- public FooServiceBindingProvider(RuntimeEndpoint endpoint) {
+ public ${bindingName}ServiceBindingProvider(RuntimeEndpoint endpoint) {
this.endpoint = endpoint;
}
@@ -40,13 +40,13 @@ public class FooServiceBindingProvider implements ServiceBindingProvider {
// add some code here to start the service
// For this sample we'll just share it in a static
- FooStash.addService(endpoint.getBinding().getURI(), new FooServiceInvoker(endpoint));
+ ${bindingName}Stash.addService(endpoint.getBinding().getURI(), new ${bindingName}ServiceInvoker(endpoint));
- System.out.println("bindingType=" + ((FooBinding)endpoint.getBinding()).getBindingType());
+ System.out.println("someAttr=" + ((${bindingName}Binding)endpoint.getBinding()).getSomeAttr());
}
public void stop() {
- FooStash.removeService(endpoint.getBinding().getURI());
+ ${bindingName}Stash.removeService(endpoint.getBinding().getURI());
}
public InterfaceContract getBindingInterfaceContract() {
diff --git a/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__ServiceInvoker.java b/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__ServiceInvoker.java
index bbadb9b6b0..8ea20d41ed 100644
--- a/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__ServiceInvoker.java
+++ b/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__ServiceInvoker.java
@@ -20,16 +20,16 @@
* under the License.
*/
-package ${package}.binding.foo.runtime;
+package ${package}.runtime;
-import ${package}.invocation.Message;
-import ${package}.runtime.RuntimeEndpoint;
+import org.apache.tuscany.sca.invocation.Message;
+import org.apache.tuscany.sca.runtime.RuntimeEndpoint;
-public class FooServiceInvoker {
+public class ${bindingName}ServiceInvoker {
private RuntimeEndpoint wire;
- public FooServiceInvoker(RuntimeEndpoint wire) {
+ public ${bindingName}ServiceInvoker(RuntimeEndpoint wire) {
this.wire = wire;
}
diff --git a/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__Stash.java b/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__Stash.java
index 7271c08a83..416a10e7b1 100644
--- a/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__Stash.java
+++ b/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/java/runtime/__bindingName__Stash.java
@@ -20,7 +20,7 @@
* under the License.
*/
-package ${package}.binding.foo.runtime;
+package ${package}.runtime;
import java.util.HashMap;
import java.util.Map;
@@ -28,15 +28,15 @@ import java.util.Map;
/**
* Simplistic static Map to share service endpoints with references
*/
-public class FooStash {
+public class ${bindingName}Stash {
- private static Map<String, FooServiceInvoker> services = new HashMap<String, FooServiceInvoker>();
+ private static Map<String, ${bindingName}ServiceInvoker> services = new HashMap<String, ${bindingName}ServiceInvoker>();
- public static void addService(String uri, FooServiceInvoker fooServiceInvoker) {
- services.put(uri, fooServiceInvoker);
+ public static void addService(String uri, ${bindingName}ServiceInvoker ${bindingName}ServiceInvoker) {
+ services.put(uri, ${bindingName}ServiceInvoker);
}
- public static FooServiceInvoker getService(String uri) {
+ public static ${bindingName}ServiceInvoker getService(String uri) {
return services.get(uri);
}
diff --git a/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/META-INF/services/__package__.__bindingName__BindingFactory b/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/META-INF/services/__package__.__bindingName__BindingFactory
index 5de0163ece..3759b19fa0 100644
--- a/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/META-INF/services/__package__.__bindingName__BindingFactory
+++ b/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/META-INF/services/__package__.__bindingName__BindingFactory
@@ -1,20 +1,20 @@
-# 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.
-
-# Implementation class for model factory
-org.apache.tuscany.sca.binding.foo.FooBindingFactory
+# 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.
+
+# Implementation class for model factory
+${package}.${bindingName}BindingFactory
diff --git a/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
index 94b3a7e68a..eb49133022 100644
--- a/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
+++ b/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
@@ -16,5 +16,5 @@
# under the License.
# Implementation class for the artifact processor extension
-org.apache.tuscany.sca.assembly.xml.DefaultBeanModelProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#binding.foo,model=${package}.${bindingName}Binding,factory={package}.${bindingName}BindingFactory
+org.apache.tuscany.sca.assembly.xml.DefaultBeanModelProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#binding.${artifactId},model=${package}.${bindingName}Binding,factory=${package}.${bindingName}BindingFactory
diff --git a/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema b/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema
index 2e1b0e53d7..c33264f2a4 100644
--- a/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema
+++ b/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema
@@ -15,5 +15,5 @@
# specific language governing permissions and limitations
# under the License.
#
-binding-${bindingName}.xsd
+binding-${artifactId}.xsd
diff --git a/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory b/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
index 4e0ecf48e9..3c0cfbc6d9 100644
--- a/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
+++ b/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory
@@ -16,5 +16,5 @@
# under the License.
# Implementation class for the binding extension
-{package}.runtime.${bindingName}BindingProviderFactory;model={package}.${bindingName}Binding
+${package}.runtime.${bindingName}BindingProviderFactory;model=${package}.${bindingName}Binding
diff --git a/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/binding-__bindingName__.xsd b/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/binding-__artifactId__.xsd
index 9322aabd6d..74f853e424 100644
--- a/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/binding-__bindingName__.xsd
+++ b/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/main/resources/binding-__artifactId__.xsd
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+#set( $bindingNameLC = ${bindingName} )<?xml version="1.0" encoding="UTF-8"?>
<!--
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -25,17 +25,12 @@
<import namespace="http://docs.oasis-open.org/ns/opencsa/sca/200912" />
- <element name="binding.foo" type="t:FooBinding" substitutionGroup="sca:binding"/>
+ <element name="binding.${artifactId}" type="t:${bindingName}Binding" substitutionGroup="sca:binding"/>
- <complexType name="FooBinding">
+ <complexType name="${bindingName}Binding">
<complexContent>
<extension base="sca:Binding">
- <!-- sequence>
- <any namespace="##targetNamespace" processContents="lax" minOccurs="0"
- maxOccurs="unbounded"/>
- </sequence -->
- <!-- anyAttribute namespace="##other" processContents="lax"/-->
- <attribute name="bindingType" type="string" use="optional"/>
+ <attribute name="someAttr" type="string" use="optional"/>
</extension>
</complexContent>
</complexType>
diff --git a/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/test/java/test/FooBindingTestCase.java b/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/test/java/test/FooBindingTestCase.java
index e9c92648e4..339eaa76ef 100644
--- a/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/test/java/test/FooBindingTestCase.java
+++ b/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/test/java/test/FooBindingTestCase.java
@@ -24,9 +24,8 @@ package test;
import helloworld.HelloWorldService;
import junit.framework.Assert;
-import ${package}.http.jetty.JettyServer;
-import ${package}.node.Node;
-import ${package}.node.NodeFactory;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -43,7 +42,6 @@ public class FooBindingTestCase {
@BeforeClass
public static void init() throws Exception {
- JettyServer.portDefault = 8085;
node = NodeFactory.newInstance().createNode("helloworld.composite").start();
}
diff --git a/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/test/resources/helloworld.composite b/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/test/resources/helloworld.composite
index 4dc3150697..f0e6150c10 100644
--- a/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/test/resources/helloworld.composite
+++ b/sca-java-2.x/trunk/archetypes/binding/src/main/resources/archetype-resources/src/test/resources/helloworld.composite
@@ -25,14 +25,14 @@
<component name="HelloWorldComponent">
<implementation.java class="helloworld.HelloWorldImpl"/>
<service name="HelloWorldService" >
- <tuscany:binding.${bindingName} bindingType="ws" />
+ <tuscany:binding.${artifactId} someAttr="bla" />
</service>
</component>
<component name="HelloWorldClient">
<implementation.java class="helloworld.HelloWorldClient"/>
<reference name="ref" >
- <tuscany:binding.${bindingName} uri="HelloWorldComponent/HelloWorldService"/>
+ <tuscany:binding.${artifactId} uri="HelloWorldComponent/HelloWorldService"/>
</reference>
</component>