tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lrese...@apache.org
Subject svn commit: r525071 - /incubator/tuscany/java/sca/runtime/services/contribution/contribution-framework/src/main/java/org/apache/tuscany/services/spi/contribution/
Date Tue, 03 Apr 2007 07:38:35 GMT
Author: lresende
Date: Tue Apr  3 00:38:34 2007
New Revision: 525071

URL: http://svn.apache.org/viewvc?view=rev&rev=525071
Log:
New interfaces more aligned with SCDL4J

Added:
    incubator/tuscany/java/sca/runtime/services/contribution/contribution-framework/src/main/java/org/apache/tuscany/services/spi/contribution/ArtifactProcessor.java
    incubator/tuscany/java/sca/runtime/services/contribution/contribution-framework/src/main/java/org/apache/tuscany/services/spi/contribution/DOMArtifactProcessor.java
    incubator/tuscany/java/sca/runtime/services/contribution/contribution-framework/src/main/java/org/apache/tuscany/services/spi/contribution/ModelResolver.java
    incubator/tuscany/java/sca/runtime/services/contribution/contribution-framework/src/main/java/org/apache/tuscany/services/spi/contribution/StAXArtifactProcessor.java
    incubator/tuscany/java/sca/runtime/services/contribution/contribution-framework/src/main/java/org/apache/tuscany/services/spi/contribution/StreamArtifactProcessor.java
Modified:
    incubator/tuscany/java/sca/runtime/services/contribution/contribution-framework/src/main/java/org/apache/tuscany/services/spi/contribution/ContributionService.java

Added: incubator/tuscany/java/sca/runtime/services/contribution/contribution-framework/src/main/java/org/apache/tuscany/services/spi/contribution/ArtifactProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/runtime/services/contribution/contribution-framework/src/main/java/org/apache/tuscany/services/spi/contribution/ArtifactProcessor.java?view=auto&rev=525071
==============================================================================
--- incubator/tuscany/java/sca/runtime/services/contribution/contribution-framework/src/main/java/org/apache/tuscany/services/spi/contribution/ArtifactProcessor.java
(added)
+++ incubator/tuscany/java/sca/runtime/services/contribution/contribution-framework/src/main/java/org/apache/tuscany/services/spi/contribution/ArtifactProcessor.java
Tue Apr  3 00:38:34 2007
@@ -0,0 +1,32 @@
+/*
+ * 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.services.spi.contribution;
+
+import org.apache.tuscany.services.contribution.model.Contribution;
+
+
+/**
+ * Interface for services that can process contributions.
+ * 
+ * @version $Rev: 522653 $ $Date: 2007-03-26 15:30:21 -0700 (Mon, 26 Mar 2007) $
+ */
+public interface ArtifactProcessor <S,M>{
+    M read(S source);
+    void resolve(Contribution contribution, M model);
+}

Modified: incubator/tuscany/java/sca/runtime/services/contribution/contribution-framework/src/main/java/org/apache/tuscany/services/spi/contribution/ContributionService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/runtime/services/contribution/contribution-framework/src/main/java/org/apache/tuscany/services/spi/contribution/ContributionService.java?view=diff&rev=525071&r1=525070&r2=525071
==============================================================================
--- incubator/tuscany/java/sca/runtime/services/contribution/contribution-framework/src/main/java/org/apache/tuscany/services/spi/contribution/ContributionService.java
(original)
+++ incubator/tuscany/java/sca/runtime/services/contribution/contribution-framework/src/main/java/org/apache/tuscany/services/spi/contribution/ContributionService.java
Tue Apr  3 00:38:34 2007
@@ -22,6 +22,7 @@
 import java.io.InputStream;
 import java.net.URI;
 import java.net.URL;
+import java.util.Map;
 
 import org.apache.tuscany.services.contribution.model.Contribution;
 
@@ -88,36 +89,48 @@
      */
     void remove(URI contribution) throws ContributionException;
 
-    /**
-     * Resolve an artifact by QName within the contribution
-     * 
-     * @param <T> The java type of the artifact such as javax.wsdl.Definition
-     * @param contribution The URI of the contribution
-     * @param definitionType The java type of the artifact
-     * @param namespace The namespace of the artifact
-     * @param name The name of the artifact
-     * @return The resolved artifact
-     */
-    <T> T resolve(URI contribution, Class<T> definitionType, String namespace,
String name);
-
-    /**
-     * Resolve the reference to an artifact by the location URI within the given
-     * contribution. Some typical use cases are:
-     * <ul>
-     * <li>Reference a XML schema using
-     * {http://www.w3.org/2001/XMLSchema-instance}schemaLocation or
-     * <li>Reference a list of WSDLs using
-     * {http://www.w3.org/2004/08/wsdl-instance}wsdlLocation
-     * </ul>
-     * 
-     * @param contribution The URI of the contribution
-     * @param namespace The namespace of the artifact. This is for validation
-     *            purpose. If the namespace is null, then no check will be
-     *            performed.
-     * @param uri The location URI
-     * @param baseURI The URI of the base artifact where the reference is
-     *            declared
-     * @return The URL of the resolved artifact
-     */
-    URL resolve(URI contribution, String namespace, URI uri, URI baseURI);
+//    /**
+//     * Resolve an artifact by QName within the contribution
+//     * 
+//     * @param <T> The java type of the artifact such as javax.wsdl.Definition
+//     * @param contribution The URI of the contribution
+//     * @param definitionType The java type of the artifact
+//     * @param namespace The namespace of the artifact
+//     * @param name The name of the artifact
+//     * @return The resolved artifact
+//     */
+//    <T> T resolve(URI contribution, Class<T> definitionType, String namespace,
String name);
+//
+//    /**
+//     * Resolve the reference to an artifact by the location URI within the given
+//     * contribution. Some typical use cases are:
+//     * <ul>
+//     * <li>Reference a XML schema using
+//     * {http://www.w3.org/2001/XMLSchema-instance}schemaLocation or
+//     * <li>Reference a list of WSDLs using
+//     * {http://www.w3.org/2004/08/wsdl-instance}wsdlLocation
+//     * </ul>
+//     * 
+//     * @param contribution The URI of the contribution
+//     * @param namespace The namespace of the artifact. This is for validation
+//     *            purpose. If the namespace is null, then no check will be
+//     *            performed.
+//     * @param uri The location URI
+//     * @param baseURI The URI of the base artifact where the reference is
+//     *            declared
+//     * @return The URL of the resolved artifact
+//     */
+//    URL resolve(URI contribution, String namespace, URI uri, URI baseURI);
+    
+  /**
+  * Resolve an artifact by QName within the contribution
+  * 
+  * @param <T> The java type of the artifact such as javax.wsdl.Definition
+  * @param contribution The URI of the contribution
+  * @param definitionType The java type of the artifact
+  * @param namespace The namespace of the artifact
+  * @param name The name of the artifact
+  * @return The resolved artifact
+  */
+ <M> M resolve(Class modelClass, Class<M> elementClass, Object modelKey, Object
elementKey, Map<String, Object> attributes);
 }

Added: incubator/tuscany/java/sca/runtime/services/contribution/contribution-framework/src/main/java/org/apache/tuscany/services/spi/contribution/DOMArtifactProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/runtime/services/contribution/contribution-framework/src/main/java/org/apache/tuscany/services/spi/contribution/DOMArtifactProcessor.java?view=auto&rev=525071
==============================================================================
--- incubator/tuscany/java/sca/runtime/services/contribution/contribution-framework/src/main/java/org/apache/tuscany/services/spi/contribution/DOMArtifactProcessor.java
(added)
+++ incubator/tuscany/java/sca/runtime/services/contribution/contribution-framework/src/main/java/org/apache/tuscany/services/spi/contribution/DOMArtifactProcessor.java
Tue Apr  3 00:38:34 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.services.spi.contribution;
+
+import org.w3c.dom.Node;
+
+public interface DOMArtifactProcessor<M> extends ArtifactProcessor<Node, M> {
+
+}

Added: incubator/tuscany/java/sca/runtime/services/contribution/contribution-framework/src/main/java/org/apache/tuscany/services/spi/contribution/ModelResolver.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/runtime/services/contribution/contribution-framework/src/main/java/org/apache/tuscany/services/spi/contribution/ModelResolver.java?view=auto&rev=525071
==============================================================================
--- incubator/tuscany/java/sca/runtime/services/contribution/contribution-framework/src/main/java/org/apache/tuscany/services/spi/contribution/ModelResolver.java
(added)
+++ incubator/tuscany/java/sca/runtime/services/contribution/contribution-framework/src/main/java/org/apache/tuscany/services/spi/contribution/ModelResolver.java
Tue Apr  3 00:38:34 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.services.spi.contribution;
+
+import java.util.Map;
+
+import org.apache.tuscany.services.contribution.model.Contribution;
+
+public interface ModelResolver {
+    Object getKey();
+    <M> M resolve(Contribution contribution, Class<M> elementClass, Object key,
Map<String, Object> attributes);
+}

Added: incubator/tuscany/java/sca/runtime/services/contribution/contribution-framework/src/main/java/org/apache/tuscany/services/spi/contribution/StAXArtifactProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/runtime/services/contribution/contribution-framework/src/main/java/org/apache/tuscany/services/spi/contribution/StAXArtifactProcessor.java?view=auto&rev=525071
==============================================================================
--- incubator/tuscany/java/sca/runtime/services/contribution/contribution-framework/src/main/java/org/apache/tuscany/services/spi/contribution/StAXArtifactProcessor.java
(added)
+++ incubator/tuscany/java/sca/runtime/services/contribution/contribution-framework/src/main/java/org/apache/tuscany/services/spi/contribution/StAXArtifactProcessor.java
Tue Apr  3 00:38:34 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.services.spi.contribution;
+
+import javax.xml.stream.XMLStreamReader;
+
+public interface StAXArtifactProcessor <M> extends ArtifactProcessor <XMLStreamReader,
M> {
+
+}

Added: incubator/tuscany/java/sca/runtime/services/contribution/contribution-framework/src/main/java/org/apache/tuscany/services/spi/contribution/StreamArtifactProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/runtime/services/contribution/contribution-framework/src/main/java/org/apache/tuscany/services/spi/contribution/StreamArtifactProcessor.java?view=auto&rev=525071
==============================================================================
--- incubator/tuscany/java/sca/runtime/services/contribution/contribution-framework/src/main/java/org/apache/tuscany/services/spi/contribution/StreamArtifactProcessor.java
(added)
+++ incubator/tuscany/java/sca/runtime/services/contribution/contribution-framework/src/main/java/org/apache/tuscany/services/spi/contribution/StreamArtifactProcessor.java
Tue Apr  3 00:38:34 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.services.spi.contribution;
+
+import java.io.InputStream;
+
+public interface StreamArtifactProcessor<M> extends ArtifactProcessor<InputStream,
M> {
+
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org


Mime
View raw message