/** * @return a TagsConfigurator instance. */ public static TagsConfigurator getInstance() { if (singleton == null) { singleton = (TagsConfigurator) BeanUtils.getBean(TAGS_CONFIGURATOR_BEAN); } return singleton; }
/** * return all list UrlPatternDescriptor. */ private List<UrlPatternDescriptor> getUrlDescriptor() { //ADD Action Map<String, UrlPatternDescriptor> treatments = BeanUtils.getBeansOfClass(UrlPatternDescriptor.class); List<UrlPatternDescriptor> urlP = new ArrayList<UrlPatternDescriptor>(); for (String name : treatments.keySet()) { if (logger.isDebugEnabled()) { logger.debug("get to roles bean [" + name + "]..."); } UrlPatternDescriptor bean = treatments.get(name); if (bean == null) { throw new ConfigException("bean [" + name + "] is null, " + "application doesn't init action."); } urlP.add(bean); } return urlP; }
/** * return all list UrlPatternDescriptor. */ private List<UrlPatternDescriptor> getUrlDescriptor() { //ADD Action Map<String, UrlPatternDescriptor> treatments = BeanUtils.getBeansOfClass(UrlPatternDescriptor.class); List<UrlPatternDescriptor> urlP = new ArrayList<UrlPatternDescriptor>(); for (String name : treatments.keySet()) { if (logger.isDebugEnabled()) { logger.debug("get to roles bean [" + name + "]..."); } UrlPatternDescriptor bean = treatments.get(name); if (bean == null) { throw new ConfigException("bean [" + name + "] is null, " + "application doesn't init action."); } urlP.add(bean); } return urlP; }
/** * @return the database manager store. */ private static DatabaseManagerStore getDatabaseManagerStore() { if (databaseManagerStore == null) { databaseManagerStore = (DatabaseManagerStore) BeanUtils.getBean(DATABASE_MANAGER_STORE); } return databaseManagerStore; }
/** * JSF callback. * @return a String. */ public String restart() { Map<String, Resettable> resettables = BeanUtils.getBeansOfClass(Resettable.class); for (String name : resettables.keySet()) { if (logger.isDebugEnabled()) { logger.debug("trying to reset bean [" + name + "]..."); } Resettable bean = resettables.get(name); if (bean == null) { throw new ConfigException("bean [" + name + "] is null, " + "application can not be restarted."); } bean.reset(); if (logger.isDebugEnabled()) { logger.debug("bean [" + name + "] was reset."); } } ExceptionUtils.unmarkExceptionCaught(); return "applicationRestarted"; }
/** * @return a TagsConfigurator instance. */ public static TagsConfigurator getInstance() { if (singleton == null) { singleton = (TagsConfigurator) BeanUtils.getBean(TAGS_CONFIGURATOR_BEAN); } return singleton; }
/** * @param name * @return the Hibernate template that corresponds to a name. */ protected HibernateTemplate retrieveHibernateTemplate( final String name) { if (name == null) { return null; } return (HibernateTemplate) BeanUtils.getBean(name); }
@Override public void create() { BeanUtils.getBean(createSessionFactoryBeanName); }
/** * @return an exception service. */ private static ExceptionService getExceptionService() { ExceptionServiceFactory exceptionServiceFactory = (ExceptionServiceFactory) BeanUtils.getBean(EXCEPTION_SERVICE_FACTORY_BEAN); return exceptionServiceFactory.getExceptionService(); }
@Override public void upgrade() { BeanUtils.getBean(getUpgradeSessionFactoryBeanName()); }
@Override public SessionFactory getSessionFactory() { return (SessionFactory) BeanUtils.getBean(getSessionFactoryBeanName()); }
@Override public void init(final ServletConfig config) throws ServletException { super.init(config); try { ApplicationService applicationService = (ApplicationService) BeanUtils.getBean("applicationService"); Version version = applicationService.getVersion(); result = version.toString(); } catch (Throwable t) { //TODO CL V2 : Use exception in core module //result = ExceptionUtils.getShortPrintableStackTrace(t); } }
@Override public void beforePhase(final PhaseEvent event) { if (logger.isDebugEnabled()) { logger.debug("enterig RessourceBundlePhaseListener::beforePhase = " + event); } FacesContext context = event.getFacesContext(); try { Locale locale = (Locale) ContextUtils.getSessionAttribute(AbstractI18nAwareBean.LOCALE_ATTRIBUTE); if (locale == null && context.getViewRoot() != null) { locale = context.getViewRoot().getLocale(); } if (locale != null && context.getExternalContext().getRequestMap().get(DEFAULT_STRINGVAR) == null) { I18nService i18nService = (I18nService) BeanUtils.getBean("i18nService"); context.getExternalContext().getRequestMap().put( DEFAULT_STRINGVAR, i18nService.getStrings(locale)); } } catch (NoRequestBoundException e) { //do nothing logger.warn("in ResourceBundlePhaseListener::beforePhase NoRequestBoundException"); } }
/** * Open the session. */ void openSession() { sessionFactory = (SessionFactory) BeanUtils.getBean(sessionFactoryBeanName); if (TransactionSynchronizationManager.hasResource(sessionFactory)) { if (logger.isDebugEnabled()) { logger.debug("OPEN(" + sessionFactoryBeanName + ") ***** participate!"); } participate = true; return; } if (logger.isDebugEnabled()) { logger.debug("OPEN(" + sessionFactoryBeanName + ")"); } session = SessionFactoryUtils.getSession(sessionFactory, true); session.setFlushMode(FlushMode.ALWAYS); TransactionSynchronizationManager.bindResource(sessionFactory, new SessionHolder(session)); }