public WriterInterceptor[] getWriterInterceptors(Class declaring, AccessibleObject target) { return providerFactory.getClientWriterInterceptorRegistry().postMatch(declaring, target); }
public WriterInterceptorRegistry clone(ResteasyProviderFactory factory) { WriterInterceptorRegistry clone = new WriterInterceptorRegistry(factory, precedence); clone.interceptors.addAll(interceptors); return clone; }
public void registerLegacy(Class<? extends MessageBodyWriterInterceptor> decl) { register(new LegacyPerMethodInterceptorFactory(decl, precedence) { @Override public Match postMatch(Class declaring, AccessibleObject target) { Object obj = getLegacyMatch(declaring, target); if (obj == null) return null; MessageBodyWriterInterceptor interceptor = (MessageBodyWriterInterceptor)obj; return new Match(new WriterInterceptorFacade(interceptor), order); } }); }
serverWriterInterceptorRegistry = parent.getServerWriterInterceptorRegistry().clone(this); serverWriterInterceptorRegistry.registerSingleton((WriterInterceptor) provider, priority); clientWriterInterceptorRegistry = parent.getClientWriterInterceptorRegistry().clone(this); clientWriterInterceptorRegistry.registerSingleton((WriterInterceptor) provider, priority); serverWriterInterceptorRegistry = parent.getServerWriterInterceptorRegistry().clone(this); serverWriterInterceptorRegistry.registerSingleton((WriterInterceptor) provider, priority); if (clientWriterInterceptorRegistry == null) clientWriterInterceptorRegistry = parent.getClientWriterInterceptorRegistry().clone(this); clientWriterInterceptorRegistry.registerSingleton((WriterInterceptor) provider, priority); serverWriterInterceptorRegistry = parent.getServerWriterInterceptorRegistry().clone(this); serverWriterInterceptorRegistry.registerLegacy((MessageBodyWriterInterceptor) provider); clientWriterInterceptorRegistry = parent.getClientWriterInterceptorRegistry().clone(this); clientWriterInterceptorRegistry.registerLegacy((MessageBodyWriterInterceptor) provider);
serverWriterInterceptorRegistry = parent.getServerWriterInterceptorRegistry().clone(this); serverWriterInterceptorRegistry.registerClass(provider, priority); clientWriterInterceptorRegistry = parent.getClientWriterInterceptorRegistry().clone(this); clientWriterInterceptorRegistry.registerClass(provider, priority); serverWriterInterceptorRegistry = parent.getServerWriterInterceptorRegistry().clone(this); serverWriterInterceptorRegistry.registerClass(provider, priority); if (clientWriterInterceptorRegistry == null) clientWriterInterceptorRegistry = parent.getClientWriterInterceptorRegistry().clone(this); clientWriterInterceptorRegistry.registerClass(provider, priority); serverWriterInterceptorRegistry = parent.getServerWriterInterceptorRegistry().clone(this); serverWriterInterceptorRegistry.registerLegacy(provider); clientWriterInterceptorRegistry = parent.getClientWriterInterceptorRegistry().clone(this); clientWriterInterceptorRegistry.registerLegacy(provider);
serverWriterInterceptorRegistry = ((ResteasyProviderFactory)parent).getServerWriterInterceptorRegistry().clone(this); ((WriterInterceptorRegistry)serverWriterInterceptorRegistry).registerLegacy((MessageBodyWriterInterceptor) provider); clientWriterInterceptorRegistry = ((ResteasyProviderFactory)parent).getClientWriterInterceptorRegistry().clone(this); ((WriterInterceptorRegistry)clientWriterInterceptorRegistry).registerLegacy((MessageBodyWriterInterceptor) provider);
writerInterceptors = resourceMethodProviderFactory.getServerWriterInterceptorRegistry().postMatch(method.getResourceClass().getClazz(), method.getAnnotatedMethod()); providerFactory.getServerWriterInterceptorRegistry().getListeners().add(this); ContextResolver<GeneralValidator> resolver = providerFactory.getContextResolver(GeneralValidator.class, MediaType.WILDCARD_TYPE); if (resolver != null)
public void cleanup() { parentProviderFactory.getContainerRequestFilterRegistry().getListeners().remove(this); parentProviderFactory.getContainerResponseFilterRegistry().getListeners().remove(this); parentProviderFactory.getServerWriterInterceptorRegistry().getListeners().remove(this); for (ValueInjector param : methodInjector.getParams()) { if (param instanceof MessageBodyParameterInjector) { parentProviderFactory.getServerReaderInterceptorRegistry().getListeners().remove(param); } } }
serverWriterInterceptorRegistry = ((ResteasyProviderFactory)parent).getServerWriterInterceptorRegistry().clone(this); ((WriterInterceptorRegistry)serverWriterInterceptorRegistry).registerLegacy(provider); clientWriterInterceptorRegistry = ((ResteasyProviderFactory)parent).getClientWriterInterceptorRegistry().clone(this); ((WriterInterceptorRegistry)clientWriterInterceptorRegistry).registerLegacy(provider);
public WriterInterceptor[] getWriterInterceptors(Class declaring, AccessibleObject target) { return providerFactory.getClientWriterInterceptorRegistry().postMatch(declaring, target); }
public WriterInterceptorRegistry clone(ResteasyProviderFactory factory) { WriterInterceptorRegistry clone = new WriterInterceptorRegistry(factory, precedence); clone.interceptors.addAll(interceptors); return clone; }
public void registerLegacy(Class<? extends MessageBodyWriterInterceptor> decl) { register(new LegacyPerMethodInterceptorFactory(decl, precedence) { @Override public Match postMatch(Class declaring, AccessibleObject target) { Object obj = getLegacyMatch(declaring, target); if (obj == null) return null; MessageBodyWriterInterceptor interceptor = (MessageBodyWriterInterceptor)obj; return new Match(new WriterInterceptorFacade(interceptor), order); } }); }
public void writeRequestBody(MultivaluedMap<String, Object> headers, OutputStream outputStream) throws IOException { if (body == null) { return; } if (getWriterInterceptorList().isEmpty()) { setWriterInterceptors(providerFactory.getClientWriterInterceptorRegistry().postMatch(null, null)); } new ClientWriterInterceptorContext(getWriterInterceptors(), providerFactory, body, bodyType, bodyGenericType, bodyAnnotations, bodyContentType, headers, outputStream, attributes).proceed(); }
protected void initializeRegistriesAndFilters() { precedence = new LegacyPrecedence(); serverReaderInterceptorRegistry = new ReaderInterceptorRegistry(this, precedence); serverWriterInterceptorRegistry = new WriterInterceptorRegistry(this, precedence); containerRequestFilterRegistry = new ContainerRequestFilterRegistry(this, precedence); containerResponseFilterRegistry = new ContainerResponseFilterRegistry(this, precedence); clientRequestFilters = new JaxrsInterceptorRegistry<ClientRequestFilter>(this, ClientRequestFilter.class); clientResponseFilters = new ClientResponseFilterRegistry(this); clientReaderInterceptorRegistry = new ReaderInterceptorRegistry(this, precedence); clientWriterInterceptorRegistry = new WriterInterceptorRegistry(this, precedence); }
public void registerLegacy(MessageBodyWriterInterceptor interceptor) { register(new LegacySingletonInterceptorFactory(interceptor.getClass(), interceptor, precedence) { @Override public Match postMatch(Class declaring, AccessibleObject target) { Object obj = getLegacyMatch(declaring, target); if (obj == null) return null; MessageBodyWriterInterceptor interceptor = (MessageBodyWriterInterceptor)obj; return new Match(new WriterInterceptorFacade(interceptor), order); } }); } }
public void writeRequestBody(MultivaluedMap<String, Object> headers, OutputStream outputStream) throws IOException { if (body == null) { return; } if (getWriterInterceptorList().isEmpty()) { setWriterInterceptors(providerFactory.getClientWriterInterceptorRegistry().postMatch(null, null)); } new ClientWriterInterceptorContext(getWriterInterceptors(), providerFactory, body, bodyType, bodyGenericType, bodyAnnotations, bodyContentType, headers, outputStream, attributes).proceed(); }
serverWriterInterceptorRegistry = new WriterInterceptorRegistry(this, precedence); containerRequestFilterRegistry = new ContainerRequestFilterRegistry(this, precedence); containerResponseFilterRegistry = new ContainerResponseFilterRegistry(this, precedence); clientResponseFilters = new ClientResponseFilterRegistry(this); clientReaderInterceptorRegistry = new ReaderInterceptorRegistry(this, precedence); clientWriterInterceptorRegistry = new WriterInterceptorRegistry(this, precedence); clientExecutionInterceptorRegistry = new InterceptorRegistry<ClientExecutionInterceptor>(ClientExecutionInterceptor.class, this);
public void registerLegacy(MessageBodyWriterInterceptor interceptor) { register(new LegacySingletonInterceptorFactory(interceptor.getClass(), interceptor, precedence) { @Override public Match postMatch(Class declaring, AccessibleObject target) { Object obj = getLegacyMatch(declaring, target); if (obj == null) return null; MessageBodyWriterInterceptor interceptor = (MessageBodyWriterInterceptor)obj; return new Match(new WriterInterceptorFacade(interceptor), order); } }); } }
public static void applyDefaultInterceptors( ClientInterceptorRepositoryImpl repository, ResteasyProviderFactory providerFactory, Class declaring, Method method) { repository.setReaderInterceptors(providerFactory .getClientReaderInterceptorRegistry().postMatch(declaring, method)); repository.setWriterInterceptors(providerFactory .getClientWriterInterceptorRegistry().postMatch(declaring, method)); repository.setExecutionInterceptors(providerFactory .getClientExecutionInterceptorRegistry().bind(declaring, method)); }
public void registryUpdated(JaxrsInterceptorRegistry registry) { this.resourceMethodProviderFactory = new ResteasyProviderFactory(parentProviderFactory); for (DynamicFeature feature : parentProviderFactory.getServerDynamicFeatures()) { feature.configure(resourceInfo, new FeatureContextDelegate(resourceMethodProviderFactory)); } if (registry.getIntf().equals(WriterInterceptor.class)) { writerInterceptors = resourceMethodProviderFactory.getServerWriterInterceptorRegistry().postMatch(method.getResourceClass().getClazz(), method.getAnnotatedMethod()); } else if (registry.getIntf().equals(ContainerRequestFilter.class)) { requestFilters = resourceMethodProviderFactory.getContainerRequestFilterRegistry().postMatch(method.getResourceClass().getClazz(), method.getAnnotatedMethod()); } else if (registry.getIntf().equals(ContainerResponseFilter.class)) { responseFilters = resourceMethodProviderFactory.getContainerResponseFilterRegistry().postMatch(method.getResourceClass().getClazz(), method.getAnnotatedMethod()); } }