@Override public void postInit(InjectionManager injectionManager, BootstrapBag bootstrapBag) { contextResolverFactory.initialize(injectionManager.getAllInstances(ContextResolver.class)); bootstrapBag.setContextResolvers(contextResolverFactory); } }
@Override public void postInit(InjectionManager injectionManager, BootstrapBag bootstrapBag) { contextResolverFactory.initialize(injectionManager.getAllInstances(ContextResolver.class)); bootstrapBag.setContextResolvers(contextResolverFactory); } }
/** * Create a new instance of the OAuth signature configured with injected {@code ServiceLocator}. * @param injectionManager injection manager */ @Inject public OAuth1Signature(final InjectionManager injectionManager) { methods = new HashMap<String, OAuth1SignatureMethod>(); final List<OAuth1SignatureMethod> methodList = injectionManager.getAllInstances(OAuth1SignatureMethod.class); for (final OAuth1SignatureMethod oAuth1SignatureMethod : methodList) { methods.put(oAuth1SignatureMethod.name(), oAuth1SignatureMethod); } }
List<Object> getSupportedEncodings() { // no need for synchronization - in case of a race condition, the property // may be set twice, but it does not break anything if (supportedEncodings == null) { SortedSet<String> se = new TreeSet<>(); List<ContentEncoder> encoders = injectionManager.getAllInstances(ContentEncoder.class); for (ContentEncoder encoder : encoders) { se.addAll(encoder.getSupportedEncodings()); } supportedEncodings = new ArrayList<>(se); } return supportedEncodings; } }
List<Object> getSupportedEncodings() { // no need for synchronization - in case of a race condition, the property // may be set twice, but it does not break anything if (supportedEncodings == null) { SortedSet<String> se = new TreeSet<>(); List<ContentEncoder> encoders = injectionManager.getAllInstances(ContentEncoder.class); for (ContentEncoder encoder : encoders) { se.addAll(encoder.getSupportedEncodings()); } supportedEncodings = new ArrayList<>(se); } return supportedEncodings; } }
@Override public void postInit(InjectionManager injectionManager, BootstrapBag bootstrapBag) { // Add the ValueSupplierProviders which has been added to ResourceConfig/Feature List<ValueParamProvider> addedInstances = injectionManager.getAllInstances(ValueParamProvider.class); if (!addedInstances.isEmpty()) { ServerBootstrapBag serverBag = (ServerBootstrapBag) bootstrapBag; addedInstances.addAll(serverBag.getValueParamProviders()); serverBag.setValueParamProviders(Collections.unmodifiableCollection(addedInstances)); } } }
@Override public void postInit(InjectionManager injectionManager, BootstrapBag bootstrapBag) { // Add the ValueSupplierProviders which has been added to ResourceConfig/Feature List<ValueParamProvider> addedInstances = injectionManager.getAllInstances(ValueParamProvider.class); if (!addedInstances.isEmpty()) { ServerBootstrapBag serverBag = (ServerBootstrapBag) bootstrapBag; addedInstances.addAll(serverBag.getValueParamProviders()); serverBag.setValueParamProviders(Collections.unmodifiableCollection(addedInstances)); } } }
/** * Returns a (lexically) sorted set of supported encodings. * @return sorted set of supported encodings. */ SortedSet<String> getSupportedEncodings() { // no need for synchronization - in case of a race condition, the property // may be set twice, but it does not break anything if (supportedEncodings == null) { SortedSet<String> se = new TreeSet<>(); List<ContentEncoder> encoders = injectionManager.getAllInstances(ContentEncoder.class); for (ContentEncoder encoder : encoders) { se.addAll(encoder.getSupportedEncodings()); } se.add(IDENTITY_ENCODING); supportedEncodings = se; } return supportedEncodings; } }
/** * Returns a (lexically) sorted set of supported encodings. * @return sorted set of supported encodings. */ SortedSet<String> getSupportedEncodings() { // no need for synchronization - in case of a race condition, the property // may be set twice, but it does not break anything if (supportedEncodings == null) { SortedSet<String> se = new TreeSet<>(); List<ContentEncoder> encoders = injectionManager.getAllInstances(ContentEncoder.class); for (ContentEncoder encoder : encoders) { se.addAll(encoder.getSupportedEncodings()); } se.add(IDENTITY_ENCODING); supportedEncodings = se; } return supportedEncodings; } }
List<Object> getSupportedEncodings() { // no need for synchronization - in case of a race condition, the property // may be set twice, but it does not break anything if (supportedEncodings == null) { SortedSet<String> se = new TreeSet<>(); List<ContentEncoder> encoders = injectionManager.getAllInstances(ContentEncoder.class); for (ContentEncoder encoder : encoders) { se.addAll(encoder.getSupportedEncodings()); } supportedEncodings = new ArrayList<>(se); } return supportedEncodings; } }
injectionManager.getAllInstances(DestroyListener.class);
injectionManager.getAllInstances(DestroyListener.class);
/** * Creates a new instance of processor. * @param injectionManager injection manager. * @param monitoringEventListener Monitoring event listener. */ MonitoringStatisticsProcessor( final InjectionManager injectionManager, final MonitoringEventListener monitoringEventListener) { this.monitoringEventListener = monitoringEventListener; final ResourceModel resourceModel = injectionManager.getInstance(ExtendedResourceContext.class).getResourceModel(); this.statisticsBuilder = new MonitoringStatisticsImpl.Builder(resourceModel); this.statisticsCallbackList = injectionManager.getAllInstances(MonitoringStatisticsListener.class); this.scheduler = injectionManager.getInstance(ScheduledExecutorService.class, BackgroundSchedulerLiteral.INSTANCE); this.interval = PropertiesHelper.getValue(injectionManager.getInstance(Configuration.class).getProperties(), ServerProperties.MONITORING_STATISTICS_REFRESH_INTERVAL, DEFAULT_INTERVAL, Collections.<String, String>emptyMap()); }
/** * Creates a new instance of processor. * @param injectionManager injection manager. * @param monitoringEventListener Monitoring event listener. */ MonitoringStatisticsProcessor( final InjectionManager injectionManager, final MonitoringEventListener monitoringEventListener) { this.monitoringEventListener = monitoringEventListener; final ResourceModel resourceModel = injectionManager.getInstance(ExtendedResourceContext.class).getResourceModel(); this.statisticsBuilder = new MonitoringStatisticsImpl.Builder(resourceModel); this.statisticsCallbackList = injectionManager.getAllInstances(MonitoringStatisticsListener.class); this.scheduler = injectionManager.getInstance(ScheduledExecutorService.class, BackgroundSchedulerLiteral.INSTANCE); this.interval = PropertiesHelper.getValue(injectionManager.getInstance(Configuration.class).getProperties(), ServerProperties.MONITORING_STATISTICS_REFRESH_INTERVAL, DEFAULT_INTERVAL, Collections.<String, String>emptyMap()); }
@Override public void postInit(InjectionManager injectionManager, BootstrapBag bootstrapBag) { // Add the ValueSupplierProviders which has been added to ResourceConfig/Feature List<ValueParamProvider> addedInstances = injectionManager.getAllInstances(ValueParamProvider.class); if (!addedInstances.isEmpty()) { ServerBootstrapBag serverBag = (ServerBootstrapBag) bootstrapBag; addedInstances.addAll(serverBag.getValueParamProviders()); serverBag.setValueParamProviders(Collections.unmodifiableCollection(addedInstances)); } } }
/** * Returns a (lexically) sorted set of supported encodings. * @return sorted set of supported encodings. */ SortedSet<String> getSupportedEncodings() { // no need for synchronization - in case of a race condition, the property // may be set twice, but it does not break anything if (supportedEncodings == null) { SortedSet<String> se = new TreeSet<>(); List<ContentEncoder> encoders = injectionManager.getAllInstances(ContentEncoder.class); for (ContentEncoder encoder : encoders) { se.addAll(encoder.getSupportedEncodings()); } se.add(IDENTITY_ENCODING); supportedEncodings = se; } return supportedEncodings; } }
injectionManager.getAllInstances(DestroyListener.class);
/** * Creates a new instance of processor. * @param injectionManager injection manager. * @param monitoringEventListener Monitoring event listener. */ MonitoringStatisticsProcessor( final InjectionManager injectionManager, final MonitoringEventListener monitoringEventListener) { this.monitoringEventListener = monitoringEventListener; final ResourceModel resourceModel = injectionManager.getInstance(ExtendedResourceContext.class).getResourceModel(); this.statisticsBuilder = new MonitoringStatisticsImpl.Builder(resourceModel); this.statisticsCallbackList = injectionManager.getAllInstances(MonitoringStatisticsListener.class); this.scheduler = injectionManager.getInstance(ScheduledExecutorService.class, BackgroundSchedulerLiteral.INSTANCE); this.interval = PropertiesHelper.getValue(injectionManager.getInstance(Configuration.class).getProperties(), ServerProperties.MONITORING_STATISTICS_REFRESH_INTERVAL, DEFAULT_INTERVAL, Collections.<String, String>emptyMap()); }
@Override public void postInit(InjectionManager injectionManager, BootstrapBag bootstrapBag) { contextResolverFactory.initialize(injectionManager.getAllInstances(ContextResolver.class)); bootstrapBag.setContextResolvers(contextResolverFactory); } }
@Override public void postInit(InjectionManager injectionManager, BootstrapBag bootstrapBag) { contextResolverFactory.initialize(injectionManager.getAllInstances(ContextResolver.class)); bootstrapBag.setContextResolvers(contextResolverFactory); } }