public static Object build(ExternalContext ectx, Class spiClass, String defaultImpl) { List<String> classList = ServiceProviderFinderFactory.getServiceProviderFinder(ectx).getServiceProviderList(spiClass.getName()); if (classList != null && !classList.isEmpty()) { if (classList.size() > 1) { getLogger().log(Level.WARNING, "More than one SPI interface for "+spiClass.getName()+ " found :" + classList.toString() + ". Setting up the first one found."); } return ClassUtils.newInstance(classList.get(0)); } return ClassUtils.newInstance(defaultImpl); }
/** * * @param ectx * @return */ public static ServiceProviderFinder getServiceProviderFinder(ExternalContext ectx) { ServiceProviderFinder slp = (ServiceProviderFinder) ectx.getApplicationMap().get(SERVICE_PROVIDER_KEY); if (slp == null) { slp = _getServiceProviderFinderFromInitParam(ectx); if (slp == null) { slp = new DefaultServiceProviderFinder(); } // cache on ApplicationMap setServiceProviderFinder(ectx, slp); } return slp; }
public static Object build(ExternalContext ectx, Class spiClass, String defaultImpl) { List<String> classList = ServiceProviderFinderFactory.getServiceProviderFinder(ectx). getServiceProviderList(spiClass.getName()); if (classList != null && !classList.isEmpty()) { if (classList.size() > 1) { getLogger().log(Level.WARNING, "More than one SPI interface for "+spiClass.getName()+ " found :" + classList.toString() + ". Setting up the first one found."); } return ClassUtils.newInstance(classList.get(0)); } return ClassUtils.newInstance(defaultImpl); }
/** * * @param ectx * @return */ public static ServiceProviderFinder getServiceProviderFinder(ExternalContext ectx) { ServiceProviderFinder slp = (ServiceProviderFinder) ectx.getApplicationMap().get(SERVICE_PROVIDER_KEY); if (slp == null) { slp = _getServiceProviderFinderFromInitParam(ectx); if (slp == null) { slp = new DefaultServiceProviderFinder(); } // cache on ApplicationMap setServiceProviderFinder(ectx, slp); } return slp; }
public static Object build(ExternalContext ectx, Class spiClass, String defaultImpl) { List<String> classList = ServiceProviderFinderFactory.getServiceProviderFinder(ectx).getServiceProviderList(spiClass.getName()); if (classList != null && !classList.isEmpty()) { if (classList.size() > 1) { getLogger().log(Level.WARNING, "More than one SPI interface for "+spiClass.getName()+ " found :" + classList.toString() + ". Setting up the first one found."); } return ClassUtils.newInstance(classList.get(0)); } return ClassUtils.newInstance(defaultImpl); }
/** * * @param ectx * @return */ public static ServiceProviderFinder getServiceProviderFinder(ExternalContext ectx) { ServiceProviderFinder slp = (ServiceProviderFinder) ectx.getApplicationMap().get(SERVICE_PROVIDER_KEY); if (slp == null) { slp = _getServiceProviderFinderFromInitParam(ectx); if (slp == null) { slp = new DefaultServiceProviderFinder(); } // cache on ApplicationMap setServiceProviderFinder(ectx, slp); } return slp; }
private FacesConfigurationProvider resolveFacesConfigurationProviderFromService(final ExternalContext externalContext) throws ClassNotFoundException, NoClassDefFoundError, InstantiationException, IllegalAccessException, InvocationTargetException, PrivilegedActionException { List<String> classList = (List<String>) externalContext.getApplicationMap().get(FACES_CONFIGURATION_PROVIDER_LIST); if (classList == null) { classList = ServiceProviderFinderFactory.getServiceProviderFinder(externalContext).getServiceProviderList(FACES_CONFIGURATION_PROVIDER); externalContext.getApplicationMap().put(FACES_CONFIGURATION_PROVIDER_LIST, classList); } return ClassUtils.buildApplicationObject(FacesConfigurationProvider.class, classList, new TomEEFacesConfigurationProvider()); } }
private FacesConfigResourceProvider resolveFacesConfigResourceProviderFromService(final ExternalContext externalContext) throws ClassNotFoundException, NoClassDefFoundError, InstantiationException, IllegalAccessException, InvocationTargetException, PrivilegedActionException { List<String> classList = (List<String>) externalContext.getApplicationMap().get(FACES_CONFIG_PROVIDER_LIST); if (classList == null) { classList = ServiceProviderFinderFactory.getServiceProviderFinder(externalContext). getServiceProviderList(FACES_CONFIG_PROVIDER); externalContext.getApplicationMap().put(FACES_CONFIG_PROVIDER_LIST, classList); } return ClassUtils.buildApplicationObject(FacesConfigResourceProvider.class, classList, new TomEEFacesConfigResourceProvider()); } }
private FacesConfigurationMerger resolveFacesConfigurationMergerFromService(ExternalContext externalContext) throws ClassNotFoundException, NoClassDefFoundError, InstantiationException, IllegalAccessException, InvocationTargetException, PrivilegedActionException { // get all fitting SPI implementations (no need to cache this since it's only called once per JSF-app) List<String> classList = ServiceProviderFinderFactory.getServiceProviderFinder(externalContext) .getServiceProviderList(FACES_CONFIGURATION_MERGER); // create the instance using decorator pattern return ClassUtils.buildApplicationObject(FacesConfigurationMerger.class, classList, new DefaultFacesConfigurationMerger()); }
private WebConfigProvider resolveWebXmlProviderFromService( ExternalContext externalContext) throws ClassNotFoundException, NoClassDefFoundError, InstantiationException, IllegalAccessException, InvocationTargetException, PrivilegedActionException { List<String> classList = (List<String>) externalContext.getApplicationMap().get(WEB_CONFIG_PROVIDER_LIST); if (classList == null) { classList = ServiceProviderFinderFactory.getServiceProviderFinder(externalContext).getServiceProviderList(WEB_CONFIG_PROVIDER); externalContext.getApplicationMap().put(WEB_CONFIG_PROVIDER_LIST, classList); } return ClassUtils.buildApplicationObject(WebConfigProvider.class, classList, new DefaultWebConfigProvider()); }
private FacesConfigResourceProvider resolveFacesConfigResourceProviderFromService( ExternalContext externalContext) throws ClassNotFoundException, NoClassDefFoundError, InstantiationException, IllegalAccessException, InvocationTargetException, PrivilegedActionException { List<String> classList = (List<String>) externalContext.getApplicationMap().get(FACES_CONFIG_PROVIDER_LIST); if (classList == null) { classList = ServiceProviderFinderFactory.getServiceProviderFinder(externalContext).getServiceProviderList(FACES_CONFIG_PROVIDER); externalContext.getApplicationMap().put(FACES_CONFIG_PROVIDER_LIST, classList); } return ClassUtils.buildApplicationObject(FacesConfigResourceProvider.class, classList, new DefaultFacesConfigResourceProvider()); }
private FacesConfigurationProvider resolveFacesConfigurationProviderFromService( ExternalContext externalContext) throws ClassNotFoundException, NoClassDefFoundError, InstantiationException, IllegalAccessException, InvocationTargetException, PrivilegedActionException { List<String> classList = (List<String>) externalContext.getApplicationMap().get(FACES_CONFIGURATION_PROVIDER_LIST); if (classList == null) { classList = ServiceProviderFinderFactory.getServiceProviderFinder(externalContext).getServiceProviderList(FACES_CONFIGURATION_PROVIDER); externalContext.getApplicationMap().put(FACES_CONFIGURATION_PROVIDER_LIST, classList); } return ClassUtils.buildApplicationObject(FacesConfigurationProvider.class, classList, new DefaultFacesConfigurationProvider()); } }
private FacesConfigurationProvider resolveFacesConfigurationProviderFromService( ExternalContext externalContext) throws ClassNotFoundException, NoClassDefFoundError, InstantiationException, IllegalAccessException, InvocationTargetException, PrivilegedActionException { List<String> classList = (List<String>) externalContext.getApplicationMap().get(FACES_CONFIGURATION_PROVIDER_LIST); if (classList == null) { classList = ServiceProviderFinderFactory.getServiceProviderFinder(externalContext).getServiceProviderList(FACES_CONFIGURATION_PROVIDER); externalContext.getApplicationMap().put(FACES_CONFIGURATION_PROVIDER_LIST, classList); } return ClassUtils.buildApplicationObject(FacesConfigurationProvider.class, classList, new DefaultFacesConfigurationProvider()); } }
private FacesConfigResourceProvider resolveFacesConfigResourceProviderFromService( ExternalContext externalContext) throws ClassNotFoundException, NoClassDefFoundError, InstantiationException, IllegalAccessException, InvocationTargetException, PrivilegedActionException { List<String> classList = (List<String>) externalContext.getApplicationMap().get(FACES_CONFIG_PROVIDER_LIST); if (classList == null) { classList = ServiceProviderFinderFactory.getServiceProviderFinder(externalContext).getServiceProviderList(FACES_CONFIG_PROVIDER); externalContext.getApplicationMap().put(FACES_CONFIG_PROVIDER_LIST, classList); } return ClassUtils.buildApplicationObject(FacesConfigResourceProvider.class, classList, new DefaultFacesConfigResourceProvider()); }
private FaceletConfigResourceProvider resolveFaceletConfigResourceProviderFromService( ExternalContext externalContext) throws ClassNotFoundException, NoClassDefFoundError, InstantiationException, IllegalAccessException, InvocationTargetException, PrivilegedActionException { List<String> classList = (List<String>) externalContext.getApplicationMap().get(FACELET_CONFIG_PROVIDER_LIST); if (classList == null) { classList = ServiceProviderFinderFactory.getServiceProviderFinder(externalContext).getServiceProviderList(FACELET_CONFIG_PROVIDER); externalContext.getApplicationMap().put(FACELET_CONFIG_PROVIDER_LIST, classList); } return ClassUtils.buildApplicationObject(FaceletConfigResourceProvider.class, classList, new DefaultFaceletConfigResourceProvider()); }
private StateCacheProvider resolveStateCacheProviderFromService( ExternalContext externalContext) throws ClassNotFoundException, NoClassDefFoundError, InstantiationException, IllegalAccessException, InvocationTargetException, PrivilegedActionException { List<String> classList = (List<String>) externalContext.getApplicationMap().get(STATE_CACHE_PROVIDER_LIST); if (classList == null) { classList = ServiceProviderFinderFactory.getServiceProviderFinder(externalContext). getServiceProviderList(STATE_CACHE_PROVIDER); externalContext.getApplicationMap().put(STATE_CACHE_PROVIDER_LIST, classList); } return ClassUtils.buildApplicationObject(StateCacheProvider.class, classList, new StateCacheFactoryImpl()); }
private FacesConfigurationMerger resolveFacesConfigurationMergerFromService(ExternalContext externalContext) throws ClassNotFoundException, NoClassDefFoundError, InstantiationException, IllegalAccessException, InvocationTargetException, PrivilegedActionException { // get all fitting SPI implementations (no need to cache this since it's only called once per JSF-app) List<String> classList = ServiceProviderFinderFactory.getServiceProviderFinder(externalContext) .getServiceProviderList(FACES_CONFIGURATION_MERGER); // create the instance using decorator pattern return ClassUtils.buildApplicationObject(FacesConfigurationMerger.class, classList, new DefaultFacesConfigurationMerger()); }
private FacesConfigurationMerger resolveFacesConfigurationMergerFromService(ExternalContext externalContext) throws ClassNotFoundException, NoClassDefFoundError, InstantiationException, IllegalAccessException, InvocationTargetException, PrivilegedActionException { // get all fitting SPI implementations (no need to cache this since it's only called once per JSF-app) List<String> classList = ServiceProviderFinderFactory.getServiceProviderFinder(externalContext) .getServiceProviderList(FACES_CONFIGURATION_MERGER); // create the instance using decorator pattern return ClassUtils.buildApplicationObject(FacesConfigurationMerger.class, classList, new DefaultFacesConfigurationMerger()); }
private ResourceLibraryContractsProvider resolveResourceLibraryContractsProviderFromService( ExternalContext externalContext) throws ClassNotFoundException, NoClassDefFoundError, InstantiationException, IllegalAccessException, InvocationTargetException, PrivilegedActionException { List<String> classList = (List<String>) externalContext.getApplicationMap().get(CONTRACTS_PROVIDER_LIST); if (classList == null) { classList = ServiceProviderFinderFactory.getServiceProviderFinder(externalContext). getServiceProviderList(CONTRACTS_PROVIDER); externalContext.getApplicationMap().put(CONTRACTS_PROVIDER_LIST, classList); } return ClassUtils.buildApplicationObject(ResourceLibraryContractsProvider.class, classList, new DefaultResourceLibraryContractsProvider()); }
private WebConfigProvider resolveWebXmlProviderFromService( ExternalContext externalContext) throws ClassNotFoundException, NoClassDefFoundError, InstantiationException, IllegalAccessException, InvocationTargetException, PrivilegedActionException { List<String> classList = (List<String>) externalContext.getApplicationMap().get(WEB_CONFIG_PROVIDER_LIST); if (classList == null) { classList = ServiceProviderFinderFactory.getServiceProviderFinder(externalContext).getServiceProviderList(WEB_CONFIG_PROVIDER); externalContext.getApplicationMap().put(WEB_CONFIG_PROVIDER_LIST, classList); } return ClassUtils.buildApplicationObject(WebConfigProvider.class, classList, new DefaultWebConfigProvider()); }