1
import org.hibernate.ejb.*
2
import com.eucalyptus.util.*
3
import edu.ucsb.eucalyptus.cloud.ws.*;
6
'hibernate.archive.autodetection': 'jar, class, hbm',
7
'hibernate.show_sql': 'false',
8
'hibernate.format_sql': 'false',
9
'hibernate.connection.autocommit': 'true',
10
'hibernate.hbm2ddl.auto': 'update',
11
'hibernate.generate_statistics': 'true',
13
contexts = ['general','images','auth','config','walrus','storage','dns']
15
pool_config = new pools(new Binding([context_name:it])).run()
16
cache_config = new caches(new Binding([context_name:it])).run()
17
config = new Ejb3Configuration();
18
LogUtil.logHeader( "Hibernate for ${it}" ).log(hiber_config.inspect())
19
hiber_config.each { k, v -> config.setProperty(k, v) }
20
LogUtil.logHeader( "Pool for ${it}").log( pool_config.inspect() )
21
pool_config.each { k, v -> config.setProperty(k, v) }
22
LogUtil.logHeader( "Cache for ${it}").log( cache_config )
23
cache_config.each { k, v -> config.setProperty(k, v) }
24
entity_list = new entities(new Binding([context_name:it])).run()
25
LogUtil.logHeader("Entities for ${it}")
26
entity_list.each{ ent ->
27
LogUtil.log( ent.toString() )
28
config.addAnnotatedClass( ent )
31
DatabaseUtil.registerPersistenceContext("eucalyptus_${it}", config)
32
} catch( Throwable t ) {
37
WalrusControl.deferedInitializer( );
38
WalrusManager.deferedInitializer( );
39
BlockStorage.deferedInitializer( );