public PlannerException( RuleRegistry registry, PlanPhase phase, Rule rule, ElementGraph elementGraph, Throwable throwable ) { super( "registry: " + registry.getName() + ", phase: " + phase + ", failed on rule: " + rule.getRuleName() + ( elementGraph != null ? ", see attached source element-graph" : "" ), throwable ); this.elementGraph = elementGraph; }
@Override public int compare( RuleResult lhs, RuleResult rhs ) { // preserver order of preference from rule registry if all things are equal return registrySet.indexOf( lhs.getRegistry() ) - registrySet.indexOf( rhs.getRegistry() ); } };
public RuleExpression( ExpressionGraph matchExpression ) { this.contractionExpression = null; this.contractedMatchExpression = null; this.matchExpression = matchExpression; verify(); }
private void notifyIllegal() { if( illegal.isEmpty() ) return; for( RuleResult ruleResult : illegal ) getFlowLogger().logInfo( "rule registry: {}, found assembly to be malformed", ruleResult.getRegistry().getName() ); if( !registrySet.isIgnoreFailed() || success.isEmpty() ) rethrow( illegal.get( 0 ).getPlannerException() ); }
private void resolveElements( RuleResult ruleResult ) { if( !registry.enabledResolveElements() ) return; FlowElementGraph elementGraph = ruleResult.getAssemblyGraph(); elementGraph = (FlowElementGraph) elementGraph.copyElementGraph(); ScopeResolver.resolveFields( elementGraph ); ruleResult.setLevelResults( ProcessLevel.Assembly, ruleResult.initialAssembly, elementGraph ); }
public ResultStatus getResultStatus() { if( isSuccess() ) return ResultStatus.SUCCESS; if( isUnsupported() ) return ResultStatus.UNSUPPORTED; if( isInterrupted() ) return ResultStatus.INTERRUPTED; return ResultStatus.ILLEGAL; }
public ExpressionRulePartitioner( PlanPhase phase, RuleExpression ruleExpression, Enum... annotationExcludes ) { this( null, phase, ruleExpression.getContractionExpression(), ruleExpression.getMatchExpression() ); if( annotationExcludes != null ) this.annotationExcludes = annotationExcludes; }
public String getRuleName() { if( rulePartitioner != null ) return rulePartitioner.getRuleName(); return "none"; }
protected Comparator<RuleResult> getPlanComparator() { if( registrySet.getPlanComparator() != null ) return registrySet.getPlanComparator(); return DEFAULT_PLAN_COMPARATOR; }
public RuleResult( FlowElementGraph initialAssembly ) { this(); initResult( initialAssembly ); }
public ElementFactory getElementFactoryFor( String factoryName ) { return ruleRegistry.getElementFactory( factoryName ); } }
@Override public String toString() { return getRuleName(); } }
public PlannerException( PlanPhase phase, Rule rule, ElementGraph elementGraph, Throwable throwable ) { super( "phase: " + phase + ", failed on rule: " + rule.getRuleName() + ( elementGraph != null ? ", see attached source element-graph" : "" ), throwable ); this.elementGraph = elementGraph; }
private void notifyUnsupported() { if( unsupported.isEmpty() ) return; for( RuleResult ruleResult : unsupported ) getFlowLogger().logInfo( "rule registry: {}, does not support assembly", ruleResult.getRegistry().getName() ); if( !registrySet.isIgnoreFailed() || success.isEmpty() && illegal.isEmpty() && interrupted.isEmpty() ) rethrow( unsupported.get( 0 ).getPlannerException() ); }
public ExpressionRulePartitioner( LogLevel logLevel, PlanPhase phase, RuleExpression ruleExpression, Enum... annotationExcludes ) { this( logLevel, phase, ruleExpression.getContractionExpression(), ruleExpression.getMatchExpression() ); if( annotationExcludes != null ) this.annotationExcludes = annotationExcludes; }
public PlannerException( RuleRegistry registry, PlanPhase phase, Rule rule, Throwable throwable ) { super( "registry: " + registry.getName() + ", phase: " + phase + ", failed on rule: " + rule.getRuleName(), throwable ); }
public RuleExpression( ExpressionGraph contractionExpression, ExpressionGraph matchExpression ) { this.contractionExpression = contractionExpression; this.contractedMatchExpression = null; this.matchExpression = matchExpression; verify(); }
@Override public String toString() { return getRuleName(); } }
public ExpressionRulePartitioner( LogLevel logLevel, PlanPhase phase, PartitionSource partitionSource, RuleExpression ruleExpression, Enum... annotationExcludes ) { this( logLevel, phase, partitionSource, ruleExpression.getContractionExpression(), ruleExpression.getMatchExpression() ); if( annotationExcludes != null ) this.annotationExcludes = annotationExcludes; }
public RuleExpression( ExpressionGraph contractionExpression, ExpressionGraph contractedMatchExpression, ExpressionGraph matchExpression ) { this.contractionExpression = contractionExpression; this.contractedMatchExpression = contractedMatchExpression; this.matchExpression = matchExpression; verify(); }