Subversion Repositories XServices

Rev

Rev 201 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 201 Rev 203
Line 6... Line 6...
6
import org.apache.commons.configuration2.Configuration;
6
import org.apache.commons.configuration2.Configuration;
7
import org.apache.commons.configuration2.FileBasedConfiguration;
7
import org.apache.commons.configuration2.FileBasedConfiguration;
8
import org.apache.commons.configuration2.PropertiesConfiguration;
8
import org.apache.commons.configuration2.PropertiesConfiguration;
9
import org.apache.commons.configuration2.builder.FileBasedConfigurationBuilder;
9
import org.apache.commons.configuration2.builder.FileBasedConfigurationBuilder;
10
import org.apache.commons.configuration2.builder.PropertiesBuilderParametersImpl;
10
import org.apache.commons.configuration2.builder.PropertiesBuilderParametersImpl;
-
 
11
import org.apache.commons.configuration2.event.ConfigurationEvent;
-
 
12
import org.apache.commons.configuration2.event.EventListener;
11
import org.apache.commons.configuration2.ex.ConfigurationException;
13
import org.apache.commons.configuration2.ex.ConfigurationException;
Line 12... Line 14...
12
 
14
 
Line 13... Line 15...
13
import javax.servlet.ServletContext;
15
import javax.servlet.ServletContext;
Line 37... Line 39...
37
 
39
 
38
    private String targeturl;
40
    private String targeturl;
39
    private int interval;
41
    private int interval;
40
    private String jdbc_memdb;
42
    private String jdbc_memdb;
-
 
43
    private String jdbc_filedb;
-
 
44
    private boolean isEmitterActive = true;
Line 41... Line 45...
41
    private String jdbc_filedb;
45
    private int cleaner_interval;
42
 
46
 
43
 
47
 
44
    public synchronized EventmanagerConfiguration refreshConfig() {
48
    public synchronized EventmanagerConfiguration refreshConfig() {
45
        log.trace("Reading EventmanagerConfiguration from file eventmanager.properties.");
49
        log.trace("Reading EventmanagerConfiguration from file eventmanager.properties.");
Line 46... Line 50...
46
        FileBasedConfigurationBuilder<FileBasedConfiguration> builder =
50
        FileBasedConfigurationBuilder<FileBasedConfiguration> builder =
47
                new FileBasedConfigurationBuilder<FileBasedConfiguration>(PropertiesConfiguration.class)
51
                new FileBasedConfigurationBuilder<FileBasedConfiguration>(PropertiesConfiguration.class)
Line 48... Line 52...
48
                        .configure(new PropertiesBuilderParametersImpl().setFileName("eventmanager.properties"));
52
                        .configure(new PropertiesBuilderParametersImpl().setFileName("../eventmanager.properties"));
49
 
53
 
50
        try {
54
        try {
51
            Configuration config = builder.getConfiguration();
55
            Configuration config = builder.getConfiguration();
52
 
56
 
-
 
57
            /* Read from eventmanager.properties file */
-
 
58
            this.targeturl = config.getString("target.url");
Line 53... Line 59...
53
            /* Read from eventmanager.properties file */
59
            this.interval = config.getInt("interval", 10);
54
            this.targeturl = config.getString("target.url");
60
            this.jdbc_memdb = config.getString("memdb", "jdbc:h2:mem:lockdb;DB_CLOSE_DELAY=-1;");
55
            this.interval = config.getInt("interval", 10);
61
            this.jdbc_filedb = config.getString("fdb", "jdbc:h2:mem:lockdb;DB_CLOSE_DELAY=-1;");