public ReaderInterceptor[] getReaderInterceptors(Class declaring, AccessibleObject target) { return providerFactory.getClientReaderInterceptorRegistry().postMatch(declaring, target); }
public ReaderInterceptorRegistry clone(ResteasyProviderFactory factory) { ReaderInterceptorRegistry clone = new ReaderInterceptorRegistry(factory, precedence); clone.interceptors.addAll(interceptors); return clone; }
public void registerLegacy(Class<? extends MessageBodyReaderInterceptor> decl) { register(new LegacyPerMethodInterceptorFactory(decl, precedence) { @Override public Match postMatch(Class declaring, AccessibleObject target) { Object obj = getLegacyMatch(declaring, target); if (obj == null) return null; MessageBodyReaderInterceptor interceptor = (MessageBodyReaderInterceptor)obj; return new Match(new ReaderInterceptorFacade(interceptor), order); } }); }
public MessageBodyParameterInjector(Class declaringClass, AccessibleObject target, Class type, Type genericType, Annotation[] annotations, ResteasyProviderFactory factory) { this.factory = factory; this.target = target; this.declaringClass = declaringClass; if (type.equals(MarshalledEntity.class)) { if (genericType == null || !(genericType instanceof ParameterizedType)) { throw new RuntimeException(Messages.MESSAGES.marshalledEntityMustHaveTypeInfo()); } isMarshalledEntity = true; ParameterizedType param = (ParameterizedType) genericType; this.genericType = param.getActualTypeArguments()[0]; this.type = Types.getRawType(this.genericType); } else { this.type = type; this.genericType = genericType; } this.annotations = annotations; this.interceptors = factory .getServerReaderInterceptorRegistry().postMatch( this.declaringClass, this.target); // this is for when an interceptor is added after the creation of the injector factory.getServerReaderInterceptorRegistry().getListeners().add(this); }
serverReaderInterceptorRegistry = parent.getServerReaderInterceptorRegistry().clone(this); serverReaderInterceptorRegistry.registerSingleton((ReaderInterceptor) provider, priority); clientReaderInterceptorRegistry = parent.getClientReaderInterceptorRegistry().clone(this); clientReaderInterceptorRegistry.registerSingleton((ReaderInterceptor) provider, priority); serverReaderInterceptorRegistry = parent.getServerReaderInterceptorRegistry().clone(this); serverReaderInterceptorRegistry.registerSingleton((ReaderInterceptor) provider, priority); if (clientReaderInterceptorRegistry == null) clientReaderInterceptorRegistry = parent.getClientReaderInterceptorRegistry().clone(this); clientReaderInterceptorRegistry.registerSingleton((ReaderInterceptor) provider, priority); serverReaderInterceptorRegistry = parent.getServerReaderInterceptorRegistry().clone(this); serverReaderInterceptorRegistry.registerLegacy((MessageBodyReaderInterceptor) provider); clientReaderInterceptorRegistry = parent.getClientReaderInterceptorRegistry().clone(this); clientReaderInterceptorRegistry.registerLegacy((MessageBodyReaderInterceptor) provider);
serverReaderInterceptorRegistry = parent.getServerReaderInterceptorRegistry().clone(this); serverReaderInterceptorRegistry.registerClass(provider, priority); clientReaderInterceptorRegistry = parent.getClientReaderInterceptorRegistry().clone(this); clientReaderInterceptorRegistry.registerClass(provider, priority); serverReaderInterceptorRegistry = parent.getServerReaderInterceptorRegistry().clone(this); serverReaderInterceptorRegistry.registerClass(provider, priority); if (clientReaderInterceptorRegistry == null) clientReaderInterceptorRegistry = parent.getClientReaderInterceptorRegistry().clone(this); clientReaderInterceptorRegistry.registerClass(provider, priority); serverReaderInterceptorRegistry = parent.getServerReaderInterceptorRegistry().clone(this); serverReaderInterceptorRegistry.registerLegacy(provider); clientReaderInterceptorRegistry = parent.getClientReaderInterceptorRegistry().clone(this); clientReaderInterceptorRegistry.registerLegacy(provider);
serverReaderInterceptorRegistry = ((ResteasyProviderFactory)parent).getServerReaderInterceptorRegistry().clone(this); ((ReaderInterceptorRegistry)serverReaderInterceptorRegistry).registerLegacy((MessageBodyReaderInterceptor) provider); clientReaderInterceptorRegistry = ((ResteasyProviderFactory)parent).getClientReaderInterceptorRegistry().clone(this); ((ReaderInterceptorRegistry)clientReaderInterceptorRegistry).registerLegacy((MessageBodyReaderInterceptor) provider);
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); } } }
serverReaderInterceptorRegistry = ((ResteasyProviderFactory)parent).getServerReaderInterceptorRegistry().clone(this); ((ReaderInterceptorRegistry)serverReaderInterceptorRegistry).registerLegacy(provider); clientReaderInterceptorRegistry = ((ResteasyProviderFactory)parent).getClientReaderInterceptorRegistry().clone(this); ((ReaderInterceptorRegistry)clientReaderInterceptorRegistry).registerLegacy(provider);
public void registryUpdated(JaxrsInterceptorRegistry registry) { this.interceptors = factory .getServerReaderInterceptorRegistry().postMatch( declaringClass, target); }
public ReaderInterceptorRegistry clone(ResteasyProviderFactory factory) { ReaderInterceptorRegistry clone = new ReaderInterceptorRegistry(factory, precedence); clone.interceptors.addAll(interceptors); return clone; }
public void registerLegacy(Class<? extends MessageBodyReaderInterceptor> decl) { register(new LegacyPerMethodInterceptorFactory(decl, precedence) { @Override public Match postMatch(Class declaring, AccessibleObject target) { Object obj = getLegacyMatch(declaring, target); if (obj == null) return null; MessageBodyReaderInterceptor interceptor = (MessageBodyReaderInterceptor)obj; return new Match(new ReaderInterceptorFacade(interceptor), order); } }); }
public ReaderInterceptor[] getReaderInterceptors(Class declaring, AccessibleObject target) { return providerFactory.getClientReaderInterceptorRegistry().postMatch(declaring, target); }
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(MessageBodyReaderInterceptor 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; MessageBodyReaderInterceptor interceptor = (MessageBodyReaderInterceptor)obj; return new Match(new ReaderInterceptorFacade(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)); }
serverReaderInterceptorRegistry = new ReaderInterceptorRegistry(this, precedence); serverWriterInterceptorRegistry = new WriterInterceptorRegistry(this, precedence); containerRequestFilterRegistry = new ContainerRequestFilterRegistry(this, precedence); clientRequestFilters = new JaxrsInterceptorRegistry<ClientRequestFilter>(this, ClientRequestFilter.class); clientResponseFilters = new ClientResponseFilterRegistry(this); clientReaderInterceptorRegistry = new ReaderInterceptorRegistry(this, precedence); clientWriterInterceptorRegistry = new WriterInterceptorRegistry(this, precedence); clientExecutionInterceptorRegistry = new InterceptorRegistry<ClientExecutionInterceptor>(ClientExecutionInterceptor.class, this);
public void registerLegacy(MessageBodyReaderInterceptor 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; MessageBodyReaderInterceptor interceptor = (MessageBodyReaderInterceptor)obj; return new Match(new ReaderInterceptorFacade(interceptor), order); } }); } }
setReaderInterceptors(providerFactory.getClientReaderInterceptorRegistry().postMatch(null, null));
setReaderInterceptors(providerFactory.getClientReaderInterceptorRegistry().postMatch(null, null));