Project

General

Profile

« Previous | Next » 

Revision 7584

move hazelcast config file location code into the MetacatIndexServlet init method

View differences:

metacat-index/src/main/java/edu/ucsb/nceas/metacat/index/MetacatIndexServlet.java
76 76
		} catch (ConfigurationException e) {
77 77
			log.error("Could not initialize shared Metacat properties. " + e.getMessage(), e);
78 78
		}
79
		// make sure hazelcast configuration is defined
80
		String hzConfigFileName = Settings.getConfiguration().getString("dataone.hazelcast.configFilePath");
81
		if (hzConfigFileName == null) {
82
			// use default metacat hazelcast.xml file in metacat deployment
83
			hzConfigFileName = 
84
    				Settings.getConfiguration().getString("application.deployDir") +
85
    				"/" +
86
    				Settings.getConfiguration().getString("application.context") + 
87
    				"/WEB-INF/hazelcast.xml";
88
			// set it for other parts of the code
89
			Settings.getConfiguration().setProperty("dataone.hazelcast.configFilePath", hzConfigFileName);
90
		}
79 91
		
80 92
        URL url = getClass().getResource("/index-processor-context.xml");
81 93
        //System.out.println("the url is "+url);
metacat-index/src/main/java/edu/ucsb/nceas/metacat/index/SystemMetadataEventListener.java
105 105
		try {
106 106
    		configFileName = Settings.getConfiguration().getString("dataone.hazelcast.configFilePath");
107 107
    		hzConfig = new FileSystemXmlConfig(configFileName);
108
    	} catch (Exception e) {
109
    		// use default metacat hazelcast.xml file in metacat deployment
110
    		configFileName = 
111
    				Settings.getConfiguration().getString("application.deployDir") +
112
    				"/" +
113
    				Settings.getConfiguration().getString("application.context") + 
114
    				"/WEB-INF/hazelcast.xml";
115
    		try {
116
				hzConfig = new FileSystemXmlConfig(configFileName);
117
			} catch (FileNotFoundException fnfe) {
118
				// TODO: anything we can do here?
119
				fnfe.printStackTrace();
120
			}
108
    	} catch (FileNotFoundException e) {
109
			e.printStackTrace();
121 110
    	}
122 111
		
123 112
        String hzGroupName = hzConfig.getGroupConfig().getName();

Also available in: Unified diff