juddi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ashley (JIRA)" <juddi-...@ws.apache.org>
Subject [jira] [Commented] (JUDDI-517) Externalising Persistence Properties
Date Tue, 06 Sep 2011 06:32:09 GMT

    [ https://issues.apache.org/jira/browse/JUDDI-517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13097761#comment-13097761
] 

Ashley commented on JUDDI-517:
------------------------------

Hi Kurt,

Sorry for the late reply, juddi properties is externalized ie. if you give the path of juddi.properties
in the JVM args, juddi.properties will not be picked up from the WAR.

following is a code snippet from appconfig.java 
private void loadConfiguration() throws ConfigurationException
      {
            //Properties from system properties
            CompositeConfiguration compositeConfig = new CompositeConfiguration();
            compositeConfig.addConfiguration(new SystemConfiguration());
            //Properties from file
            PropertiesConfiguration propConfig = null;
              final String filename = System.getProperty("juddi.propertiesFile");
            if (filename != null)
            {
                  propConfig = new PropertiesConfiguration(filename);
            } else {
                  propConfig = new PropertiesConfiguration(JUDDI_PROPERTIES);
            }


> Externalising Persistence Properties
> ------------------------------------
>
>                 Key: JUDDI-517
>                 URL: https://issues.apache.org/jira/browse/JUDDI-517
>             Project: jUDDI
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 3.0.4
>         Environment: Websphere App Server 7 and DB2 DB
>            Reporter: Ashley
>            Assignee: Kurt T Stam
>              Labels: juddi
>
> Properties of Persistence xml needs to be externalized.
> Changes with need to be done
> 1) org.apache.juddi.config.Property.java
>       public final static String PERSISTENCE_PROVIDER                   ="persistenceProvider";
>       public final static String DATASOURCE                                   ="hibernate.connection.datasource";
>       public final static String HBM_DDL_AUTO                                 ="hibernate.hbm2ddl.auto";
>       public final static String DEFAULT_SCHEMA                         ="hibernate.default_schema";
>       public final static String HIBERNATE_DIALECT                      ="hibernate.dialect";
> 2) org.apache.juddi.config.AppConfig.java
>       private void loadConfiguration() throws ConfigurationException
>       {
>             ....
>             if(propConfig.getString(Property.PERSISTENCE_PROVIDER).equalsIgnoreCase("Hibernate")){
>                   properties = new HashMap<String, String>();
>                 properties.put("hibernate.connection.datasource",propConfig.getString(Property.DATASOURCE));
>                   properties.put("hibernate.hbm2ddl.auto",propConfig.getString(Property.HBM_DDL_AUTO));
>                   properties.put("hibernate.default_schema",propConfig.getString(Property.DEFAULT_SCHEMA));
>                 properties.put("hibernate.dialect",propConfig.getString(Property.HIBERNATE_DIALECT));
>             }
>             ....
>       }
>  
> 3) org.apache.juddi.config. PersistenceManager.java
> protected static void initializeEntityManagerFactory(String persistenceUnitName,Map<String,
String> properties) {
>             try {
> if (emf == null ){
>                         if(properties != null){
>                            emf = Persistence.createEntityManagerFactory(persistenceUnitName,properties);
>                      }else{
>                               emf = Persistence.createEntityManagerFactory(persistenceUnitName);
>                         }
>                   }
>             }
> }
>  

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message