/** * registers the namespace of the custom functions */ private void registerCustomFunctions() { // standard namespace this.config.addImport(CUSTOM_ESPER_FUNCTIONS_NAMESPACE); }
private static void handleAutoImports(Configuration configuration, Element element) { String name = element.getAttributes().getNamedItem("import-name").getTextContent(); configuration.addImport(name); }
public EPLManager addMethods(com.espertech.esper.client.Configuration configuration) { this.allMethods = DBUtils.qetAllMethods(); Collection<Method> methods = this.allMethods.values(); for(Method method : methods) { ConfigurationMethodRef methodRef = new ConfigurationMethodRef(); ConfigurationCacheReferenceType cacheReferenceType = null; if("WEAK".equals(method.getCacheReferenceType())) { cacheReferenceType = ConfigurationCacheReferenceType.WEAK; } else if("SOFT".equals(method.getCacheReferenceType())) { cacheReferenceType = ConfigurationCacheReferenceType.SOFT; } else { cacheReferenceType = ConfigurationCacheReferenceType.HARD; } methodRef.setExpiryTimeCache(method.getMaxAgeSeconds(), method.getPurgeIntervalSeconds(), cacheReferenceType); Class clazz = null; try { clazz = Class.forName(method.getMethodName()); } catch (ClassNotFoundException e) { e.printStackTrace(); } if(clazz == null) continue; LOG.info("Add customer method : " + method.getMethodName()); this.configuration.addMethodRef(clazz, methodRef); this.configuration.addImport(method.getMethodName()); } return this; }
public AlarmEPLManager addMethods(Configuration configuration) { this.allMethods = DBUtils.qetAllMethods(); Collection<Method> methods = this.allMethods.values(); for(Method method : methods) { ConfigurationMethodRef methodRef = new ConfigurationMethodRef(); ConfigurationCacheReferenceType cacheReferenceType = null; if("WEAK".equals(method.getCacheReferenceType())) { cacheReferenceType = ConfigurationCacheReferenceType.WEAK; } else if("SOFT".equals(method.getCacheReferenceType())) { cacheReferenceType = ConfigurationCacheReferenceType.SOFT; } else { cacheReferenceType = ConfigurationCacheReferenceType.HARD; } methodRef.setExpiryTimeCache(method.getMaxAgeSeconds(), method.getPurgeIntervalSeconds(), cacheReferenceType); Class clazz = null; try { clazz = Class.forName(method.getMethodName()); } catch (ClassNotFoundException e) { e.printStackTrace(); } if(clazz == null) continue; this.configuration.addMethodRef(clazz, methodRef); this.configuration.addImport(method.getMethodName()); } return this; }
public void recreateMethod(Method method) { Method md = this.allMethods.get(method.getMethodName()); if(md != null) this.configuration.removeImport(md.getMethodName()); ConfigurationMethodRef methodRef = new ConfigurationMethodRef(); ConfigurationCacheReferenceType cacheReferenceType = null; if("WEAK".equals(method.getCacheReferenceType())) { cacheReferenceType = ConfigurationCacheReferenceType.WEAK; } else if("SOFT".equals(method.getCacheReferenceType())) { cacheReferenceType = ConfigurationCacheReferenceType.SOFT; } else { cacheReferenceType = ConfigurationCacheReferenceType.HARD; } methodRef.setExpiryTimeCache(method.getMaxAgeSeconds(), method.getPurgeIntervalSeconds(), cacheReferenceType); Class clazz = null; try { clazz = Class.forName(method.getMethodName()); } catch (ClassNotFoundException e) { e.printStackTrace(); } this.configuration.addMethodRef(clazz, methodRef); this.configuration.addImport(method.getMethodName()); LOG.info("Recreate Method : " + method.getMethodName()); }
public void recreateMethod(Method method) { Method md = this.allMethods.get(method.getMethodName()); if(md != null) this.configuration.removeImport(md.getMethodName()); ConfigurationMethodRef methodRef = new ConfigurationMethodRef(); ConfigurationCacheReferenceType cacheReferenceType = null; if("WEAK".equals(method.getCacheReferenceType())) { cacheReferenceType = ConfigurationCacheReferenceType.WEAK; } else if("SOFT".equals(method.getCacheReferenceType())) { cacheReferenceType = ConfigurationCacheReferenceType.SOFT; } else { cacheReferenceType = ConfigurationCacheReferenceType.HARD; } methodRef.setExpiryTimeCache(method.getMaxAgeSeconds(), method.getPurgeIntervalSeconds(), cacheReferenceType); Class clazz = null; try { clazz = Class.forName(method.getMethodName()); } catch (ClassNotFoundException e) { e.printStackTrace(); } this.configuration.addMethodRef(clazz, methodRef); this.configuration.addImport(method.getMethodName()); LOG.info("Recreate Method : " + method.getMethodName()); }
for (Class<? extends Event> eventType : eventTypes) epConfig.addEventType(eventType); epConfig.addImport(IntoMethod.class); if (timeProvider != null) { epConfig.getEngineDefaults().getThreading().setInternalTimerEnabled(false);