public DataSource getDataSource() { if (dataSource == null && dataSourceJndiName != null) { dataSource = (DataSource) JndiUtil.lookup(dataSourceJndiName, DataSource.class); } return dataSource; }
protected synchronized Repository getRepository() { if (repository == null) { repository = (Repository) JndiUtil.lookup(jndiName, Repository.class); } return repository; }
protected synchronized Repository getRepository() { if (repository == null) { repository = (Repository) JndiUtil.lookup(jndiName, Repository.class); } return repository; }
public DataSource getDataSource() { if (dataSource == null && dataSourceJndiName != null) { dataSource = (DataSource) JndiUtil.lookup(dataSourceJndiName, DataSource.class); } return dataSource; }
/** * a singleton is kept in JbpmSessionFactory as a convenient central location. */ public static JbpmSessionFactory getInstance() { if (instance == null) { // if there is a JNDI name configured if (jndiName != null) { // fetch the JbpmSessionFactory from JNDI if (log.isDebugEnabled()) { log.debug("fetching JbpmSessionFactory from " + jndiName); } instance = (JbpmSessionFactory) JndiUtil.lookup(jndiName, JbpmSessionFactory.class); } // else there is no JNDI name configured else { // create a new default instance if (log.isDebugEnabled()) log.debug("building singleton JbpmSessionFactory"); instance = buildJbpmSessionFactory(); } } return instance; }
/** * a singleton is kept in JbpmSessionFactory as a convenient central location. */ public static JbpmSessionFactory getInstance() { if (instance == null) { // if there is a JNDI name configured if (jndiName != null) { // fetch the JbpmSessionFactory from JNDI if (log.isDebugEnabled()) { log.debug("fetching JbpmSessionFactory from " + jndiName); } instance = (JbpmSessionFactory) JndiUtil.lookup(jndiName, JbpmSessionFactory.class); } // else there is no JNDI name configured else { // create a new default instance if (log.isDebugEnabled()) log.debug("building singleton JbpmSessionFactory"); instance = buildJbpmSessionFactory(); } } return instance; }
public synchronized SessionFactory getSessionFactory() { if (sessionFactory == null) { if (sessionFactoryJndiName != null) { sessionFactory = (SessionFactory) JndiUtil.lookup(sessionFactoryJndiName, SessionFactory.class); mustSessionFactoryBeClosed = false; } else { sessionFactory = getJbpmHibernateConfiguration().buildSessionFactory(); mustSessionFactoryBeClosed = true; } } return sessionFactory; }
public static Object lookup(String jndiName, Class type) { try { return PortableRemoteObject.narrow(lookup(jndiName), type); } catch (NamingException e) { throw new JndiLookupException("could not retrieve: " + jndiName, e); } }
public static Object lookup(String jndiName, Class type) { try { return PortableRemoteObject.narrow(lookup(jndiName), type); } catch (NamingException e) { throw new JndiLookupException("could not retrieve: " + jndiName, e); } }
public synchronized SessionFactory getSessionFactory() { if (sessionFactory == null) { if (sessionFactoryJndiName != null) { sessionFactory = (SessionFactory) JndiUtil.lookup(sessionFactoryJndiName, SessionFactory.class); mustSessionFactoryBeClosed = false; } else { sessionFactory = getConfiguration().buildSessionFactory(); mustSessionFactoryBeClosed = true; } } return sessionFactory; }
public synchronized UserTransaction getUserTransaction() { if (userTransaction == null) { String jndiName = getConfiguration().getProperty("jta.UserTransaction"); if (jndiName == null) { /* * EJB 2.1 section 20.9 The container must make the UserTransaction interface available * to the enterprise beans that are allowed to use this interface (only session and * message-driven beans with bean-managed transaction demarcation are allowed to use * this interface) in JNDI under the name java:comp/UserTransaction. */ /* * J2EE 1.4 section 4.2.1.1 The J2EE platform must provide an object implementing the * UserTransaction interface to all web components. The platform must publish the * UserTransaction object in JNDI under the name java:comp/UserTransaction. */ jndiName = "java:comp/UserTransaction"; } userTransaction = (UserTransaction) JndiUtil.lookup(jndiName, UserTransaction.class); } return userTransaction; } }
public synchronized UserTransaction getUserTransaction() { if (userTransaction == null) { String jndiName = getJbpmHibernateConfiguration().getConfigurationProxy().getProperty("jta.UserTransaction"); if (jndiName == null) { /* * EJB 2.1 section 20.9 The container must make the UserTransaction interface available * to the enterprise beans that are allowed to use this interface (only session and * message-driven beans with bean-managed transaction demarcation are allowed to use * this interface) in JNDI under the name java:comp/UserTransaction. */ /* * J2EE 1.4 section 4.2.1.1 The J2EE platform must provide an object implementing the * UserTransaction interface to all web components. The platform must publish the * UserTransaction object in JNDI under the name java:comp/UserTransaction. */ jndiName = "java:comp/UserTransaction"; } userTransaction = (UserTransaction) JndiUtil.lookup(jndiName, UserTransaction.class); } return userTransaction; } }