initial load
[DTRules.git] / DTRules / src / main / java / com / dtrules / session / IRSession.java
blob729a18ab3aaeee30aa023b71d7ad3063052f5b3c
1 /*
2 * $Id$
3 *
4 * Copyright 2004-2007 MTBJ, Inc.
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
19 package com.dtrules.session;
21 import java.io.PrintStream;
22 import java.rmi.RemoteException;
24 import javax.rules.InvalidRuleSessionException;
25 import javax.rules.RuleExecutionSetMetadata;
27 import com.dtrules.entity.IREntity;
28 import com.dtrules.entity.REntity;
29 import com.dtrules.infrastructure.RulesException;
30 import com.dtrules.mapping.Mapping;
31 import com.dtrules.xmlparser.IXMLPrinter;
33 public interface IRSession {
35 /**
36 * Returns the RulesDirectory used to create this session.
37 * @return RulesDirectory
39 public abstract RulesDirectory getRulesDirectory();
40 /**
41 * Returns the RuleSet associated with this Session.
42 * @return
44 public abstract RuleSet getRuleSet();
46 /**
47 * Creates a new uniqueID. This ID is unique within the RSession, but
48 * not across all RSessions. Unique IDs are used to relate references
49 * between objects when writing out trace files, or to reconstruct a RSession
50 * when reading in a trace file.
52 * @return A unique integer.
54 public abstract int getUniqueID();
56 public abstract RuleExecutionSetMetadata getRuleExecutionSetMetadata();
58 public abstract void release() throws RemoteException,
59 InvalidRuleSessionException;
61 public abstract int getType() throws RemoteException,
62 InvalidRuleSessionException;
64 public abstract void execute(String s) throws RulesException;
66 /**
67 * Returns the Rules Engine State for this Session.
68 * @return
70 public abstract DTState getState();
72 public abstract EntityFactory getEntityFactory() ;
74 /**
75 * Debugging aid that allows you to dump an Entity and its attributes.
76 * @param e
78 public void dump(REntity e) throws RulesException;
80 public void printEntity(IXMLPrinter rpt, String tag, IREntity e) throws Exception ;
82 public void printEntityReport(IXMLPrinter rpt, DTState state, String iRObjname );
84 public void printEntityReport(IXMLPrinter rpt, boolean verbose, DTState state, String iRObjname );
86 public void printBalancedTables(PrintStream out)throws RulesException;
88 /**
89 * Get the default mapping
90 * @return
92 public Mapping getMapping ();
94 /**
95 * Get a named mapping file
96 * @param filename
97 * @return
99 public Mapping getMapping (String filename);