[esb-java-dev] svn commit r703 -
esb/java/trunk/modules/core/src/main/java/org/wso2/esb/persistence
svn at wso2.com
svn at wso2.com
Sun Feb 4 21:06:37 PST 2007
Author: chathura
Date: Sun Feb 4 21:06:33 2007
New Revision: 703
Modified:
esb/java/trunk/modules/core/src/main/java/org/wso2/esb/persistence/PersistenceManager.java
Log:
Persistence methods for ESBRegistry.
Modified: esb/java/trunk/modules/core/src/main/java/org/wso2/esb/persistence/PersistenceManager.java
==============================================================================
--- esb/java/trunk/modules/core/src/main/java/org/wso2/esb/persistence/PersistenceManager.java (original)
+++ esb/java/trunk/modules/core/src/main/java/org/wso2/esb/persistence/PersistenceManager.java Sun Feb 4 21:06:33 2007
@@ -18,8 +18,11 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.esb.persistence.dao.StatisticsDAO;
+import org.wso2.esb.persistence.dao.RegistryEntryDAO;
import org.wso2.esb.persistence.dataobject.StatisticsDO;
+import org.wso2.esb.persistence.dataobject.RegistryEntryDO;
import org.wso2.esb.util.HibernateConfig;
+import org.wso2.esb.util.HibernateConfigFactory;
import java.util.List;
@@ -36,6 +39,11 @@
private HibernateConfig hbConfig;
private static Log log = LogFactory.getLog(PersistenceManager.class);
+ public PersistenceManager() {
+ this.hbConfig = HibernateConfigFactory.getDefaultConfig(
+ org.wso2.esb.Constants.WSO2ESB_HB_CONFIG_KEY, "wso2esb.hibernate.cfg.xml");
+ }
+
public PersistenceManager(HibernateConfig hbConfig) {
this.hbConfig = hbConfig;
}
@@ -102,4 +110,21 @@
return new StatisticsDAO(hbConfig).selectCustomObjectList(hqlQuery);
}
+ /* Data access methods for ESB registry */
+
+ public void addRegistryEntry(RegistryEntryDO registryEntryDO) {
+ new RegistryEntryDAO(hbConfig).addRegistryEntry(registryEntryDO);
+ }
+
+ public void updateRegistryEntry(RegistryEntryDO registryEntryDO) {
+ new RegistryEntryDAO(hbConfig).updateRegistryEntry(registryEntryDO);
+ }
+
+ public void saveOrUpdateRegistryEntry(RegistryEntryDO registryEntryDO) {
+ new RegistryEntryDAO(hbConfig).saveOrUpdateRegistryEntry(registryEntryDO);
+ }
+
+ public RegistryEntryDO getRegistryEntry(String key) {
+ return new RegistryEntryDAO(hbConfig).getRegistryEntry(key);
+ }
}
More information about the Esb-java-dev
mailing list