cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1431342 - in /cxf/trunk: parent/ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/spec/ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ rt/frontend/jaxrs/src/main/...
Date Thu, 10 Jan 2013 13:17:31 GMT
Author: sergeyb
Date: Thu Jan 10 13:17:30 2013
New Revision: 1431342

URL: http://svn.apache.org/viewvc?rev=1431342&view=rev
Log:
[CXF-4743] Upgrading to javax.ws.rs m15

Modified:
    cxf/trunk/parent/pom.xml
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientRequestContextImpl.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/AbstractInterceptorContextImpl.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/AbstractPropertiesImpl.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/AsyncResponseImpl.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResourceContextImpl.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResponseImpl.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java
    cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/AbstractJAXRSContinuationsTest.java
    cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookContinuationStore.java
    cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer20.java
    cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java

Modified: cxf/trunk/parent/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/parent/pom.xml?rev=1431342&r1=1431341&r2=1431342&view=diff
==============================================================================
--- cxf/trunk/parent/pom.xml (original)
+++ cxf/trunk/parent/pom.xml Thu Jan 10 13:17:30 2013
@@ -110,7 +110,7 @@
         <cxf.geronimo.servlet25.version>1.1.2</cxf.geronimo.servlet25.version>
         <cxf.geronimo.transaction.version>1.1.1</cxf.geronimo.transaction.version>
         <cxf.geronimo.ws.metadata.version>1.1.3</cxf.geronimo.ws.metadata.version>
-        <cxf.javax.ws.rs.version>2.0-m10</cxf.javax.ws.rs.version>
+        <cxf.javax.ws.rs.version>2.0-m15</cxf.javax.ws.rs.version>
         <cxf.jaxb21.version>2.1</cxf.jaxb21.version>
         <cxf.jaxb21.impl.version>2.1.13</cxf.jaxb21.impl.version>
         <cxf.jaxb21.xjc.version>2.1.13</cxf.jaxb21.xjc.version>

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java?rev=1431342&r1=1431341&r2=1431342&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java Thu Jan
10 13:17:30 2013
@@ -199,12 +199,8 @@ public class JAXRSInvoker extends Abstra
                 asyncResponse = (AsyncResponseImpl)inMessage.get(AsyncResponse.class);
             }
             result = invoke(exchange, resourceObject, methodToInvoke, params);
-            if (asyncResponse != null) {
-                if (!asyncResponse.isSuspended() && !asyncResponse.isResumedByApplication())
{
-                    asyncResponse.suspendContinuation();
-                } else {
-                    result = handleAsyncResponse(exchange, asyncResponse.getResponseObject());
-                }
+            if (asyncResponse != null && !asyncResponse.suspendContinuationIfNeeded())
{
+                result = handleAsyncResponse(exchange, asyncResponse.getResponseObject());
             }
         } catch (Fault ex) {
             return handleFault(ex, inMessage, cri, methodToInvoke);

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientRequestContextImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientRequestContextImpl.java?rev=1431342&r1=1431341&r2=1431342&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientRequestContextImpl.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientRequestContextImpl.java
Thu Jan 10 13:17:30 2013
@@ -27,7 +27,7 @@ import java.util.Map;
 
 import javax.ws.rs.client.Client;
 import javax.ws.rs.client.ClientRequestContext;
-import javax.ws.rs.client.Configuration;
+import javax.ws.rs.core.Configuration;
 import javax.ws.rs.core.HttpHeaders;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.MultivaluedMap;

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/AbstractInterceptorContextImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/AbstractInterceptorContextImpl.java?rev=1431342&r1=1431341&r2=1431342&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/AbstractInterceptorContextImpl.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/AbstractInterceptorContextImpl.java
Thu Jan 10 13:17:30 2013
@@ -75,6 +75,4 @@ public class AbstractInterceptorContextI
     public void setType(Class<?> ctype) {
         cls = ctype;
     }
-
-    
 }

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/AbstractPropertiesImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/AbstractPropertiesImpl.java?rev=1431342&r1=1431341&r2=1431342&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/AbstractPropertiesImpl.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/AbstractPropertiesImpl.java
Thu Jan 10 13:17:30 2013
@@ -18,9 +18,9 @@
  */
 package org.apache.cxf.jaxrs.impl;
 
-import java.util.Enumeration;
+import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.Map;
 
 import org.apache.cxf.helpers.CastUtils;
@@ -37,29 +37,10 @@ public abstract class AbstractProperties
         this.props = CastUtils.cast((Map<?, ?>)message.get(PROPERTY_KEY));
     }
     
-    
     public Object getProperty(String name) {
         return props == null ? null : props.get(name);
     }
 
-    public Enumeration<String> getPropertyNames() {
-        final Iterator<String> it = props.keySet().iterator();
-        return new Enumeration<String>() {
-
-            @Override
-            public boolean hasMoreElements() {
-                return it.hasNext();
-            }
-
-            @Override
-            public String nextElement() {
-                return it.next();
-            }
-            
-        };
-    }
-
-
     public void removeProperty(String name) {
         if (props != null) {
             props.remove(name);    
@@ -76,4 +57,8 @@ public abstract class AbstractProperties
         
     }
 
+    public Collection<String> getPropertyNames() {
+        return props == null ? Collections.<String>emptyList() 
+            : Collections.unmodifiableSet(props.keySet());
+    }
 }

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/AsyncResponseImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/AsyncResponseImpl.java?rev=1431342&r1=1431341&r2=1431342&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/AsyncResponseImpl.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/AsyncResponseImpl.java
Thu Jan 10 13:17:30 2013
@@ -24,7 +24,6 @@ import java.util.concurrent.TimeUnit;
 import javax.ws.rs.ServiceUnavailableException;
 import javax.ws.rs.container.AsyncResponse;
 import javax.ws.rs.container.CompletionCallback;
-import javax.ws.rs.container.ResumeCallback;
 import javax.ws.rs.container.TimeoutHandler;
 import javax.ws.rs.core.HttpHeaders;
 import javax.ws.rs.core.Response;
@@ -59,18 +58,23 @@ public class AsyncResponseImpl implement
     }
     
     @Override
-    public void resume(Object response) throws IllegalStateException {
-        doResume(response);
+    public boolean resume(Object response) {
+        return doResume(response);
     }
 
     @Override
-    public void resume(Throwable response) throws IllegalStateException {
-        doResume(response);
+    public boolean resume(Throwable response) {
+        return doResume(response);
     }
     
-    private synchronized void doResume(Object response) throws IllegalStateException {
-        checkCancelled();
-        checkSuspended();
+    private boolean isCancelledOrNotSuspended() {
+        return isCancelled() || !isSuspended();
+    }
+    
+    private synchronized boolean doResume(Object response) {
+        if (isCancelledOrNotSuspended()) {
+            return false;
+        }
         inMessage.getExchange().put(AsyncResponse.class, this);
         cont.setObject(response);
         resumedByApplication = true;
@@ -79,36 +83,40 @@ public class AsyncResponseImpl implement
         } else {
             initialSuspend = false;
         }
+        return true;
     }
     
     @Override
-    public void cancel() {
-        doCancel(null);
+    public boolean cancel() {
+        return doCancel(null);
     }
 
     @Override
-    public void cancel(int retryAfter) {
-        doCancel(Integer.toString(retryAfter));
+    public boolean cancel(int retryAfter) {
+        return doCancel(Integer.toString(retryAfter));
     }
 
     @Override
-    public void cancel(Date retryAfter) {
-        doCancel(HttpUtils.getHttpDateFormat().format(retryAfter));
+    public boolean cancel(Date retryAfter) {
+        return doCancel(HttpUtils.getHttpDateFormat().format(retryAfter));
     }
     
-    private synchronized void doCancel(String retryAfterHeader) {
-        checkSuspended();
+    private synchronized boolean doCancel(String retryAfterHeader) {
+        if (!isSuspended()) {
+            return false;
+        }
         ResponseBuilder rb = Response.status(503);
         if (retryAfterHeader != null) {
             rb.header(HttpHeaders.RETRY_AFTER, retryAfterHeader);
         }
         doResume(rb.build());
         cancelled = true;
+        return cancelled;
     }
 
     @Override
     public synchronized boolean isSuspended() {
-        return cont.isPending();
+        return initialSuspend || cont.isPending();
     }
 
     @Override
@@ -123,8 +131,9 @@ public class AsyncResponseImpl implement
 
     @Override
     public synchronized void setTimeout(long time, TimeUnit unit) throws IllegalStateException
{
-        checkCancelled();
-        checkSuspended();
+        if (isCancelledOrNotSuspended()) {
+            throw new IllegalStateException();
+        }
         inMessage.getExchange().put(AsyncResponse.class, this);
         long timeout = TimeUnit.MILLISECONDS.convert(time, unit);
         initialSuspend = false;
@@ -154,7 +163,7 @@ public class AsyncResponseImpl implement
     //TODO: API bug, boolean[] needs to be returned...
     @Override
     public boolean register(Object callback) throws NullPointerException {
-        return register(callback, CompletionCallback.class, ResumeCallback.class)[0];
+        return register(callback, CompletionCallback.class)[0];
     }
 
     //TODO: API bug, has to be Class<?>...
@@ -178,23 +187,11 @@ public class AsyncResponseImpl implement
         return result;
     }
     
-    private void checkCancelled() {
-        if (cancelled) {
-            throw new IllegalStateException();
-        }
-    }
-    
-    private void checkSuspended() {
-        if (!initialSuspend && !isSuspended()) {
-            throw new IllegalStateException();
-        }
-    }
-    
     @Override
     public void onComplete() {
         done = true;
         if (completionCallback != null) {
-            completionCallback.onComplete();
+            completionCallback.onComplete(null);
         }
     }
 
@@ -202,14 +199,19 @@ public class AsyncResponseImpl implement
     public void onError(Throwable error) {
         if (completionCallback != null) {
             Throwable actualError = error instanceof Fault ? ((Fault)error).getCause() :
error;
-            completionCallback.onError(actualError);
+            completionCallback.onComplete(actualError);
         }
         
     }
     
-    public synchronized void suspendContinuation() {
-        initialSuspend = false;
-        cont.suspend(AsyncResponse.NO_TIMEOUT);
+    public synchronized boolean suspendContinuationIfNeeded() {
+        if (!cont.isPending() && !resumedByApplication) {
+            initialSuspend = false;
+            cont.suspend(AsyncResponse.NO_TIMEOUT);
+            return true;
+        } else {
+            return false;
+        }
     }
     
     public synchronized Object getResponseObject() {

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResourceContextImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResourceContextImpl.java?rev=1431342&r1=1431341&r2=1431342&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResourceContextImpl.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResourceContextImpl.java
Thu Jan 10 13:17:30 2013
@@ -18,11 +18,8 @@
  */
 package org.apache.cxf.jaxrs.impl;
 
-import java.net.URI;
-
 import javax.ws.rs.InternalServerErrorException;
 import javax.ws.rs.container.ResourceContext;
-import javax.ws.rs.core.UriInfo;
 
 import org.apache.cxf.jaxrs.model.ClassResourceInfo;
 import org.apache.cxf.jaxrs.model.OperationResourceInfo;
@@ -56,21 +53,4 @@ public class ResourceContextImpl impleme
         cri.getSubResource(subClass, cls, resource, true);
         return resource;
     }
-
-    @Override
-    public Object matchResource(URI arg0) throws NullPointerException, IllegalArgumentException
{
-        return null;
-    }
-
-    @Override
-    public <T> T matchResource(URI arg0, Class<T> arg1) throws NullPointerException,
-        IllegalArgumentException, ClassCastException {
-        return null;
-    }
-
-    @Override
-    public UriInfo matchUriInfo(URI arg0) throws NullPointerException, IllegalArgumentException
{
-        return null;
-    }
-
 }

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResponseImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResponseImpl.java?rev=1431342&r1=1431341&r2=1431342&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResponseImpl.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResponseImpl.java
Thu Jan 10 13:17:30 2013
@@ -124,7 +124,7 @@ public final class ResponseImpl extends 
     }
 
     public boolean hasEntity() {
-        return getEntity() != null;
+        return entity != null;
     }
     
     public MultivaluedMap<String, Object> getMetadata() {

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java?rev=1431342&r1=1431341&r2=1431342&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
Thu Jan 10 13:17:30 2013
@@ -432,7 +432,7 @@ public class UriBuilderImpl extends UriB
     }
 
     @Override
-    public UriBuilder path(Class<?> resource) throws IllegalArgumentException {
+    public UriBuilder path(@SuppressWarnings("rawtypes") Class resource) throws IllegalArgumentException
{
         if (resource == null) {
             throw new IllegalArgumentException("resource is null");
         }
@@ -447,7 +447,7 @@ public class UriBuilderImpl extends UriB
     }
 
     @Override
-    public UriBuilder path(Class<?> resource, String method) 
+    public UriBuilder path(@SuppressWarnings("rawtypes") Class resource, String method) 
         throws IllegalArgumentException {
         if (resource == null) {
             throw new IllegalArgumentException("resource is null");
@@ -861,19 +861,23 @@ public class UriBuilderImpl extends UriB
         return buildUriString(parts.path, parts.query, parts.fragment);
     }
     
+    @Override
     public UriBuilder resolveTemplate(String name, Object value) throws IllegalArgumentException
{
         return resolveTemplate(name, value, true);
     }
     
+    @Override
     public UriBuilder resolveTemplate(String name, Object value, boolean encodePathSlash)

         throws IllegalArgumentException {
         return resolveTemplates(Collections.singletonMap(name, value), encodePathSlash);
     }
     
+    @Override
     public UriBuilder resolveTemplates(Map<String, Object> values) throws IllegalArgumentException
{
         return resolveTemplates(values, true);
     }
     
+    @Override
     public UriBuilder resolveTemplates(Map<String, Object> values, boolean encodePathSlash)

         throws IllegalArgumentException {
         if (encodePathSlash) {
@@ -884,10 +888,12 @@ public class UriBuilderImpl extends UriB
         return this;
     }
     
+    @Override
     public UriBuilder resolveTemplateFromEncoded(String name, Object value) throws IllegalArgumentException
{
         return resolveTemplatesFromEncoded(Collections.singletonMap(name, value));
     }
     
+    @Override
     public UriBuilder resolveTemplatesFromEncoded(Map<String, Object> values) 
         throws IllegalArgumentException {
         resolvedEncodedTemplates = fillInResolveTemplates(resolvedEncodedTemplates, values);

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java?rev=1431342&r1=1431341&r2=1431342&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
Thu Jan 10 13:17:30 2013
@@ -40,6 +40,7 @@ import java.util.logging.Logger;
 
 import javax.ws.rs.BindingPriority;
 import javax.ws.rs.Produces;
+import javax.ws.rs.RuntimeType;
 import javax.ws.rs.client.ClientRequestFilter;
 import javax.ws.rs.client.ClientResponseFilter;
 import javax.ws.rs.container.ContainerRequestFilter;
@@ -47,8 +48,9 @@ import javax.ws.rs.container.ContainerRe
 import javax.ws.rs.container.DynamicFeature;
 import javax.ws.rs.container.PreMatching;
 import javax.ws.rs.core.Application;
-import javax.ws.rs.core.Configurable;
+import javax.ws.rs.core.Configuration;
 import javax.ws.rs.core.Feature;
+import javax.ws.rs.core.FeatureContext;
 import javax.ws.rs.core.HttpHeaders;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.ext.ContextResolver;
@@ -1173,7 +1175,7 @@ public final class ProviderFactory {
         Set<OperationResourceInfo> oris = cri.getMethodDispatcher().getOperationResourceInfos();
         for (OperationResourceInfo ori : oris) {
             for (DynamicFeature feature : dynamicFeatures) {
-                Configurable methodConfigurable = new MethodConfigurable(ori);
+                FeatureContext methodConfigurable = new MethodConfigurable(ori);
                 feature.configure(new ResourceInfoImpl(ori), methodConfigurable);
             }
         }
@@ -1379,7 +1381,7 @@ public final class ProviderFactory {
         }
     }
     
-    private class MethodConfigurable implements Configurable {
+    private class MethodConfigurable implements FeatureContext, Configuration {
         
         private OperationResourceInfo ori;
         private String nameBinding;
@@ -1393,49 +1395,77 @@ public final class ProviderFactory {
                 + ori.getMethodToInvoke().getName();
         }
         
+
+        @Override
+        public Configuration getConfiguration() {
+            return this;
+        }
+        
         @Override
-        public Configurable register(Object provider) {
+        public FeatureContext register(Object provider) {
             return register(provider, AnnotationUtils.getBindingPriority(provider.getClass()));
         }
 
         @Override
-        public Configurable register(Object provider, int bindingPriority) {
+        public FeatureContext register(Object provider, int bindingPriority) {
             return doRegister(provider, bindingPriority, FILTER_INTERCEPTOR_CLASSES);
         }
         
         @Override
-        public <T> Configurable register(Object provider, Class<? super T>...
contracts) {
+        public FeatureContext register(Object provider, Class<?>... contracts) {
             return register(provider, BindingPriority.USER, contracts);
         }
         
+        //@Override
+        public FeatureContext register(Object provider, int priority, Class<?>... contracts)
{
+            return register(provider, priority, contracts);
+        }
+        
         @Override
-        public <T> Configurable register(Object provider, int bindingPriority, Class<?
super T>... contracts) {
-            return doRegister(provider, bindingPriority, contracts);
+        public FeatureContext register(Object provider, Map<Class<?>, Integer>
contracts) {
+            for (Map.Entry<Class<?>, Integer> entry : contracts.entrySet()) {
+                doRegister(provider, entry.getValue(), entry.getKey());
+            }
+            return this;
         }
         
         @Override
-        public Configurable register(Class<?> providerClass) {
+        public FeatureContext register(Class<?> providerClass) {
             return register(providerClass, AnnotationUtils.getBindingPriority(providerClass));
         }
 
         @Override
-        public Configurable register(Class<?> providerClass, int bindingPriority) {
+        public FeatureContext register(Class<?> providerClass, int bindingPriority)
{
             return doRegister(createProvider(providerClass), bindingPriority, 
                               FILTER_INTERCEPTOR_CLASSES);
         }
 
         @Override
-        public <T> Configurable register(Class<T> providerClass, Class<? super
T>... contracts) {
+        public FeatureContext register(Class<?> providerClass, Class<?>... contracts)
{
             return register(providerClass, BindingPriority.USER, contracts);
         }
 
         @Override
-        public <T> Configurable register(Class<T> providerClass, int bindingPriority,
-                                         Class<? super T>... contracts) {
+        public FeatureContext register(Class<?> providerClass, Map<Class<?>,
Integer> contracts) {
+            Object provider = createProvider(providerClass);
+            for (Map.Entry<Class<?>, Integer> entry : contracts.entrySet()) {
+                doRegister(provider, entry.getValue(), entry.getKey());
+            }
+            return this;
+        }
+        
+        public FeatureContext replaceWith(Configuration config) {
+            // nothing to do in this case
+            return this;
+        }
+        
+        //@Override
+        public FeatureContext register(Class<?> providerClass, int bindingPriority,
+                                         Class<?>... contracts) {
             return doRegister(createProvider(providerClass), bindingPriority, contracts);
         }
         
-        private Configurable doRegister(Object provider, int bindingPriority, Class<?>...
contracts) {
+        private FeatureContext doRegister(Object provider, int bindingPriority, Class<?>...
contracts) {
         
             if (provider instanceof Feature) {
                 ((Feature)provider).configure(this);
@@ -1551,19 +1581,19 @@ public final class ProviderFactory {
         }
         
         @Override
-        public Collection<Feature> getFeatures() {
+        public Set<Class<?>> getClasses() {
             // TODO Auto-generated method stub
             return null;
         }
-
+        
         @Override
-        public Set<Class<?>> getProviderClasses() {
+        public Map<Class<?>, Integer> getContracts(Class<?> componentClass)
{
             // TODO Auto-generated method stub
             return null;
         }
 
         @Override
-        public Set<Object> getProviderInstances() {
+        public Set<Object> getInstances() {
             // TODO Auto-generated method stub
             return null;
         }
@@ -1575,19 +1605,44 @@ public final class ProviderFactory {
         }
 
         @Override
+        public boolean isEnabled(Feature feature) {
+            return false;
+        }
+        
+        @Override
+        public boolean isEnabled(Class<? extends Feature> featureClass) {
+            return false;
+        }
+        
+        @Override
+        public RuntimeType getRuntimeType() {
+            return null;
+        }
+        
+        @Override
         public Object getProperty(String name) {
             // TODO Auto-generated method stub
             return null;
         }
-
+        
         @Override
-        public Configurable setProperties(Map<String, ?> properties) {
+        public Collection<String> getPropertyNames() {
             // TODO Auto-generated method stub
             return null;
         }
 
         @Override
-        public Configurable setProperty(String name, Object value) {
+        public boolean isRegistered(Class<?> componentClass) {
+            return false;
+        }
+        
+        @Override
+        public boolean isRegistered(Object component) {
+            return false;
+        }
+        
+        @Override
+        public FeatureContext setProperty(String name, Object value) {
             // TODO Auto-generated method stub
             return null;
         }

Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java?rev=1431342&r1=1431341&r2=1431342&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java
Thu Jan 10 13:17:30 2013
@@ -42,28 +42,28 @@ public class UriBuilderImplTest extends 
     @Test
     public void testResolveTemplate() {
         URI uri;
-        uri = ((UriBuilderImpl)UriBuilder.fromPath("/{a}")).resolveTemplate("a", "1").build();
+        uri = UriBuilder.fromPath("/{a}").resolveTemplate("a", "1").build();
         assertEquals("/1", uri.toString());        
     }
     
     @Test
     public void testResolveTemplate2() {
         URI uri;
-        uri = ((UriBuilderImpl)UriBuilder.fromPath("/{a}/{b}")).resolveTemplate("a", "1").build("2");
+        uri = UriBuilder.fromPath("/{a}/{b}").resolveTemplate("a", "1").build("2");
         assertEquals("/1/2", uri.toString());        
     }
     
     @Test
     public void testResolveTemplate3() {
         URI uri;
-        uri = ((UriBuilderImpl)UriBuilder.fromPath("/{a}/{b}")).resolveTemplate("b", "1").build("2");
+        uri = UriBuilder.fromPath("/{a}/{b}").resolveTemplate("b", "1").build("2");
         assertEquals("/2/1", uri.toString());        
     }
     
     @Test
     public void testResolveTemplate4() {
         URI uri;
-        uri = ((UriBuilderImpl)UriBuilder.fromPath("/{a}/{b}").queryParam("c", "{c}"))
+        uri = UriBuilder.fromPath("/{a}/{b}").queryParam("c", "{c}")
             .resolveTemplate("a", "1").build("2", "3");
         assertEquals("/1/2?c=3", uri.toString());        
     }
@@ -74,7 +74,7 @@ public class UriBuilderImplTest extends 
         templs.put("a", "1");
         templs.put("b", "2");
         URI uri;
-        uri = ((UriBuilderImpl)UriBuilder.fromPath("/{a}/{b}").queryParam("c", "{c}"))
+        uri = UriBuilder.fromPath("/{a}/{b}").queryParam("c", "{c}")
             .resolveTemplates(templs).build("3");
         assertEquals("/1/2?c=3", uri.toString());        
     }
@@ -83,14 +83,14 @@ public class UriBuilderImplTest extends 
     @Test
     public void testResolveTemplateFromEncoded() {
         URI uri;
-        uri = ((UriBuilderImpl)UriBuilder.fromPath("/{a}")).resolveTemplate("a", "%20 ").buildFromEncoded();
+        uri = UriBuilder.fromPath("/{a}").resolveTemplate("a", "%20 ").buildFromEncoded();
         assertEquals("/%20%20", uri.toString());        
     }
     
     @Test
     public void testResolveTemplateFromMap() {
         URI uri;
-        uri = ((UriBuilderImpl)UriBuilder.fromPath("/{a}/{b}")).resolveTemplate("a", "1")
+        uri = UriBuilder.fromPath("/{a}/{b}").resolveTemplate("a", "1")
             .buildFromMap(Collections.singletonMap("b", "2"));
         assertEquals("/1/2", uri.toString());        
     }

Modified: cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/AbstractJAXRSContinuationsTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/AbstractJAXRSContinuationsTest.java?rev=1431342&r1=1431341&r2=1431342&view=diff
==============================================================================
--- cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/AbstractJAXRSContinuationsTest.java
(original)
+++ cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/AbstractJAXRSContinuationsTest.java
Thu Jan 10 13:17:30 2013
@@ -97,7 +97,7 @@ public abstract class AbstractJAXRSConti
         ThreadPoolExecutor executor = new ThreadPoolExecutor(5, 5, 0, TimeUnit.SECONDS,
                                                              new ArrayBlockingQueue<Runnable>(10));
         CountDownLatch startSignal = new CountDownLatch(1);
-        CountDownLatch doneSignal = new CountDownLatch(5);
+        CountDownLatch doneSignal = new CountDownLatch(1);
         
         executor.execute(new BookWorker("http://localhost:" + port + "/bookstore/" + pathSegment
+ "/1", 
                                         "1", 

Modified: cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookContinuationStore.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookContinuationStore.java?rev=1431342&r1=1431341&r2=1431342&view=diff
==============================================================================
--- cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookContinuationStore.java
(original)
+++ cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookContinuationStore.java
Thu Jan 10 13:17:30 2013
@@ -160,15 +160,10 @@ public class BookContinuationStore {
     private class CallbackImpl implements CompletionCallback {
 
         @Override
-        public void onComplete() {
+        public void onComplete(Throwable throwable) {
             System.out.println("CompletionCallback: onComplete");
             
         }
-
-        @Override
-        public void onError(Throwable throwable) {
-            System.out.println("CompletionCallback: onError");
-        }
         
     }
 }

Modified: cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer20.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer20.java?rev=1431342&r1=1431341&r2=1431342&view=diff
==============================================================================
--- cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer20.java
(original)
+++ cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer20.java
Thu Jan 10 13:17:30 2013
@@ -38,8 +38,8 @@ import javax.ws.rs.container.ContainerRe
 import javax.ws.rs.container.DynamicFeature;
 import javax.ws.rs.container.PreMatching;
 import javax.ws.rs.container.ResourceInfo;
-import javax.ws.rs.core.Configurable;
 import javax.ws.rs.core.Context;
+import javax.ws.rs.core.FeatureContext;
 import javax.ws.rs.core.UriInfo;
 import javax.ws.rs.ext.ReaderInterceptor;
 import javax.ws.rs.ext.ReaderInterceptorContext;
@@ -237,7 +237,7 @@ public class BookServer20 extends Abstra
     public static class CustomDynamicFeature implements DynamicFeature {
 
         @Override
-        public void configure(ResourceInfo resourceInfo, Configurable configurable) {
+        public void configure(ResourceInfo resourceInfo, FeatureContext configurable) {
             
             configurable.register(new PreMatchDynamicContainerRequestFilter());
             configurable.register(new PostMatchDynamicContainerResponseFilter());

Modified: cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java?rev=1431342&r1=1431341&r2=1431342&view=diff
==============================================================================
--- cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java
(original)
+++ cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRS20ClientServerBookTest.java
Thu Jan 10 13:17:30 2013
@@ -26,7 +26,6 @@ import java.util.concurrent.ExecutionExc
 import java.util.concurrent.Future;
 
 import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.client.ClientException;
 import javax.ws.rs.client.ClientRequestContext;
 import javax.ws.rs.client.ClientRequestFilter;
 import javax.ws.rs.client.ClientResponseContext;
@@ -139,7 +138,7 @@ public class JAXRS20ClientServerBookTest
             public void completed(Book response) {
                 holder.value = response;
             }
-            public void failed(ClientException error) {
+            public void failed(Throwable error) {
             }
         };
         
@@ -160,7 +159,7 @@ public class JAXRS20ClientServerBookTest
             public void completed(Book response) {
                 holder.value = response;
             }
-            public void failed(ClientException error) {
+            public void failed(Throwable error) {
             }
         };
         
@@ -182,7 +181,7 @@ public class JAXRS20ClientServerBookTest
             public void completed(Response response) {
                 holder.value = response;
             }
-            public void failed(ClientException error) {
+            public void failed(Throwable error) {
             }
         };
         



Mime
View raw message