/** {@inheritDoc} */ @Override @Nullable public ServiceableComponent<T> apply(@Nullable final ApplicationContext appContext) { final Collection<? extends ServiceableComponent> components = appContext.getBeansOfType(serviceClaz).values(); if (components.size() == 0) { throw new ServiceException("Reload did not produce any bean of type " + serviceClaz.getName()); } if (components.size() > 1) { throw new ServiceException("Reload produced " + components.size() + " ServiceableComponents"); } return components.iterator().next(); } }
log.error("{} Error reloading service configuration for '{}'", getLogPrefix(), id, e); try { getHttpServletResponse().sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.getMessage()); } catch (final IOException e2) { log.error("{} I/O error responding to request", getLogPrefix(), e2);
/** {@inheritDoc} */ @Override @Nullable public ServiceableComponent<AttributeFilter> apply(@Nullable final ApplicationContext appContext) { final Collection<AttributeFilterPolicy> afps = appContext.getBeansOfType(AttributeFilterPolicy.class).values(); log.debug("Creating Attribute Filter {} with {} Policies", getId(), afps.size()); final AttributeFilterImpl filter = new AttributeFilterImpl(getId(), afps); filter.setApplicationContext(appContext); try { filter.initialize(); } catch (final ComponentInitializationException e) { throw new ServiceException("Unable to initialize attribute filter for " + appContext.getDisplayName(), e); } return filter; } }
throw new ServiceException("Reload did not produce any bean of type" + RelyingPartyMetadataProvider.class.getName()); return result; } catch (final ResolverException | ComponentInitializationException e) { throw new ServiceException("Chaining constructor create failed", e);
} catch (final IOException e1) { throw new ServiceException(e1); } catch (final IOException e1) { throw new ServiceException(e1); throw new ServiceException("Unable to load fallback logging configuration"); } catch (final IOException e) { throw new ServiceException(e);
/** {@inheritDoc} */ @Override @Nullable public ServiceableComponent<AttributeResolver> apply( @Nullable final ApplicationContext appContext) { final Collection<PrincipalConnector> pcs = appContext.getBeansOfType(PrincipalConnector.class).values(); final PrinicpalConnectorCanonicalizer pcc = new PrinicpalConnectorCanonicalizer(); pcc.setConnectors(pcs); final Collection<AttributeDefinition> definitions = appContext.getBeansOfType(AttributeDefinition.class).values(); final Collection<DataConnector> connectors = appContext.getBeansOfType(DataConnector.class).values(); log.debug("Creating Attribute Resolver {} with {} Attribute Definition(s), {} Data Connector(s)" + " and {} Principal Connector(s)", getId(), definitions.size(), connectors.size(), pcs.size()); final AttributeResolverImpl resolver = new AttributeResolverImpl(); resolver.setAttributeDefinitions(definitions); resolver.setDataConnectors(connectors); resolver.setPrincipalDecoder(pcc); resolver.setId(getId()); resolver.setStripNulls(isStripNulls()); resolver.setApplicationContext(appContext); try { resolver.initialize(); } catch (final ComponentInitializationException e) { throw new ServiceException("Unable to initialize attribute resolver for " + appContext.getDisplayName(), e); } return resolver; }
/** * Loads a logging configuration in to the active logger context. Error messages are printed out to the status * manager. * * @param loggingConfig logging configuration file * * @throws ServiceException thrown is there is a problem loading the logging configuration */ protected void loadLoggingConfiguration(final InputStream loggingConfig) { try { loggerContext.reset(); loadIdPHomeProperty(); final JoranConfigurator configurator = new JoranConfigurator(); configurator.setContext(loggerContext); configurator.doConfigure(loggingConfig); loggerContext.start(); logImplementationDetails(); } catch (final JoranException e) { throw new ServiceException(e); } }
Collections.<ApplicationContextInitializer> emptyList(), getParentContext()); } catch (final FatalBeanException e) { throw new ServiceException(e); } catch (final ServiceException e) { appContext.close(); throw new ServiceException("Failed to load " + getServiceConfigurations(), e); throw new ServiceException("Class was not the same or a superclass of configured class");