Skip to content
Permalink
Browse files
[DOSGI-267] Treat all intents annotated with @Provider as providers
  • Loading branch information
Richard Begg committed Jul 13, 2017
1 parent 88b51ef commit bf243bd129d1191c9ba325d5a163d3d29707461f
Showing 1 changed file with 3 additions and 1 deletion.
@@ -32,6 +32,7 @@
import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.MessageBodyReader;
import javax.ws.rs.ext.MessageBodyWriter;
import javax.ws.rs.ext.Provider;

import org.apache.aries.rsa.spi.DistributionProvider;
import org.apache.aries.rsa.spi.Endpoint;
@@ -173,7 +174,8 @@ private void applyIntents(List<Object> intents, AbstractJAXRSFactoryBean factory
}

private boolean isProvider(Object intent) {
return (intent instanceof ExceptionMapper) //
return intent.getClass().getAnnotation(Provider.class) != null //
|| (intent instanceof ExceptionMapper) //
|| (intent instanceof MessageBodyReader) //
|| (intent instanceof MessageBodyWriter) //
|| (intent instanceof ContextResolver) //

0 comments on commit bf243bd

Please sign in to comment.