use of com.dexels.navajo.functions.util.FunctionFactoryInterface in project navajo by Dexels.
the class AbstractCoreExtension method registerAllAdapters.
private void registerAllAdapters(ExtensionDefinition extensionDef) {
FunctionFactoryInterface fi = FunctionFactoryFactory.getInstance();
fi.init();
fi.clearFunctionNames();
fi.injectExtension(extensionDef);
for (String adapterName : fi.getAdapterNames(extensionDef)) {
fi.getAdapterConfig(extensionDef).get(adapterName);
String adapterClass = fi.getAdapterClass(adapterName, extensionDef);
Class<?> c = null;
try {
c = Class.forName(adapterClass, true, this.getClass().getClassLoader());
Dictionary<String, Object> props = new Hashtable<>();
props.put("adapterName", adapterName);
props.put("adapterClass", c.getName());
props.put("type", "adapter");
if (adapterClass != null) {
context.registerService(Class.class.getName(), c, props);
}
} catch (Exception e) {
logger.error("Error loading class for adapterClass: " + adapterClass, e);
}
}
}
use of com.dexels.navajo.functions.util.FunctionFactoryInterface in project navajo by Dexels.
the class AbstractCoreExtension method registerAllFunctions.
private void registerAllFunctions(ExtensionDefinition extensionDef) {
FunctionFactoryInterface fi = FunctionFactoryFactory.getInstance();
fi.init();
fi.clearFunctionNames();
fi.injectExtension(extensionDef);
final Set<String> functionNames = fi.getFunctionNames(extensionDef);
for (String functionName : functionNames) {
FunctionDefinition fd = fi.getDef(extensionDef, functionName);
registerFunction(context, fi, functionName, fd, extensionDef);
}
}
use of com.dexels.navajo.functions.util.FunctionFactoryInterface in project navajo by Dexels.
the class Version method start.
@Override
public void start(BundleContext bc) throws Exception {
super.start(bc);
bundleContext = bc;
try {
FunctionFactoryInterface fi = FunctionFactoryFactory.getInstance();
fi.init();
fi.clearFunctionNames();
StandardAdapterFunctionLibrary extensionDef = new StandardAdapterFunctionLibrary();
registerAll(extensionDef);
StandardAdapterLibrary library = new StandardAdapterLibrary();
registerAll(library);
} catch (Throwable e) {
logger.error("Trouble starting NavajoAdapters bundle", e);
}
}
Aggregations