You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by lr...@apache.org on 2007/04/12 09:24:56 UTC
svn commit: r527812 - in
/incubator/tuscany/java/sca/samples/echo-binding/src: main/java/org/
main/java/org/apache/ main/java/org/apache/tuscany/
main/java/org/apache/tuscany/binding/
main/java/org/apache/tuscany/binding/echo/ main/resources/META-INF/s...
Author: lresende
Date: Thu Apr 12 00:24:54 2007
New Revision: 527812
URL: http://svn.apache.org/viewvc?view=rev&rev=527812
Log:
[Work in progress] Bringing echo-binding to latest apis
Added:
incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/
incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/
incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/
incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/
incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/
incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/DefaultEchoBindingFactory.java (with props)
incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoBinding.java (with props)
incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoBindingFactory.java (with props)
incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoBindingImpl.java (with props)
incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoBindingLoader.java (with props)
incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoBuilder.java
- copied, changed from r527571, incubator/tuscany/java/sca/samples/echo-binding/src/main/java/echo/EchoBuilder.java
incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoConstants.java (with props)
incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoInvoker.java
- copied, changed from r527571, incubator/tuscany/java/sca/samples/echo-binding/src/main/java/echo/EchoInvoker.java
incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoModuleActivator.java (with props)
incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoReference.java
- copied, changed from r527571, incubator/tuscany/java/sca/samples/echo-binding/src/main/java/echo/EchoReference.java
incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoService.java
- copied, changed from r527571, incubator/tuscany/java/sca/samples/echo-binding/src/main/java/echo/EchoService.java
incubator/tuscany/java/sca/samples/echo-binding/src/main/resources/META-INF/services/
incubator/tuscany/java/sca/samples/echo-binding/src/main/resources/META-INF/services/org.apache.tuscany.spi.bootstrap.ModuleActivator
incubator/tuscany/java/sca/samples/echo-binding/src/test/java/org/
incubator/tuscany/java/sca/samples/echo-binding/src/test/java/org/apache/
incubator/tuscany/java/sca/samples/echo-binding/src/test/java/org/apache/tuscany/
incubator/tuscany/java/sca/samples/echo-binding/src/test/java/org/apache/tuscany/binding/
incubator/tuscany/java/sca/samples/echo-binding/src/test/java/org/apache/tuscany/binding/echo/
incubator/tuscany/java/sca/samples/echo-binding/src/test/java/org/apache/tuscany/binding/echo/Client.java
- copied, changed from r527571, incubator/tuscany/java/sca/samples/echo-binding/src/test/java/echo/Client.java
incubator/tuscany/java/sca/samples/echo-binding/src/test/java/org/apache/tuscany/binding/echo/ClientImpl.java
- copied, changed from r527571, incubator/tuscany/java/sca/samples/echo-binding/src/test/java/echo/ClientImpl.java
incubator/tuscany/java/sca/samples/echo-binding/src/test/java/org/apache/tuscany/binding/echo/Echo.java
- copied, changed from r527571, incubator/tuscany/java/sca/samples/echo-binding/src/test/java/echo/Echo.java
incubator/tuscany/java/sca/samples/echo-binding/src/test/java/org/apache/tuscany/binding/echo/EchoBindingTestCase.java
- copied, changed from r527571, incubator/tuscany/java/sca/samples/echo-binding/src/test/java/echo/EchoBindingTestCase.java
Removed:
incubator/tuscany/java/sca/samples/echo-binding/src/test/java/echo/Client.java
incubator/tuscany/java/sca/samples/echo-binding/src/test/java/echo/ClientImpl.java
incubator/tuscany/java/sca/samples/echo-binding/src/test/java/echo/Echo.java
incubator/tuscany/java/sca/samples/echo-binding/src/test/java/echo/EchoBindingTestCase.java
Modified:
incubator/tuscany/java/sca/samples/echo-binding/src/test/resources/EchoBinding.composite
Added: incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/DefaultEchoBindingFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/DefaultEchoBindingFactory.java?view=auto&rev=527812
==============================================================================
--- incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/DefaultEchoBindingFactory.java (added)
+++ incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/DefaultEchoBindingFactory.java Thu Apr 12 00:24:54 2007
@@ -0,0 +1,28 @@
+/*
+ * 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.tuscany.binding.echo;
+
+public class DefaultEchoBindingFactory implements EchoBindingFactory {
+
+ public EchoBinding createEchoBinding() {
+ return new EchoBindingImpl();
+ }
+
+}
Propchange: incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/DefaultEchoBindingFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoBinding.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoBinding.java?view=auto&rev=527812
==============================================================================
--- incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoBinding.java (added)
+++ incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoBinding.java Thu Apr 12 00:24:54 2007
@@ -0,0 +1,26 @@
+/*
+ * 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.tuscany.binding.echo;
+
+import org.apache.tuscany.assembly.Binding;
+
+public interface EchoBinding extends Binding {
+
+}
Propchange: incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoBinding.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoBindingFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoBindingFactory.java?view=auto&rev=527812
==============================================================================
--- incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoBindingFactory.java (added)
+++ incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoBindingFactory.java Thu Apr 12 00:24:54 2007
@@ -0,0 +1,29 @@
+/*
+ * 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.tuscany.binding.echo;
+
+public interface EchoBindingFactory {
+ /**
+ * Creates a new Echo binding.
+ *
+ * @return a new Echi binding
+ */
+ EchoBinding createEchoBinding();
+}
Propchange: incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoBindingFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoBindingImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoBindingImpl.java?view=auto&rev=527812
==============================================================================
--- incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoBindingImpl.java (added)
+++ incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoBindingImpl.java Thu Apr 12 00:24:54 2007
@@ -0,0 +1,28 @@
+/*
+ * 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.tuscany.binding.echo;
+
+import org.apache.tuscany.assembly.impl.BindingImpl;
+
+public class EchoBindingImpl extends BindingImpl implements EchoBinding {
+ public Object clone() {
+ return this;
+ }
+}
Propchange: incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoBindingImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoBindingLoader.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoBindingLoader.java?view=auto&rev=527812
==============================================================================
--- incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoBindingLoader.java (added)
+++ incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoBindingLoader.java Thu Apr 12 00:24:54 2007
@@ -0,0 +1,68 @@
+/*
+ * 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.tuscany.binding.echo;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.tuscany.services.spi.contribution.ArtifactResolver;
+import org.apache.tuscany.services.spi.contribution.ContributionReadException;
+import org.apache.tuscany.services.spi.contribution.ContributionResolveException;
+import org.apache.tuscany.services.spi.contribution.ContributionWireException;
+import org.apache.tuscany.services.spi.contribution.ContributionWriteException;
+import org.apache.tuscany.services.spi.contribution.StAXArtifactProcessor;
+
+public class EchoBindingLoader implements StAXArtifactProcessor {
+ private final EchoBindingFactory factory;
+
+ public EchoBindingLoader(){
+ this.factory = new DefaultEchoBindingFactory();
+ }
+
+ public EchoBindingLoader(EchoBindingFactory factory){
+ this.factory = factory;
+ }
+
+ public QName getArtifactType() {
+ return EchoConstants.BINDING_ECHO;
+ }
+
+ public Class getModelType() {
+ return EchoBinding.class;
+ }
+
+ public Object read(XMLStreamReader arg0) throws ContributionReadException {
+ return factory.createEchoBinding();
+ }
+
+ public void write(Object arg0, XMLStreamWriter arg1) throws ContributionWriteException {
+ // TODO Auto-generated method stub
+ }
+
+ public void resolve(Object arg0, ArtifactResolver arg1) throws ContributionResolveException {
+ // TODO Auto-generated method stub
+ }
+
+ public void wire(Object arg0) throws ContributionWireException {
+ // TODO Auto-generated method stub
+ }
+
+}
Propchange: incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoBindingLoader.java
------------------------------------------------------------------------------
svn:eol-style = native
Copied: incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoBuilder.java (from r527571, incubator/tuscany/java/sca/samples/echo-binding/src/main/java/echo/EchoBuilder.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoBuilder.java?view=diff&rev=527812&p1=incubator/tuscany/java/sca/samples/echo-binding/src/main/java/echo/EchoBuilder.java&r1=527571&p2=incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoBuilder.java&r2=527812
==============================================================================
--- incubator/tuscany/java/sca/samples/echo-binding/src/main/java/echo/EchoBuilder.java (original)
+++ incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoBuilder.java Thu Apr 12 00:24:54 2007
@@ -16,36 +16,37 @@
* specific language governing permissions and limitations
* under the License.
*/
-package echo;
+package org.apache.tuscany.binding.echo;
+import java.net.URI;
+
+import org.apache.tuscany.assembly.CompositeReference;
+import org.apache.tuscany.assembly.CompositeService;
import org.apache.tuscany.spi.builder.BuilderException;
-import org.apache.tuscany.spi.component.CompositeComponent;
import org.apache.tuscany.spi.component.ReferenceBinding;
import org.apache.tuscany.spi.component.ServiceBinding;
import org.apache.tuscany.spi.deployer.DeploymentContext;
import org.apache.tuscany.spi.extension.BindingBuilderExtension;
-import org.apache.tuscany.spi.model.AbstractReferenceDefinition;
-import org.apache.tuscany.spi.model.ServiceDefinition;
/**
* @version $Rev$ $Date$
*/
public class EchoBuilder extends BindingBuilderExtension<EchoBinding> {
-
- public ServiceBinding build(CompositeComponent parent,
- ServiceDefinition boundServiceDefinition,
+ @Override
+ public ServiceBinding build(CompositeService serviceDefinition,
EchoBinding bindingDefinition,
- DeploymentContext deploymentContext) throws BuilderException {
- return new EchoService(boundServiceDefinition.getName(), parent);
+ DeploymentContext context) throws BuilderException {
+ return new EchoService(URI.create("#" + serviceDefinition.getName()));
}
- public ReferenceBinding build(CompositeComponent parent,
- AbstractReferenceDefinition boundReferenceDefinition,
+ @Override
+ public ReferenceBinding build(CompositeReference referenceDefinition,
EchoBinding bindingDefinition,
- DeploymentContext deploymentContext) throws BuilderException {
- return new EchoReference(boundReferenceDefinition.getName(), parent);
+ DeploymentContext context) throws BuilderException {
+ return new EchoReference(URI.create("#" + referenceDefinition.getName()), URI.create(bindingDefinition.getURI()));
}
+ @Override
protected Class<EchoBinding> getBindingType() {
return EchoBinding.class;
}
Added: incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoConstants.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoConstants.java?view=auto&rev=527812
==============================================================================
--- incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoConstants.java (added)
+++ incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoConstants.java Thu Apr 12 00:24:54 2007
@@ -0,0 +1,28 @@
+/*
+ * 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.tuscany.binding.echo;
+
+import static org.osoa.sca.Constants.SCA_NS;
+
+import javax.xml.namespace.QName;
+
+public interface EchoConstants {
+ QName BINDING_ECHO = new QName(SCA_NS, "binding.echo");
+}
Propchange: incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoConstants.java
------------------------------------------------------------------------------
svn:eol-style = native
Copied: incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoInvoker.java (from r527571, incubator/tuscany/java/sca/samples/echo-binding/src/main/java/echo/EchoInvoker.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoInvoker.java?view=diff&rev=527812&p1=incubator/tuscany/java/sca/samples/echo-binding/src/main/java/echo/EchoInvoker.java&r1=527571&p2=incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoInvoker.java&r2=527812
==============================================================================
--- incubator/tuscany/java/sca/samples/echo-binding/src/main/java/echo/EchoInvoker.java (original)
+++ incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoInvoker.java Thu Apr 12 00:24:54 2007
@@ -16,10 +16,11 @@
* specific language governing permissions and limitations
* under the License.
*/
-package echo;
+package org.apache.tuscany.binding.echo;
import java.lang.reflect.InvocationTargetException;
+import org.apache.tuscany.spi.component.WorkContext;
import org.apache.tuscany.spi.wire.InvocationRuntimeException;
import org.apache.tuscany.spi.wire.Message;
import org.apache.tuscany.spi.wire.TargetInvoker;
@@ -58,8 +59,18 @@
msg.setBodyWithFault(e);
}
return msg;
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.apache.tuscany.spi.wire.TargetInvoker#invokeTarget(java.lang.Object, short, org.apache.tuscany.spi.component.WorkContext)
+ */
+ public Object invokeTarget(Object payload, short sequence, WorkContext workContext) throws InvocationTargetException {
+ // TODO Auto-generated method stub
+ return null;
}
+ @Override
public Object clone() throws CloneNotSupportedException {
return super.clone();
}
Added: incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoModuleActivator.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoModuleActivator.java?view=auto&rev=527812
==============================================================================
--- incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoModuleActivator.java (added)
+++ incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoModuleActivator.java Thu Apr 12 00:24:54 2007
@@ -0,0 +1,49 @@
+/*
+ * 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.tuscany.binding.echo;
+
+import java.util.Map;
+
+import org.apache.tuscany.services.spi.contribution.StAXArtifactProcessorRegistry;
+import org.apache.tuscany.spi.bootstrap.ExtensionPointRegistry;
+import org.apache.tuscany.spi.bootstrap.ModuleActivator;
+
+
+public class EchoModuleActivator implements ModuleActivator {
+ private static final EchoBindingLoader echoBindingProcessor = new EchoBindingLoader();
+
+ public Map<Class, Object> getExtensionPoints() {
+ // No extensionPoints being contributed here
+ return null;
+ }
+
+ public void start(ExtensionPointRegistry registry) {
+ //Add the EchoProcessor to the proper registry
+ StAXArtifactProcessorRegistry artifactProcessorRegistry = registry.getExtensionPoint(StAXArtifactProcessorRegistry.class);
+ artifactProcessorRegistry.addArtifactProcessor(echoBindingProcessor);
+ }
+
+ public void stop(ExtensionPointRegistry registry) {
+ //Add the EchoProcessor to the proper registry
+ StAXArtifactProcessorRegistry artifactProcessorRegistry = registry.getExtensionPoint(StAXArtifactProcessorRegistry.class);
+ artifactProcessorRegistry.removeArtifactProcessor(echoBindingProcessor);
+ }
+
+}
Propchange: incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoModuleActivator.java
------------------------------------------------------------------------------
svn:eol-style = native
Copied: incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoReference.java (from r527571, incubator/tuscany/java/sca/samples/echo-binding/src/main/java/echo/EchoReference.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoReference.java?view=diff&rev=527812&p1=incubator/tuscany/java/sca/samples/echo-binding/src/main/java/echo/EchoReference.java&r1=527571&p2=incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoReference.java&r2=527812
==============================================================================
--- incubator/tuscany/java/sca/samples/echo-binding/src/main/java/echo/EchoReference.java (original)
+++ incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoReference.java Thu Apr 12 00:24:54 2007
@@ -16,34 +16,42 @@
* specific language governing permissions and limitations
* under the License.
*/
-package echo;
+package org.apache.tuscany.binding.echo;
-import javax.xml.namespace.QName;
+import java.net.URI;
-import static org.osoa.sca.Constants.SCA_NS;
+import javax.xml.namespace.QName;
-import org.apache.tuscany.spi.component.CompositeComponent;
+import org.apache.tuscany.core.binding.local.LocalCallbackTargetInvoker;
+import org.apache.tuscany.core.binding.local.LocalTargetInvoker;
+import org.apache.tuscany.interfacedef.Operation;
+import org.apache.tuscany.spi.component.TargetInvokerCreationException;
import org.apache.tuscany.spi.extension.ReferenceBindingExtension;
-import org.apache.tuscany.spi.model.Operation;
-import org.apache.tuscany.spi.model.ServiceContract;
import org.apache.tuscany.spi.wire.TargetInvoker;
/**
* @version $Rev$ $Date$
*/
public class EchoReference extends ReferenceBindingExtension {
- private static final QName BINDING_ECHO = new QName(SCA_NS, "binding.echo");
- public EchoReference(String name, CompositeComponent parent) {
- super(name, parent);
+ protected EchoReference(URI name, URI targetUri) {
+ super(name, targetUri);
}
public QName getBindingType() {
- return BINDING_ECHO;
+ return EchoConstants.BINDING_ECHO;
}
- public TargetInvoker createTargetInvoker(ServiceContract contract, Operation operation) {
+
+ public TargetInvoker createTargetInvoker(String name, Operation operation, boolean isCallback)
+ throws TargetInvokerCreationException {
+ if (isCallback) {
+ throw new UnsupportedOperationException();
+ } else {
return new EchoInvoker();
}
+}
+
+
}
Copied: incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoService.java (from r527571, incubator/tuscany/java/sca/samples/echo-binding/src/main/java/echo/EchoService.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoService.java?view=diff&rev=527812&p1=incubator/tuscany/java/sca/samples/echo-binding/src/main/java/echo/EchoService.java&r1=527571&p2=incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoService.java&r2=527812
==============================================================================
--- incubator/tuscany/java/sca/samples/echo-binding/src/main/java/echo/EchoService.java (original)
+++ incubator/tuscany/java/sca/samples/echo-binding/src/main/java/org/apache/tuscany/binding/echo/EchoService.java Thu Apr 12 00:24:54 2007
@@ -16,30 +16,35 @@
* specific language governing permissions and limitations
* under the License.
*/
-package echo;
+package org.apache.tuscany.binding.echo;
-import javax.xml.namespace.QName;
+import java.net.URI;
-import static org.osoa.sca.Constants.SCA_NS;
+import javax.xml.namespace.QName;
+import org.apache.tuscany.interfacedef.Operation;
import org.apache.tuscany.spi.CoreRuntimeException;
-import org.apache.tuscany.spi.component.CompositeComponent;
+import org.apache.tuscany.spi.component.TargetInvokerCreationException;
import org.apache.tuscany.spi.extension.ServiceBindingExtension;
+import org.apache.tuscany.spi.wire.TargetInvoker;
/**
* @version $Rev$ $Date$
*/
public class EchoService extends ServiceBindingExtension {
- private static final QName BINDING_ECHO = new QName(SCA_NS, "binding.echo");
-
- public EchoService(String name, CompositeComponent parent) throws CoreRuntimeException {
- super(name, parent);
- // do nothing, but this could register with the host environment
+
+ public EchoService(URI name) throws CoreRuntimeException {
+ super(name);
+ //do nothing, but this could register with the host environment
}
-
public QName getBindingType() {
- return BINDING_ECHO;
+ return EchoConstants.BINDING_ECHO;
+ }
+
+ public TargetInvoker createTargetInvoker(String targetName, Operation operation, boolean isCallback) throws TargetInvokerCreationException {
+ // TODO Auto-generated method stub
+ return null;
}
}
Added: incubator/tuscany/java/sca/samples/echo-binding/src/main/resources/META-INF/services/org.apache.tuscany.spi.bootstrap.ModuleActivator
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-binding/src/main/resources/META-INF/services/org.apache.tuscany.spi.bootstrap.ModuleActivator?view=auto&rev=527812
==============================================================================
--- incubator/tuscany/java/sca/samples/echo-binding/src/main/resources/META-INF/services/org.apache.tuscany.spi.bootstrap.ModuleActivator (added)
+++ incubator/tuscany/java/sca/samples/echo-binding/src/main/resources/META-INF/services/org.apache.tuscany.spi.bootstrap.ModuleActivator Thu Apr 12 00:24:54 2007
@@ -0,0 +1,2 @@
+# Implementation class for the ExtensionActivator
+org.apache.tuscany.container.crud.CRUDModuleActivator
Copied: incubator/tuscany/java/sca/samples/echo-binding/src/test/java/org/apache/tuscany/binding/echo/Client.java (from r527571, incubator/tuscany/java/sca/samples/echo-binding/src/test/java/echo/Client.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-binding/src/test/java/org/apache/tuscany/binding/echo/Client.java?view=diff&rev=527812&p1=incubator/tuscany/java/sca/samples/echo-binding/src/test/java/echo/Client.java&r1=527571&p2=incubator/tuscany/java/sca/samples/echo-binding/src/test/java/org/apache/tuscany/binding/echo/Client.java&r2=527812
==============================================================================
--- incubator/tuscany/java/sca/samples/echo-binding/src/test/java/echo/Client.java (original)
+++ incubator/tuscany/java/sca/samples/echo-binding/src/test/java/org/apache/tuscany/binding/echo/Client.java Thu Apr 12 00:24:54 2007
@@ -16,12 +16,11 @@
* specific language governing permissions and limitations
* under the License.
*/
-package echo;
+package org.apache.tuscany.binding.echo;
/**
* @version $Rev$ $Date$
*/
public interface Client {
-
void call(String msg);
}
Copied: incubator/tuscany/java/sca/samples/echo-binding/src/test/java/org/apache/tuscany/binding/echo/ClientImpl.java (from r527571, incubator/tuscany/java/sca/samples/echo-binding/src/test/java/echo/ClientImpl.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-binding/src/test/java/org/apache/tuscany/binding/echo/ClientImpl.java?view=diff&rev=527812&p1=incubator/tuscany/java/sca/samples/echo-binding/src/test/java/echo/ClientImpl.java&r1=527571&p2=incubator/tuscany/java/sca/samples/echo-binding/src/test/java/org/apache/tuscany/binding/echo/ClientImpl.java&r2=527812
==============================================================================
--- incubator/tuscany/java/sca/samples/echo-binding/src/test/java/echo/ClientImpl.java (original)
+++ incubator/tuscany/java/sca/samples/echo-binding/src/test/java/org/apache/tuscany/binding/echo/ClientImpl.java Thu Apr 12 00:24:54 2007
@@ -16,10 +16,11 @@
* specific language governing permissions and limitations
* under the License.
*/
-package echo;
+package org.apache.tuscany.binding.echo;
import org.osoa.sca.annotations.Constructor;
import org.osoa.sca.annotations.Reference;
+
/**
* @version $Rev$ $Date$
Copied: incubator/tuscany/java/sca/samples/echo-binding/src/test/java/org/apache/tuscany/binding/echo/Echo.java (from r527571, incubator/tuscany/java/sca/samples/echo-binding/src/test/java/echo/Echo.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-binding/src/test/java/org/apache/tuscany/binding/echo/Echo.java?view=diff&rev=527812&p1=incubator/tuscany/java/sca/samples/echo-binding/src/test/java/echo/Echo.java&r1=527571&p2=incubator/tuscany/java/sca/samples/echo-binding/src/test/java/org/apache/tuscany/binding/echo/Echo.java&r2=527812
==============================================================================
--- incubator/tuscany/java/sca/samples/echo-binding/src/test/java/echo/Echo.java (original)
+++ incubator/tuscany/java/sca/samples/echo-binding/src/test/java/org/apache/tuscany/binding/echo/Echo.java Thu Apr 12 00:24:54 2007
@@ -16,12 +16,11 @@
* specific language governing permissions and limitations
* under the License.
*/
-package echo;
+package org.apache.tuscany.binding.echo;
/**
* @version $Rev$ $Date$
*/
public interface Echo {
-
String invoke(String msg);
}
Copied: incubator/tuscany/java/sca/samples/echo-binding/src/test/java/org/apache/tuscany/binding/echo/EchoBindingTestCase.java (from r527571, incubator/tuscany/java/sca/samples/echo-binding/src/test/java/echo/EchoBindingTestCase.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-binding/src/test/java/org/apache/tuscany/binding/echo/EchoBindingTestCase.java?view=diff&rev=527812&p1=incubator/tuscany/java/sca/samples/echo-binding/src/test/java/echo/EchoBindingTestCase.java&r1=527571&p2=incubator/tuscany/java/sca/samples/echo-binding/src/test/java/org/apache/tuscany/binding/echo/EchoBindingTestCase.java&r2=527812
==============================================================================
--- incubator/tuscany/java/sca/samples/echo-binding/src/test/java/echo/EchoBindingTestCase.java (original)
+++ incubator/tuscany/java/sca/samples/echo-binding/src/test/java/org/apache/tuscany/binding/echo/EchoBindingTestCase.java Thu Apr 12 00:24:54 2007
@@ -16,13 +16,13 @@
* specific language governing permissions and limitations
* under the License.
*/
-package echo;
+package org.apache.tuscany.binding.echo;
import junit.framework.TestCase;
import org.apache.tuscany.api.SCARuntime;
-import org.osoa.sca.CompositeContext;
-import org.osoa.sca.CurrentCompositeContext;
+import org.osoa.sca.ComponentContext;
+import org.osoa.sca.ServiceReference;
/**
* @version $Rev$ $Date$
@@ -31,17 +31,20 @@
private Client client;
- public void testEchoBinding() {
- client.call("foo");
- }
-
protected void setUp() throws Exception {
- SCARuntime.start("EchoBinding.composite");
- CompositeContext context = CurrentCompositeContext.getContext();
- client = context.locateService(Client.class, "Client");
+ SCARuntime.start("EchoBinding.composite");
+ ComponentContext context = SCARuntime.getComponentContext("ClientComponent");
+ ServiceReference<Client> service = context.createSelfReference(Client.class);
+ client = service.getService();
}
protected void tearDown() throws Exception {
SCARuntime.stop();
}
+
+ public void testEchoBinding() {
+ client.call("foo");
+ }
+
+
}
Modified: incubator/tuscany/java/sca/samples/echo-binding/src/test/resources/EchoBinding.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/echo-binding/src/test/resources/EchoBinding.composite?view=diff&rev=527812&r1=527811&r2=527812
==============================================================================
--- incubator/tuscany/java/sca/samples/echo-binding/src/test/resources/EchoBinding.composite (original)
+++ incubator/tuscany/java/sca/samples/echo-binding/src/test/resources/EchoBinding.composite Thu Apr 12 00:24:54 2007
@@ -26,11 +26,11 @@
</service>
<component name="Client">
- <implementation.java class="echo.ClientImpl"/>
+ <implementation.java class="org.apache.tuscany.binding.echo.ClientImpl"/>
</component>
<reference name="EchoReference" promote="Client">
- <interface.java interface="echo.Echo"/>
+ <interface.java interface="org.apache.tuscany.binding.echo.Echo"/>
<binding.echo/>
</reference>
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org