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 2010/04/25 19:51:09 UTC

svn commit: r937841 [3/3] - in /tuscany/sca-java-2.x/trunk/modules: ./ binding-rest-runtime/ binding-rest-runtime/META-INF/ binding-rest-runtime/src/ binding-rest-runtime/src/main/ binding-rest-runtime/src/main/java/ binding-rest-runtime/src/main/java/...

Propchange: tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/http/HTTPBinding.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/http/HTTPBinding.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/http/HTTPBindingFactory.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/http/HTTPBindingFactory.java?rev=937841&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/http/HTTPBindingFactory.java (added)
+++ tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/http/HTTPBindingFactory.java Sun Apr 25 17:51:08 2010
@@ -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.binding.http;
+
+/**
+ * Factory for the HTTP binding model.
+ *
+ * @version $Rev$ $Date$
+ */
+public interface HTTPBindingFactory {
+
+    /**
+     * Creates a new HTTP binding.
+     * @return a new HTTP binding
+     */
+    HTTPBinding createHTTPBinding();
+
+}

Propchange: tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/http/HTTPBindingFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/http/HTTPBindingFactory.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/http/HTTPCacheContext.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/http/HTTPCacheContext.java?rev=937841&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/http/HTTPCacheContext.java (added)
+++ tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/http/HTTPCacheContext.java Sun Apr 25 17:51:08 2010
@@ -0,0 +1,257 @@
+/*
+ * 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.binding.http;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * A class to store cache settings for Atom and HTTP requests and responses.
+ * 
+ * Predicates are statements that work in conjunction with
+ * ETags and LastModified dates to determine if a precondition
+ * or postcondition is satisfied.
+ * See HTTP specification for how predicates wrk:
+ * http://tools.ietf.org/html/rfc2616
+ * Example predicates in HTTP include If-Match, If-None-Match,
+ * If-Modified-Since, If-Unmodified-Since, If-Range.
+
+ */
+public class HTTPCacheContext {
+    public static final SimpleDateFormat RFC822DateFormat = new SimpleDateFormat( "EEE, dd MMM yyyy HH:mm:ss Z" ); // RFC 822 date time
+
+    public boolean enabled;
+    public String eTag;
+    public String lastModified;
+    public Date lastModifiedDate;
+    public boolean ifModifiedSince;
+    public boolean ifUnmodifiedSince;
+    public boolean ifMatch;
+    public boolean ifNoneMatch;
+    public boolean ifRange;
+
+    /**
+     * An ETag is a unique ID for an item. It changes when
+     * a field in the item or the update date changes.
+     * See HTTP specification for how ETags work:
+     * http://tools.ietf.org/html/rfc2616
+     * @return the eTag
+     */
+    public String getETag() {
+        return eTag;
+    }
+    /**
+     * @param tag the eTag to set
+     */
+    public void setETag(String tag) {
+        eTag = tag;
+        enabled = true;
+    }
+    /**
+     * The LastModified date is the time the item was last 
+     * changed. See HTTP specification for how ETags work:
+     * http://tools.ietf.org/html/rfc2616
+     * @return the lastModified
+     */
+    public String getLastModified() {
+        return lastModified;
+    }
+    /**
+     * The LastModified date is the time the item was last 
+     * changed. See HTTP specification for how ETags work:
+     * http://tools.ietf.org/html/rfc2616
+     * @return the lastModified
+     */
+    public Date getLastModifiedAsDate() {
+        return lastModifiedDate;
+    }
+    /**
+     * @param lastModified the lastModified to set
+     */
+    public void setLastModified(String lastModified) throws java.text.ParseException {
+        this.lastModified = lastModified;
+        // Catch date formatting on input to help debugging.
+        lastModifiedDate = RFC822DateFormat.parse( lastModified );
+        enabled = true;
+    }
+
+    /**
+     * @param lastModified the lastModified to set
+     */
+    public void setLastModified(Date updated) {
+        this.lastModified = RFC822DateFormat.format( updated );
+        lastModifiedDate = updated;
+        enabled = true;
+    }
+
+    /**
+     * @return the ifModifedSince
+     */
+    public boolean isIfModifiedSince() {
+        return ifModifiedSince;
+    }
+    /**
+     * @param ifModifedSince the ifModifedSince to set
+     */
+    public void setIfModifiedSince(boolean ifModifiedSince) {
+        this.ifModifiedSince = ifModifiedSince;
+        if ( ifModifiedSince )
+            enabled = true;
+    }
+    /**
+     * @return the ifUnModifiedSince
+     */
+    public boolean isIfUnmodifiedSince() {
+        return ifUnmodifiedSince;
+    }
+    /**
+     * @param ifUnModifiedSince the ifUnModifiedSince to set
+     */
+    public void setIfUnmodifiedSince(boolean ifUnmodifiedSince) {
+        this.ifUnmodifiedSince = ifUnmodifiedSince;
+        if ( ifUnmodifiedSince )
+            enabled = true;
+    }
+    /**
+     * @return the ifMatch
+     */
+    public boolean isIfMatch() {
+        return ifMatch;
+    }
+    /**
+     * @param ifMatch the ifMatch to set
+     */
+    public void setIfMatch(boolean ifMatch) {
+        this.ifMatch = ifMatch;
+        if ( ifMatch )
+            enabled = true;
+    }
+    /**
+     * @return the ifNoneMatch
+     */
+    public boolean isIfNoneMatch() {
+        return ifNoneMatch;
+    }
+    /**
+     * @param ifNoneMatch the ifNoneMatch to set
+     */
+    public void setIfNoneMatch(boolean ifNoneMatch) {
+        this.ifNoneMatch = ifNoneMatch;
+        if ( ifNoneMatch )
+            enabled = true;
+    }
+    /**
+     * @return the ifRange
+     */
+    public boolean isIfRange() {
+        return ifRange;
+    }
+    /**
+     * @param ifRange the ifRange to set
+     */
+    public void setIfRange(boolean ifRange) {
+        this.ifRange = ifRange;
+        if ( ifRange )
+            enabled = true;
+    }
+
+    public String toString() {
+        final String PREDPREFIX = ", predicates=";
+        StringBuffer sb = new StringBuffer(PREDPREFIX);
+        if ( ifMatch || ifNoneMatch || ifModifiedSince || ifUnmodifiedSince || ifRange ) {
+            if ( ifMatch ) {
+                if ( sb.length() > PREDPREFIX.length() ) sb.append( ", ");
+                sb.append("If-Match");
+            }
+            if ( ifNoneMatch ) {
+                if ( sb.length() > PREDPREFIX.length() ) sb.append( ", ");
+                sb.append("If-None-Match");
+            }
+            if ( ifModifiedSince ) {
+                if ( sb.length() > PREDPREFIX.length() ) sb.append( ", ");
+                sb.append("If-Modified-Since");
+            }
+            if ( ifUnmodifiedSince ) {
+                if ( sb.length() > PREDPREFIX.length() ) sb.append( ", ");
+                sb.append("If-UnModified-Since");
+            }
+            if ( ifRange ) {
+                if ( sb.length() > PREDPREFIX.length() ) sb.append( ", ");
+                sb.append("If-Range");
+            }
+        } else {
+            sb.append("null");
+        }
+
+        return "eTag=" + eTag + ", lastModified=" + lastModified
+        + sb.toString();
+    }
+
+    /**
+     * Gets the cache context information (ETag, LastModified, predicates) from the Http request.
+     * @param request
+     * @return
+     */
+    public static HTTPCacheContext getCacheContextFromRequest( HttpServletRequest request ) throws java.text.ParseException {
+        HTTPCacheContext context = new HTTPCacheContext();
+
+        String eTag = request.getHeader( "If-Match" );    	
+        if ( eTag != null ) {
+            context.setETag( eTag );
+            context.setIfMatch( true );
+        }
+        eTag = request.getHeader( "If-None-Match" );    	
+        if ( eTag != null ) {
+            context.setETag( eTag );
+            context.setIfNoneMatch( true );
+        }
+        String lastModifiedString = request.getHeader( "If-Modified-Since" );        
+        if ( lastModifiedString != null ) {
+            context.setLastModified( lastModifiedString );
+            context.setIfModifiedSince( true );
+        }
+        lastModifiedString = request.getHeader( "If-Unmodified-Since" );        
+        if ( lastModifiedString != null ) {
+            context.setLastModified( lastModifiedString );
+            context.setIfUnmodifiedSince( true );
+        }
+        lastModifiedString = request.getHeader( "If-Range" );        
+        if ( lastModifiedString != null ) {
+            context.setLastModified( lastModifiedString );
+            context.setIfRange( true );
+        }
+        return context;
+    }
+    /**
+     * Enabled is true whenever ETag, LastModified, or predicate is set.
+     * @return the enabled
+     */
+    public boolean isEnabled() {
+        return enabled;
+    }
+    /**
+     * @param enabled the enabled to set
+     */
+    public void setEnabled(boolean enabled) {
+        this.enabled = enabled;
+    }
+}

Propchange: tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/http/HTTPCacheContext.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/http/HTTPCacheContext.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/http/impl/HTTPBindingFactoryImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/http/impl/HTTPBindingFactoryImpl.java?rev=937841&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/http/impl/HTTPBindingFactoryImpl.java (added)
+++ tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/http/impl/HTTPBindingFactoryImpl.java Sun Apr 25 17:51:08 2010
@@ -0,0 +1,36 @@
+/*
+ * 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.binding.http.impl;
+
+import org.apache.tuscany.sca.binding.http.HTTPBinding;
+import org.apache.tuscany.sca.binding.http.HTTPBindingFactory;
+
+/**
+ * Factory for the HTTP binding model.
+ *
+ * @version $Rev$ $Date$
+ */
+public class HTTPBindingFactoryImpl implements HTTPBindingFactory {
+
+    public HTTPBinding createHTTPBinding() {
+        return new HTTPBindingImpl();
+    }
+
+}

Propchange: tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/http/impl/HTTPBindingFactoryImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/http/impl/HTTPBindingFactoryImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/http/impl/HTTPBindingImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/http/impl/HTTPBindingImpl.java?rev=937841&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/http/impl/HTTPBindingImpl.java (added)
+++ tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/http/impl/HTTPBindingImpl.java Sun Apr 25 17:51:08 2010
@@ -0,0 +1,100 @@
+/*
+ * 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.binding.http.impl;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.assembly.OperationSelector;
+import org.apache.tuscany.sca.assembly.WireFormat;
+import org.apache.tuscany.sca.binding.http.HTTPBinding;
+
+
+/**
+ * Implementation of the HTTP binding model.
+ * 
+ * @version $Rev$ $Date$
+ */
+class HTTPBindingImpl implements HTTPBinding {
+
+    private String name;
+    private String uri;
+
+    private WireFormat wireFormat;
+    private OperationSelector operationSelector;    
+
+    public QName getType() {
+        return TYPE;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public String getURI() {
+        return uri;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public void setURI(String uri) {
+        this.uri = uri;
+    }
+
+    public boolean isUnresolved() {
+        return false;
+    }
+
+    public void setUnresolved(boolean unresolved) {
+        // The sample binding is always resolved
+    }
+
+    // Wireformat and Operation selection
+
+    public WireFormat getRequestWireFormat() {
+        return wireFormat;
+    }
+
+    public void setRequestWireFormat(WireFormat wireFormat) {
+        this.wireFormat = wireFormat;
+    }
+
+    public WireFormat getResponseWireFormat() {
+        return wireFormat;
+    }
+
+    public void setResponseWireFormat(WireFormat wireFormat) {
+        this.wireFormat = wireFormat;
+    }    
+
+    public OperationSelector getOperationSelector() {
+        return operationSelector;
+    }
+
+    public void setOperationSelector(OperationSelector operationSelector) {
+        this.operationSelector = operationSelector;
+    }    
+
+    @Override
+    public Object clone() throws CloneNotSupportedException {
+        return super.clone();
+    }     
+}

Propchange: tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/http/impl/HTTPBindingImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/http/impl/HTTPBindingImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/http/xml/HTTPBindingProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/http/xml/HTTPBindingProcessor.java?rev=937841&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/http/xml/HTTPBindingProcessor.java (added)
+++ tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/http/xml/HTTPBindingProcessor.java Sun Apr 25 17:51:08 2010
@@ -0,0 +1,142 @@
+/*
+ * 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.binding.http.xml;
+
+import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
+import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
+
+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.OperationSelector;
+import org.apache.tuscany.sca.assembly.WireFormat;
+import org.apache.tuscany.sca.binding.http.HTTPBinding;
+import org.apache.tuscany.sca.binding.http.HTTPBindingFactory;
+import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
+import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
+import org.apache.tuscany.sca.contribution.processor.ProcessorContext;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.StAXAttributeProcessor;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+
+public class HTTPBindingProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<HTTPBinding> {
+    private static final String NAME = "name";
+    private static final String URI = "uri";
+
+    private HTTPBindingFactory httpBindingFactory;
+    private StAXArtifactProcessor<Object> extensionProcessor;
+    private StAXAttributeProcessor<Object> extensionAttributeProcessor;
+    
+
+    public HTTPBindingProcessor(ExtensionPointRegistry extensionPoints, 
+                                StAXArtifactProcessor extensionProcessor,
+                                StAXAttributeProcessor extensionAttributeProcessor) {
+        FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
+        this.httpBindingFactory = modelFactories.getFactory(HTTPBindingFactory.class);
+        this.extensionProcessor = (StAXArtifactProcessor<Object>)extensionProcessor;
+        this.extensionAttributeProcessor = extensionAttributeProcessor;
+    }
+
+    public QName getArtifactType() {
+        return HTTPBinding.TYPE;
+    }
+
+    public Class<HTTPBinding> getModelType() {
+        return HTTPBinding.class;
+    }
+
+    public HTTPBinding read(XMLStreamReader reader, ProcessorContext context) throws ContributionReadException, XMLStreamException {
+        HTTPBinding httpBinding = httpBindingFactory.createHTTPBinding();
+
+        while(reader.hasNext()) {
+            QName elementName = null;
+            int event = reader.getEventType();
+            switch (event) {
+                case START_ELEMENT:
+                    elementName = reader.getName();
+
+                    if (HTTPBinding.TYPE.equals(elementName)) {
+                        String name = getString(reader, NAME);
+                        if(name != null) {
+                            httpBinding.setName(name);
+                        }
+
+                        String uri = getURIString(reader, URI);
+                        if (uri != null) {
+                            httpBinding.setURI(uri);
+                        }
+                    } else {
+                        // Read an extension element
+                        Object extension = extensionProcessor.read(reader, context);
+                        if (extension != null) {
+                            if (extension instanceof WireFormat) {
+                                httpBinding.setRequestWireFormat((WireFormat)extension);
+                            } else if(extension instanceof OperationSelector) {
+                                httpBinding.setOperationSelector((OperationSelector)extension);
+                            }
+                        }
+                    }
+            }
+
+            if (event == END_ELEMENT && HTTPBinding.TYPE.equals(reader.getName())) {
+                break;
+            }
+
+            // Read the next element
+            if (reader.hasNext()) {
+                reader.next();
+            }
+        }
+
+        return httpBinding;
+    }
+
+    public void write(HTTPBinding httpBinding, XMLStreamWriter writer, ProcessorContext context) throws ContributionWriteException, XMLStreamException {
+        //writer.writeStartElement(Constants.SCA10_NS, BINDING_HTTP);
+
+        writeStart(writer, HTTPBinding.TYPE.getNamespaceURI(), HTTPBinding.TYPE.getLocalPart());
+
+        // Write binding name
+        if (httpBinding.getName() != null) {
+            writer.writeAttribute(NAME, httpBinding.getName());
+        }
+
+        // Write binding URI
+        if (httpBinding.getURI() != null) {
+            writer.writeAttribute(URI, httpBinding.getURI());
+        }
+
+        writeEnd(writer);
+        //writer.writeEndElement();
+    }
+
+
+    public void resolve(HTTPBinding model, ModelResolver resolver, ProcessorContext context) throws ContributionResolveException {
+        // Should not need to do anything here for now... 
+
+    }
+
+}

Propchange: tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/http/xml/HTTPBindingProcessor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/java/org/apache/tuscany/sca/binding/http/xml/HTTPBindingProcessor.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.http.HTTPBindingFactory
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.http.HTTPBindingFactory?rev=937841&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.http.HTTPBindingFactory (added)
+++ tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.binding.http.HTTPBindingFactory Sun Apr 25 17:51:08 2010
@@ -0,0 +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.http.impl.HTTPBindingFactoryImpl
+

Added: tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor?rev=937841&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor (added)
+++ tuscany/sca-java-2.x/trunk/modules/binding-rest/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor Sun Apr 25 17:51:08 2010
@@ -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.binding.http.xml.HTTPBindingProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#binding.http,model=org.apache.tuscany.sca.binding.http.HTTPBinding,factory=org.apache.tuscany.sca.binding.http.HTTPBindingFactory

Modified: tuscany/sca-java-2.x/trunk/modules/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/pom.xml?rev=937841&r1=937840&r2=937841&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/pom.xml (original)
+++ tuscany/sca-java-2.x/trunk/modules/pom.xml Sun Apr 25 17:51:08 2010
@@ -48,6 +48,8 @@
         <module>binding-jsonrpc</module>        
         <module>binding-jsonrpc-js-dojo</module>        
         <module>binding-jsonrpc-runtime</module>
+        <module>binding-rest</module>
+        <module>binding-rest-runtime</module>
         <module>binding-rmi</module>
         <module>binding-rmi-runtime</module>
         <module>binding-rss</module>