1 16 17 package org.apache.jetspeed.services.db; 18 19 20 import javax.servlet.ServletConfig ; 21 22 import ojb.broker.PersistenceBroker; 24 import ojb.broker.PersistenceBrokerFactory; 25 26 import org.apache.turbine.services.TurbineBaseService; 28 import org.apache.turbine.services.InitializationException; 29 30 import org.apache.jetspeed.services.logging.JetspeedLogFactoryService; 32 import org.apache.jetspeed.services.logging.JetspeedLogger; 33 34 41 42 public class ObjectBridgeDatabaseService extends TurbineBaseService 43 implements JetspeedDatabaseService 44 { 45 48 private static final JetspeedLogger logger = JetspeedLogFactoryService.getLogger(ObjectBridgeDatabaseService.class.getName()); 49 50 PersistenceBroker pm = null; 51 52 59 public synchronized void init(ServletConfig conf) throws InitializationException { 60 61 if (getInit()) return; 63 64 try 65 { 66 System.setProperty("OJB.properties", "org/apache/jetspeed/services/db/conf/OJB.properties"); 67 pm = PersistenceBrokerFactory.createPersistenceBroker("org/apache/jetspeed/services/db/conf/repository.xml"); 68 } 69 catch (Exception e) 70 { 71 logger.error("Failed to load ObjectBridge Manager: " + e.toString(), e); 72 throw new InitializationException(e.toString()); 73 } 74 setInit(true); 76 77 } 78 79 80 public Object getPersistenceManager() 81 { 82 return pm; 83 } 84 85 92 public void init() throws InitializationException { 93 logger.info( "Late init for ObjectBridgeDatabaseService called" ); 94 } 95 96 100 public void shutdown() 101 { 102 } 103 104 } | Popular Tags |