Search in sources :

Example 1 with Extension

use of org.jumpmind.symmetric.model.Extension in project symmetric-ds by JumpMind.

the class ExtensionService method refresh.

public synchronized void refresh() {
    extensionsByClassByName = new HashMap<Class, Map<String, IExtensionPoint>>();
    extensionMetaData = new ArrayList<ExtensionPointMetaData>();
    for (Class extensionClass : staticExtensionsByClassByName.keySet()) {
        Map<String, IExtensionPoint> byNameMap = staticExtensionsByClassByName.get(extensionClass);
        for (String name : byNameMap.keySet()) {
            IExtensionPoint ext = byNameMap.get(name);
            getExtensionsByNameMap(extensionClass).put(name, ext);
            addExtensionPointMetaData(ext, name, extensionClass, true);
        }
    }
    String prefix = parameterService.getString(ParameterConstants.RUNTIME_CONFIG_TABLE_PREFIX);
    if (platform.getTableFromCache(TableConstants.getTableName(prefix, TableConstants.SYM_EXTENSION), false) != null) {
        List<Extension> extensionList = sqlTemplate.query(getSql("selectEnabled"), new ExtensionRowMapper(), parameterService.getNodeGroupId());
        log.info("Found {} extension points from the database that will be registered", extensionList.size());
        for (Extension extension : extensionList) {
            registerExtension(extension);
        }
    }
}
Also used : Extension(org.jumpmind.symmetric.model.Extension) IExtensionPoint(org.jumpmind.extension.IExtensionPoint) HashMap(java.util.HashMap) Map(java.util.Map) ExtensionPointMetaData(org.jumpmind.symmetric.ext.ExtensionPointMetaData)

Aggregations

HashMap (java.util.HashMap)1 Map (java.util.Map)1 IExtensionPoint (org.jumpmind.extension.IExtensionPoint)1 ExtensionPointMetaData (org.jumpmind.symmetric.ext.ExtensionPointMetaData)1 Extension (org.jumpmind.symmetric.model.Extension)1