Search in sources :

Example 1 with JAXRSServerFactoryCustomizationExtension

use of org.apache.cxf.jaxrs.ext.JAXRSServerFactoryCustomizationExtension in project cxf by apache.

the class JAXRSCdiResourceExtension method customize.

/**
 * Look and apply the available JAXRSServerFactoryBean extensions to customize its
 * creation (f.e. add features, providers, assign transport, ...)
 * @param beanManager bean manager
 * @param bean JAX-RS server factory bean about to be created
 */
private void customize(final BeanManager beanManager, final JAXRSServerFactoryBean bean) {
    JAXRSServerFactoryCustomizationUtils.customize(bean);
    final Collection<Bean<?>> extensionBeans = beanManager.getBeans(JAXRSServerFactoryCustomizationExtension.class);
    for (final Bean<?> extensionBean : extensionBeans) {
        final JAXRSServerFactoryCustomizationExtension extension = (JAXRSServerFactoryCustomizationExtension) beanManager.getReference(extensionBean, JAXRSServerFactoryCustomizationExtension.class, createCreationalContext(beanManager, extensionBean));
        extension.customize(bean);
    }
}
Also used : JAXRSServerFactoryCustomizationExtension(org.apache.cxf.jaxrs.ext.JAXRSServerFactoryCustomizationExtension) ProcessBean(javax.enterprise.inject.spi.ProcessBean) JAXRSServerFactoryBean(org.apache.cxf.jaxrs.JAXRSServerFactoryBean) Bean(javax.enterprise.inject.spi.Bean)

Aggregations

Bean (javax.enterprise.inject.spi.Bean)1 ProcessBean (javax.enterprise.inject.spi.ProcessBean)1 JAXRSServerFactoryBean (org.apache.cxf.jaxrs.JAXRSServerFactoryBean)1 JAXRSServerFactoryCustomizationExtension (org.apache.cxf.jaxrs.ext.JAXRSServerFactoryCustomizationExtension)1