001: package org.drools.common;
002:
003: /*
004: * Copyright 2005 JBoss Inc
005: *
006: * Licensed under the Apache License, Version 2.0 (the "License");
007: * you may not use this file except in compliance with the License.
008: * You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing, software
013: * distributed under the License is distributed on an "AS IS" BASIS,
014: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015: * See the License for the specific language governing permissions and
016: * limitations under the License.
017: */
018:
019: import java.util.Map;
020:
021: import org.drools.FactException;
022: import org.drools.FactHandle;
023: import org.drools.RuleBase;
024: import org.drools.RuleBaseConfiguration;
025: import org.drools.StatefulSession;
026: import org.drools.WorkingMemory;
027: import org.drools.reteoo.Rete;
028: import org.drools.reteoo.ReteooWorkingMemory;
029: import org.drools.rule.CompositePackageClassLoader;
030: import org.drools.rule.MapBackedClassLoader;
031: import org.drools.rule.Package;
032: import org.drools.ruleflow.common.core.Process;
033: import org.drools.spi.FactHandleFactory;
034: import org.drools.spi.PropagationContext;
035:
036: public interface InternalRuleBase extends RuleBase {
037:
038: /**
039: * @return the id
040: */
041: public String getId();
042:
043: public int nextWorkingMemoryCounter();
044:
045: public FactHandleFactory newFactHandleFactory();
046:
047: public Map getGlobals();
048:
049: public Map getAgendaGroupRuleTotals();
050:
051: public RuleBaseConfiguration getConfiguration();
052:
053: public Package getPackage(String name);
054:
055: public Map getPackagesMap();
056:
057: void disposeStatefulSession(StatefulSession statefulSession);
058:
059: void executeQueuedActions();
060:
061: /**
062: * Assert a fact object.
063: *
064: * @param handle
065: * The handle.
066: * @param object
067: * The fact.
068: * @param workingMemory
069: * The working-memory.
070: *
071: * @throws FactException
072: * If an error occurs while performing the assertion.
073: */
074: public void assertObject(FactHandle handle, Object object,
075: PropagationContext context,
076: InternalWorkingMemory workingMemory) throws FactException;
077:
078: /**
079: * Retract a fact object.
080: *
081: * @param handle
082: * The handle.
083: * @param workingMemory
084: * The working-memory.
085: *
086: * @throws FactException
087: * If an error occurs while performing the retraction.
088: */
089: public void retractObject(FactHandle handle,
090: PropagationContext context,
091: ReteooWorkingMemory workingMemory) throws FactException;
092:
093: public void addClass(String className, byte[] bytes);
094:
095: public CompositePackageClassLoader getCompositePackageClassLoader();
096:
097: public MapBackedClassLoader getMapBackedClassLoader();
098:
099: public Rete getRete();
100:
101: public InternalWorkingMemory[] getWorkingMemories();
102:
103: public Process getProcess(String id);
104:
105: }
|