Adding new extension loading object.
@@ -20,13 +20,13 @@ package org.wso2.siddhi.core.config;
import com.lmax.disruptor.ExceptionHandler;
import org.apache.log4j.Logger;
-import org.wso2.siddhi.core.util.SiddhiConstants;
import org.wso2.siddhi.core.util.SiddhiExtensionLoader;
import org.wso2.siddhi.core.util.extension.holder.AbstractExtensionHolder;
import org.wso2.siddhi.core.util.persistence.PersistenceStore;
import org.wso2.siddhi.core.util.statistics.metrics.SiddhiMetricsFactory;
import javax.sql.DataSource;
+import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@@ -35,14 +35,14 @@ public class SiddhiContext {
private static final Logger log = Logger.getLogger(SiddhiContext.class);
private ExceptionHandler<Object> defaultDisrupterExceptionHandler;
- private Map<String, Class> siddhiExtensions;
+ private Map<String, Class> siddhiExtensions = new HashMap<>();
private PersistenceStore persistenceStore = null;
private ConcurrentHashMap<String, DataSource> siddhiDataSources;
private StatisticsConfiguration statisticsConfiguration;
private ConcurrentHashMap<Class, AbstractExtensionHolder> extensionHolderMap;
public SiddhiContext() {
- setSiddhiExtensions(SiddhiExtensionLoader.loadSiddhiExtensions());
+ new SiddhiExtensionLoader().loadSiddhiExtensions(siddhiExtensions);
siddhiDataSources = new ConcurrentHashMap<String, DataSource>();
statisticsConfiguration = new StatisticsConfiguration(new SiddhiMetricsFactory());
extensionHolderMap = new ConcurrentHashMap<Class, AbstractExtensionHolder>();
@@ -68,10 +68,6 @@ public class SiddhiContext {
return siddhiExtensions;
}
- public void setSiddhiExtensions(Map<String, Class> siddhiExtensions) {
- this.siddhiExtensions = siddhiExtensions;
- }
-
public PersistenceStore getPersistenceStore() {
return persistenceStore;
}
