📄 testworkingmemoryeventlistener.java
字号:
package org.drools;
/*
* Copyright 2005 JBoss Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.io.Serializable;
import org.drools.event.ActivationCancelledEvent;
import org.drools.event.ActivationCreatedEvent;
import org.drools.event.AfterActivationFiredEvent;
import org.drools.event.ObjectAssertedEvent;
import org.drools.event.ObjectModifiedEvent;
import org.drools.event.ObjectRetractedEvent;
import org.drools.event.WorkingMemoryEventListener;
public class TestWorkingMemoryEventListener
implements
WorkingMemoryEventListener,
Serializable {
/**
*
*/
private static final long serialVersionUID = 5049624024436577561L;
public int asserted;
public int modified;
public int retracted;
public int tested;
public int created;
public int cancelled;
public int fired;
public TestWorkingMemoryEventListener() {
// intentionally left blank
}
public void objectAsserted(final ObjectAssertedEvent event) {
this.asserted++;
}
public void objectModified(final ObjectModifiedEvent event) {
this.modified++;
}
public void objectRetracted(final ObjectRetractedEvent event) {
this.retracted++;
}
/*
* public void conditionTested(ConditionTestedEvent event) { tested++; }
*/
public void activationCreated(final ActivationCreatedEvent event) {
this.created++;
}
public void activationCancelled(final ActivationCancelledEvent event) {
this.cancelled++;
}
public void activationFired(final AfterActivationFiredEvent event) {
this.fired++;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -