@Inject protected void injectDependencies(ComponentRegistry componentRegistry) { componentRegistry.wireDependencies(filterAndConverter); }
@Inject protected void injectDependencies(ComponentRegistry componentRegistry) { componentRegistry.wireDependencies(filterAndConverter); }
protected final IckleFilterAndConverter createAndWireFilter(String queryString, Map<String, Object> namedParameters) { IckleFilterAndConverter filter = createFilter(queryString, namedParameters); SecurityActions.getCacheComponentRegistry(cache).wireDependencies(filter); return filter; }
protected final IckleFilterAndConverter createAndWireFilter(String queryString, Map<String, Object> namedParameters) { IckleFilterAndConverter filter = createFilter(queryString, namedParameters); SecurityActions.getCacheComponentRegistry(cache).wireDependencies(filter); return filter; }
private void testWith(DataConversion dataConversion, ComponentRegistry registry) throws Exception { byte[] marshalled = marshaller.objectToByteBuffer(dataConversion); Object back = marshaller.objectFromByteBuffer(marshalled); registry.wireDependencies(back); assertEquals(back, dataConversion); }
@Inject public void injectDependencies(Cache cache, EncoderRegistry encoderRegistry) { providedFilter.ifPresent(kvfc -> { cache.getAdvancedCache().getComponentRegistry().wireDependencies(kvfc); MediaType filterFormat = kvfc.format(); if (filterFormat != null && !filterFormat.equals(storageMediaType)) { applyBefore = encoderRegistry.getTranscoder(filterFormat, storageMediaType); } if (filterFormat != null && !filterFormat.equals(requestType)) { applyAfter = encoderRegistry.getTranscoder(filterFormat, requestType); } }); }
/** * Replaces an existing interceptor of the given type in the interceptor chain with a new interceptor * instance passed * as parameter. * * @param replacingInterceptor the interceptor to add to the interceptor chain * @param toBeReplacedInterceptorType the type of interceptor that should be swapped with the new one * @return true if the interceptor was replaced */ public static boolean replaceInterceptor(Cache cache, AsyncInterceptor replacingInterceptor, Class<? extends AsyncInterceptor> toBeReplacedInterceptorType) { ComponentRegistry cr = extractComponentRegistry(cache); // make sure all interceptors here are wired. cr.wireDependencies(replacingInterceptor); AsyncInterceptorChain inch = cr.getComponent(AsyncInterceptorChain.class); return inch.replaceInterceptor(replacingInterceptor, toBeReplacedInterceptorType); }
/** * Replaces an existing interceptor of the given type in the interceptor chain with a new interceptor instance passed * as parameter. * * @param replacingInterceptor the interceptor to add to the interceptor chain * @param toBeReplacedInterceptorType the type of interceptor that should be swapped with the new one * * @return true if the interceptor was replaced */ public static boolean replaceInterceptor(Cache cache, CommandInterceptor replacingInterceptor, Class<? extends CommandInterceptor> toBeReplacedInterceptorType) { ComponentRegistry cr = extractComponentRegistry(cache); // make sure all interceptors here are wired. CommandInterceptor i = replacingInterceptor; do { cr.wireDependencies(i); } while ((i = i.getNext()) != null); AsyncInterceptorChain inch = cache.getAdvancedCache().getAsyncInterceptorChain(); return inch.replaceInterceptor(replacingInterceptor, toBeReplacedInterceptorType); }
public static TransactionTrackInterceptor injectInCache(Cache<?, ?> cache) { AsyncInterceptorChain chain = cache.getAdvancedCache().getAsyncInterceptorChain(); if (chain.containsInterceptorType(TransactionTrackInterceptor.class)) { return chain.findInterceptorWithClass(TransactionTrackInterceptor.class); } TransactionTrackInterceptor interceptor = new TransactionTrackInterceptor(); cache.getAdvancedCache().getComponentRegistry().wireDependencies(interceptor); TestingUtil.startComponent(interceptor); chain.addInterceptor(interceptor, 0); return interceptor; }