From bdd0a41aed7edf21ec2a65cfa17a86af2ef8c48a Mon Sep 17 00:00:00 2001 From: dims Date: Tue, 17 Jun 2008 00:23:01 +0000 Subject: Move Tuscany from Incubator to top level. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@668359 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca/implementation/resource/Resource.java | 38 ++++++ .../resource/ResourceImplementation.java | 39 +++++++ .../resource/ResourceImplementationFactory.java | 35 ++++++ .../impl/ResourceImplementationFactoryImpl.java | 47 ++++++++ .../resource/impl/ResourceImplementationImpl.java | 128 +++++++++++++++++++++ .../impl/ResourceImplementationProcessor.java | 113 ++++++++++++++++++ .../provider/ResourceImplementationInvoker.java | 43 +++++++ .../provider/ResourceImplementationProvider.java | 57 +++++++++ .../ResourceImplementationProviderFactory.java | 45 ++++++++ ...ca.contribution.processor.StAXArtifactProcessor | 19 +++ ...entation.resource.ResourceImplementationFactory | 19 +++ ...cany.sca.provider.ImplementationProviderFactory | 19 +++ 12 files changed, 602 insertions(+) create mode 100644 branches/sca-java-0.99/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/Resource.java create mode 100644 branches/sca-java-0.99/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/ResourceImplementation.java create mode 100644 branches/sca-java-0.99/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/ResourceImplementationFactory.java create mode 100644 branches/sca-java-0.99/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/impl/ResourceImplementationFactoryImpl.java create mode 100644 branches/sca-java-0.99/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/impl/ResourceImplementationImpl.java create mode 100644 branches/sca-java-0.99/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/impl/ResourceImplementationProcessor.java create mode 100644 branches/sca-java-0.99/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/provider/ResourceImplementationInvoker.java create mode 100644 branches/sca-java-0.99/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/provider/ResourceImplementationProvider.java create mode 100644 branches/sca-java-0.99/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/provider/ResourceImplementationProviderFactory.java create mode 100644 branches/sca-java-0.99/modules/implementation-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor create mode 100644 branches/sca-java-0.99/modules/implementation-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.resource.ResourceImplementationFactory create mode 100644 branches/sca-java-0.99/modules/implementation-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory (limited to 'branches/sca-java-0.99/modules/implementation-resource/src/main') diff --git a/branches/sca-java-0.99/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/Resource.java b/branches/sca-java-0.99/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/Resource.java new file mode 100644 index 0000000000..ab99615571 --- /dev/null +++ b/branches/sca-java-0.99/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/Resource.java @@ -0,0 +1,38 @@ +/* + * 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.sca.implementation.resource; + +import java.net.URL; + +/** + * The service interface of resource implementations. + * + * @version $Rev: 548609 $ $Date: 2007-06-18 23:31:03 -0700 (Mon, 18 Jun 2007) $ + */ +public interface Resource { + + /** + * Returns the resource location URL. + * + * @return + */ + public URL getLocationURL(); + +} diff --git a/branches/sca-java-0.99/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/ResourceImplementation.java b/branches/sca-java-0.99/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/ResourceImplementation.java new file mode 100644 index 0000000000..92d2fe5f0b --- /dev/null +++ b/branches/sca-java-0.99/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/ResourceImplementation.java @@ -0,0 +1,39 @@ +/* + * 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.sca.implementation.resource; + +import java.net.URL; + +import org.apache.tuscany.sca.assembly.Implementation; + + +/** + * The model representing a resource implementation in an SCA assembly model. + */ +public interface ResourceImplementation extends Implementation { + + public String getLocation(); + + public void setLocation(String location); + + public URL getLocationURL(); + + public void setLocationURL(URL url); + +} diff --git a/branches/sca-java-0.99/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/ResourceImplementationFactory.java b/branches/sca-java-0.99/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/ResourceImplementationFactory.java new file mode 100644 index 0000000000..95ac452c66 --- /dev/null +++ b/branches/sca-java-0.99/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/ResourceImplementationFactory.java @@ -0,0 +1,35 @@ +/* + * 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.sca.implementation.resource; + +/** + * Factory for the resource implementation model. + * + * @version $Rev$ $Date$ + */ +public interface ResourceImplementationFactory { + + /** + * Creates a new resource implementation. + * @return a new resource implementation + */ + ResourceImplementation createResourceImplementation(); + +} diff --git a/branches/sca-java-0.99/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/impl/ResourceImplementationFactoryImpl.java b/branches/sca-java-0.99/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/impl/ResourceImplementationFactoryImpl.java new file mode 100644 index 0000000000..d4db8772e4 --- /dev/null +++ b/branches/sca-java-0.99/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/impl/ResourceImplementationFactoryImpl.java @@ -0,0 +1,47 @@ +/* + * 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.sca.implementation.resource.impl; + +import org.apache.tuscany.sca.assembly.AssemblyFactory; +import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; +import org.apache.tuscany.sca.implementation.resource.ResourceImplementation; +import org.apache.tuscany.sca.implementation.resource.ResourceImplementationFactory; +import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory; + +/** + * Factory for the resource implementation model. + * + * @version $Rev$ $Date$ + */ +public class ResourceImplementationFactoryImpl implements ResourceImplementationFactory { + + private AssemblyFactory assemblyFactory; + private JavaInterfaceFactory javaFactory; + + public ResourceImplementationFactoryImpl(ModelFactoryExtensionPoint modelFactories) { + assemblyFactory = modelFactories.getFactory(AssemblyFactory.class); + javaFactory = modelFactories.getFactory(JavaInterfaceFactory.class); + } + + public ResourceImplementation createResourceImplementation() { + return new ResourceImplementationImpl(assemblyFactory, javaFactory); + } + +} diff --git a/branches/sca-java-0.99/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/impl/ResourceImplementationImpl.java b/branches/sca-java-0.99/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/impl/ResourceImplementationImpl.java new file mode 100644 index 0000000000..dc52862f75 --- /dev/null +++ b/branches/sca-java-0.99/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/impl/ResourceImplementationImpl.java @@ -0,0 +1,128 @@ +/* + * 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.sca.implementation.resource.impl; + +import java.net.URL; +import java.util.Collections; +import java.util.List; + +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.Service; +import org.apache.tuscany.sca.implementation.resource.Resource; +import org.apache.tuscany.sca.implementation.resource.ResourceImplementation; +import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException; +import org.apache.tuscany.sca.interfacedef.java.JavaInterface; +import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract; +import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory; + + +/** + * The model representing a resource implementation in an SCA assembly model. + */ +class ResourceImplementationImpl implements ResourceImplementation { + + private Service resourceService; + + private String location; + private URL url; + private boolean unresolved; + + /** + * Constructs a new resource implementation. + */ + ResourceImplementationImpl(AssemblyFactory assemblyFactory, + JavaInterfaceFactory javaFactory) { + + // Resource implementation always provide a single service exposing + // the Resource interface, and have no references and properties + resourceService = assemblyFactory.createService(); + resourceService.setName("Resource"); + + // Create the Java interface contract for the Resource service + JavaInterface javaInterface; + try { + javaInterface = javaFactory.createJavaInterface(Resource.class); + } catch (InvalidInterfaceException e) { + throw new IllegalArgumentException(e); + } + JavaInterfaceContract interfaceContract = javaFactory.createJavaInterfaceContract(); + interfaceContract.setInterface(javaInterface); + resourceService.setInterfaceContract(interfaceContract); + } + + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } + + public URL getLocationURL() { + return url; + } + + public void setLocationURL(URL url) { + this.url = url; + } + + public ConstrainingType getConstrainingType() { + // The resource implementation does not support constrainingTypes + return null; + } + + public List getProperties() { + // The resource implementation does not support properties + return Collections.emptyList(); + } + + public List getServices() { + // The resource implementation does not support services + return Collections.singletonList(resourceService); + } + + public List getReferences() { + // The resource implementation does not support properties + return Collections.emptyList(); + } + + public String getURI() { + return location; + } + + public void setConstrainingType(ConstrainingType constrainingType) { + // The resource implementation does not support constrainingTypes + } + + public void setURI(String uri) { + this.location = uri; + } + + + public boolean isUnresolved() { + return unresolved; + } + + public void setUnresolved(boolean unresolved) { + this.unresolved = unresolved; + } +} diff --git a/branches/sca-java-0.99/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/impl/ResourceImplementationProcessor.java b/branches/sca-java-0.99/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/impl/ResourceImplementationProcessor.java new file mode 100644 index 0000000000..94f69ea2f9 --- /dev/null +++ b/branches/sca-java-0.99/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/impl/ResourceImplementationProcessor.java @@ -0,0 +1,113 @@ +/* + * 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.sca.implementation.resource.impl; + +import static javax.xml.stream.XMLStreamConstants.END_ELEMENT; + +import java.io.IOException; +import java.net.URL; + +import javax.xml.namespace.QName; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamReader; +import javax.xml.stream.XMLStreamWriter; + +import org.apache.tuscany.sca.assembly.xml.Constants; +import org.apache.tuscany.sca.contribution.ContributionFactory; +import org.apache.tuscany.sca.contribution.DeployedArtifact; +import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; +import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; +import org.apache.tuscany.sca.contribution.resolver.ModelResolver; +import org.apache.tuscany.sca.contribution.service.ContributionReadException; +import org.apache.tuscany.sca.contribution.service.ContributionResolveException; +import org.apache.tuscany.sca.contribution.service.ContributionWriteException; +import org.apache.tuscany.sca.implementation.resource.ResourceImplementation; +import org.apache.tuscany.sca.implementation.resource.ResourceImplementationFactory; + + +/** + * Implements a STAX artifact processor for resource implementations. + */ +public class ResourceImplementationProcessor implements StAXArtifactProcessor { + private static final QName IMPLEMENTATION_RESOURCE = new QName(Constants.SCA10_TUSCANY_NS, "implementation.resource"); + + private ContributionFactory contributionFactory; + private ResourceImplementationFactory implementationFactory; + + public ResourceImplementationProcessor(ModelFactoryExtensionPoint modelFactories) { + contributionFactory = modelFactories.getFactory(ContributionFactory.class); + implementationFactory = modelFactories.getFactory(ResourceImplementationFactory.class); + } + + public QName getArtifactType() { + // Returns the qname of the XML element processed by this processor + return IMPLEMENTATION_RESOURCE; + } + + public Class getModelType() { + // Returns the type of model processed by this processor + return ResourceImplementation.class; + } + + public ResourceImplementation read(XMLStreamReader reader) throws ContributionReadException { + assert IMPLEMENTATION_RESOURCE.equals(reader.getName()); + + // Read an element + try { + // Read the directory attribute. This is where the sample + // CRUD implementation will persist resources. + String location = reader.getAttributeValue(null, "location"); + + // Create an initialize the resource implementationmodel + ResourceImplementation implementation = implementationFactory.createResourceImplementation(); + implementation.setLocation(location); + implementation.setUnresolved(true); + + // Skip to end element + while (reader.hasNext()) { + if (reader.next() == END_ELEMENT && IMPLEMENTATION_RESOURCE.equals(reader.getName())) { + break; + } + } + + return implementation; + } catch (XMLStreamException e) { + throw new ContributionReadException(e); + } + } + + public void resolve(ResourceImplementation impl, ModelResolver resolver) throws ContributionResolveException { + + // Resolve the resource directory location + DeployedArtifact artifact = contributionFactory.createDeployedArtifact(); + artifact.setURI(impl.getLocation()); + DeployedArtifact resolved = resolver.resolveModel(DeployedArtifact.class, artifact); + if (resolved.getLocation() != null) { + try { + impl.setLocationURL(new URL(resolved.getLocation())); + impl.setUnresolved(false); + } catch (IOException e) { + throw new ContributionResolveException(e); + } + } + } + + public void write(ResourceImplementation model, XMLStreamWriter outputSource) throws ContributionWriteException { + } +} diff --git a/branches/sca-java-0.99/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/provider/ResourceImplementationInvoker.java b/branches/sca-java-0.99/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/provider/ResourceImplementationInvoker.java new file mode 100644 index 0000000000..a2c01c2e2b --- /dev/null +++ b/branches/sca-java-0.99/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/provider/ResourceImplementationInvoker.java @@ -0,0 +1,43 @@ +/* + * 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.sca.implementation.resource.provider; + +import java.net.URL; + +import org.apache.tuscany.sca.invocation.Invoker; +import org.apache.tuscany.sca.invocation.Message; + +/** + * Implements an invoker for resource component implementations. + */ +class ResourceImplementationInvoker implements Invoker { + private URL locationURL; + + ResourceImplementationInvoker(URL locationURL) { + this.locationURL = locationURL; + } + + public Message invoke(Message msg) { + // Return the location URL + msg.setBody(locationURL); + return msg; + } + +} diff --git a/branches/sca-java-0.99/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/provider/ResourceImplementationProvider.java b/branches/sca-java-0.99/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/provider/ResourceImplementationProvider.java new file mode 100644 index 0000000000..816c97f1f2 --- /dev/null +++ b/branches/sca-java-0.99/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/provider/ResourceImplementationProvider.java @@ -0,0 +1,57 @@ +/* + * 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.sca.implementation.resource.provider; + +import org.apache.tuscany.sca.implementation.resource.ResourceImplementation; +import org.apache.tuscany.sca.interfacedef.Operation; +import org.apache.tuscany.sca.invocation.Invoker; +import org.apache.tuscany.sca.provider.ImplementationProvider; +import org.apache.tuscany.sca.runtime.RuntimeComponent; +import org.apache.tuscany.sca.runtime.RuntimeComponentService; + +/** + * The model representing a resource implementation in an SCA assembly model. + */ +class ResourceImplementationProvider implements ImplementationProvider { + + private ResourceImplementation implementation; + + /** + * Constructs a new resource implementation provider. + */ + ResourceImplementationProvider(RuntimeComponent component, ResourceImplementation implementation) { + this.implementation = implementation; + } + + public Invoker createInvoker(RuntimeComponentService service, Operation operation) { + ResourceImplementationInvoker invoker = new ResourceImplementationInvoker(implementation.getLocationURL()); + return invoker; + } + + public Invoker createCallbackInvoker(Operation operation) { + return null; + } + + public void start() { + } + + public void stop() { + } + +} diff --git a/branches/sca-java-0.99/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/provider/ResourceImplementationProviderFactory.java b/branches/sca-java-0.99/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/provider/ResourceImplementationProviderFactory.java new file mode 100644 index 0000000000..b8ab28cfaa --- /dev/null +++ b/branches/sca-java-0.99/modules/implementation-resource/src/main/java/org/apache/tuscany/sca/implementation/resource/provider/ResourceImplementationProviderFactory.java @@ -0,0 +1,45 @@ +/* + * 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.sca.implementation.resource.provider; + +import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.implementation.resource.ResourceImplementation; +import org.apache.tuscany.sca.provider.ImplementationProvider; +import org.apache.tuscany.sca.provider.ImplementationProviderFactory; +import org.apache.tuscany.sca.runtime.RuntimeComponent; + +/** + * The model representing a resource implementation in an SCA assembly model. + */ +public class ResourceImplementationProviderFactory implements ImplementationProviderFactory { + + /** + * Constructs a resource implementation. + */ + public ResourceImplementationProviderFactory(ExtensionPointRegistry extensionPoints) { + } + + public ImplementationProvider createImplementationProvider(RuntimeComponent component, ResourceImplementation implementation) { + return new ResourceImplementationProvider(component, implementation); + } + + public Class getModelType() { + return ResourceImplementation.class; + } +} diff --git a/branches/sca-java-0.99/modules/implementation-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/branches/sca-java-0.99/modules/implementation-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor new file mode 100644 index 0000000000..b5774c5c5b --- /dev/null +++ b/branches/sca-java-0.99/modules/implementation-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor @@ -0,0 +1,19 @@ +# 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 the artifact processor extension +org.apache.tuscany.sca.implementation.resource.impl.ResourceImplementationProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.0#implementation.resource,model=org.apache.tuscany.sca.implementation.resource.ResourceImplementation,factory=org.apache.tuscany.sca.implementation.resource.ResourceImplementationFactory diff --git a/branches/sca-java-0.99/modules/implementation-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.resource.ResourceImplementationFactory b/branches/sca-java-0.99/modules/implementation-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.resource.ResourceImplementationFactory new file mode 100644 index 0000000000..f77f723c3e --- /dev/null +++ b/branches/sca-java-0.99/modules/implementation-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.resource.ResourceImplementationFactory @@ -0,0 +1,19 @@ +# 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.implementation.resource.impl.ResourceImplementationFactoryImpl diff --git a/branches/sca-java-0.99/modules/implementation-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory b/branches/sca-java-0.99/modules/implementation-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory new file mode 100644 index 0000000000..656d8c2751 --- /dev/null +++ b/branches/sca-java-0.99/modules/implementation-resource/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory @@ -0,0 +1,19 @@ +# 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 the implementation extension +org.apache.tuscany.sca.implementation.resource.provider.ResourceImplementationProviderFactory;model=org.apache.tuscany.sca.implementation.resource.ResourceImplementation -- cgit v1.2.3