protected void initialize( final IncQueryMatcher<IPatternMatch> matcher, String sourceParamName, String targetParamName) { if (initialized) { IncQueryLoggingUtil.getLogger(getClass()) .error("[QueryBasedFeature] Feature already initialized!"); return; } initialized = true; this.matcher = matcher; this.sourceParamName = sourceParamName; this.targetParamName = targetParamName; if (matcher.getPositionOfParameter(sourceParamName) == null) { IncQueryLoggingUtil.getLogger(getClass()) .error("[QueryBasedFeature] Source parameter " + sourceParamName + " not found!"); } if (targetParamName != null && matcher.getPositionOfParameter(targetParamName) == null) { IncQueryLoggingUtil.getLogger(getClass()) .error("[QueryBasedFeature] Target parameter " + targetParamName + " not found!"); } if ((targetParamName == null) != (getKind() == QueryBasedFeatureKind.COUNTER)) { IncQueryLoggingUtil.getLogger(getClass()) .error( "[QueryBasedFeature] Invalid configuration (no targetParamName needed for Counter)!"); } // IPatternMatch partialMatch = matcher.newEmptyMatch(); // partialMatch.set(sourceParamName, source); this.dm = matcher.newDeltaMonitor(true); engineLifecycleListener = new EngineLifecycleListener(); listener = new ModelUpdateListener(); }
protected AdvancedIncQueryEngine engineForMatcher() { return (AdvancedIncQueryEngine) matcher.getEngine(); }