/** * Establishes node equality (based on the processor's identifier) * * @param other node * @return true if equal */ @Override public boolean equals(final Object other) { if (!(other instanceof ProcessorNode)) { return false; } final ProcessorNode on = (ProcessorNode) other; return new EqualsBuilder().append(identifier.get(), on.getIdentifier()).isEquals(); }
@Override public void setName(final String name) { writeLock.lock(); try { if (isRunning()) { throw new IllegalStateException( "Cannot modify Processor configuration while the Processor is running"); } super.setName(name); } finally { writeLock.unlock(); } }
private void addProcessor(final Element parentElement, final ProcessorNode processor) { final Document doc = parentElement.getOwnerDocument(); final Element element = doc.createElement("processor"); parentElement.appendChild(element); addTextElement(element, "id", processor.getIdentifier()); addTextElement(element, "name", processor.getName()); addPosition(element, processor.getPosition()); addStyle(element, processor.getStyle()); addTextElement(element, "comment", processor.getComments()); addTextElement(element, "class", processor.getProcessor().getClass().getCanonicalName()); addTextElement(element, "maxConcurrentTasks", processor.getMaxConcurrentTasks()); addTextElement(element, "schedulingPeriod", processor.getSchedulingPeriod()); addTextElement(element, "penalizationPeriod", processor.getPenalizationPeriod()); addTextElement(element, "yieldPeriod", processor.getYieldPeriod()); addTextElement(element, "bulletinLevel", processor.getBulletinLevel().toString()); addTextElement(element, "lossTolerant", String.valueOf(processor.isLossTolerant())); addTextElement(element, "scheduledState", processor.getScheduledState().name()); addTextElement(element, "schedulingStrategy", processor.getSchedulingStrategy().name()); addTextElement(element, "runDurationNanos", processor.getRunDuration(TimeUnit.NANOSECONDS)); addConfiguration(element, processor.getProperties(), processor.getAnnotationData(), encryptor); for (final Relationship rel : processor.getAutoTerminatedRelationships()) { addTextElement(element, "autoTerminatedRelationship", rel.getName()); } }