/** * static accessor for singleton TransactionalResourceCommandDAO * * @return singleton instance of TransactionalResourceCommandDAO */ public static TransactionalResourceCommandDAO getTransactionalResourceCommandDAO() { if (transactionalResourceCommandDAO == null) { InputStream transactionalResourceCommandMappings = Thread .currentThread() .getContextClassLoader() .getResourceAsStream("TransactionalResourceCommand.hbm.xml"); InputStream xidImplMappings = Thread.currentThread() .getContextClassLoader().getResourceAsStream( "XidImpl.hbm.xml"); Configuration cfg = generateConfiguration(); cfg.setProperty(Environment.DATASOURCE, "java:/datasource/ikasan/ds"); cfg.addInputStream(transactionalResourceCommandMappings); cfg.addInputStream(xidImplMappings); transactionalResourceCommandDAO = new HibernateTransactionalResourceCommandDAO( cfg.buildSessionFactory()); } return transactionalResourceCommandDAO; }