private static Properties getBusinessCalendarProperties(String calendarResource) { synchronized (propertiesByResource) { Properties properties = (Properties) propertiesByResource.get(calendarResource); if (properties == null) { properties = ClassLoaderUtil.getProperties(calendarResource); propertiesByResource.put(calendarResource, properties); } return properties; } }
private static Properties getBusinessCalendarProperties(String calendarResource) { synchronized (propertiesByResource) { Properties properties = (Properties) propertiesByResource.get(calendarResource); if (properties == null) { properties = ClassLoaderUtil.getProperties(calendarResource); propertiesByResource.put(calendarResource, properties); } return properties; } }
private static List loadModuleClasses(String resource) { Properties properties = ClassLoaderUtil.getProperties(resource); List moduleClasses = new ArrayList(); Log log = LogFactory.getLog(ProcessDefinition.class); boolean debug = log.isDebugEnabled(); for (Iterator iter = properties.keySet().iterator(); iter.hasNext();) { String moduleClassName = (String) iter.next(); try { Class moduleClass = ClassLoaderUtil.classForName(moduleClassName); moduleClasses.add(moduleClass); if (debug) log.debug("loaded module " + moduleClassName); } catch (ClassNotFoundException e) { if (debug) log.debug("module class not found: " + moduleClassName, e); } } return moduleClasses; }
private static List loadModuleClasses(String resource) { Properties properties = ClassLoaderUtil.getProperties(resource); List moduleClasses = new ArrayList(); Log log = LogFactory.getLog(ProcessDefinition.class); boolean debug = log.isDebugEnabled(); for (Iterator iter = properties.keySet().iterator(); iter.hasNext();) { String moduleClassName = (String) iter.next(); try { Class moduleClass = ClassLoaderUtil.classForName(moduleClassName); moduleClasses.add(moduleClass); if (debug) log.debug("loaded module " + moduleClassName); } catch (ClassNotFoundException e) { if (debug) log.debug("module class not found: " + moduleClassName, e); } } return moduleClasses; }
private static Map getConverters() { String resource = Configs.getString("resource.converter"); synchronized (convertersByResource) { Map converters = (Map) convertersByResource.get(resource); if (converters == null) { Properties properties = ClassLoaderUtil.getProperties(resource); converters = createConverters(properties); convertersByResource.put(resource, converters); } return converters; } }
private static Map getConverters() { String resource = Configs.getString("resource.converter"); synchronized (convertersByResource) { Map converters = (Map) convertersByResource.get(resource); if (converters == null) { Properties properties = ClassLoaderUtil.getProperties(resource); converters = createConverters(properties); convertersByResource.put(resource, converters); } return converters; } }
private static Object lookup(String jndiName) throws NamingException { Context initialContext; if (Configs.hasObject("resource.jndi.properties")) { String resource = Configs.getString("resource.jndi.properties"); Properties properties = ClassLoaderUtil.getProperties(resource); initialContext = new InitialContext(properties); } else { initialContext = new InitialContext(); } try { return initialContext.lookup(jndiName); } finally { initialContext.close(); } } }
private static Object lookup(String jndiName) throws NamingException { Context initialContext; if (Configs.hasObject("resource.jndi.properties")) { String resource = Configs.getString("resource.jndi.properties"); Properties properties = ClassLoaderUtil.getProperties(resource); initialContext = new InitialContext(properties); } else { initialContext = new InitialContext(); } try { return initialContext.lookup(jndiName); } finally { initialContext.close(); } } }
public static Configuration getConfiguration(String hibernateCfg, String hibernateProperties) { Object key = getKey(hibernateCfg, hibernateProperties); Configuration configuration = (Configuration) configurations.get(key); if (configuration == null) { configuration = new Configuration(); configuration.configure(hibernateCfg); if (hibernateProperties != null) { Properties properties = ClassLoaderUtil.getProperties(hibernateProperties); configuration.addProperties(properties); } configurations.put(key, configuration); } return configuration; }
private Properties getServerProperties() { Properties serverProperties; if (Configs.hasObject("resource.mail.properties")) { String resource = Configs.getString("resource.mail.properties"); synchronized (serverPropertiesByResource) { // look in server properties cache serverProperties = (Properties) serverPropertiesByResource.get(resource); if (serverProperties == null) { // load server properties and put them in the cache serverProperties = ClassLoaderUtil.getProperties(resource); serverPropertiesByResource.put(resource, serverProperties); } } } else { serverProperties = new Properties(); // host if (Configs.hasObject("jbpm.mail.smtp.host")) { String smtpHost = Configs.getString("jbpm.mail.smtp.host"); serverProperties.setProperty("mail.smtp.host", smtpHost); } // port if (Configs.hasObject("jbpm.mail.smtp.port")) { int port = Configs.getInt("jbpm.mail.smtp.port"); serverProperties.setProperty("mail.smtp.port", Integer.toString(port)); } } return serverProperties; }
public static JbpmHibernateConfiguration getConfiguration(String hibernateCfg, String hibernateProperties) { Object key = getKey(hibernateCfg, hibernateProperties); JbpmHibernateConfiguration jbpmHibernateConfiguration = configurations.get(key); if (jbpmHibernateConfiguration == null) { jbpmHibernateConfiguration = new JbpmHibernateConfiguration(); jbpmHibernateConfiguration.getConfigurationProxy().configure(hibernateCfg); if (hibernateProperties != null) { Properties properties = ClassLoaderUtil.getProperties(hibernateProperties); jbpmHibernateConfiguration.getConfigurationProxy().addProperties(properties); } configurations.put(key, jbpmHibernateConfiguration); } return jbpmHibernateConfiguration; }
if (serverProperties == null) { serverProperties = ClassLoaderUtil.getProperties(resource); serverPropertiesByResource.put(resource, serverProperties);