4 * Copyright 2004-2007 MTBJ, Inc.
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
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.
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
{
36 * Returns the RulesDirectory used to create this session.
37 * @return RulesDirectory
39 public abstract RulesDirectory
getRulesDirectory();
41 * Returns the RuleSet associated with this Session.
44 public abstract RuleSet
getRuleSet();
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
;
67 * Returns the Rules Engine State for this Session.
70 public abstract DTState
getState();
72 public abstract EntityFactory
getEntityFactory() ;
75 * Debugging aid that allows you to dump an Entity and its attributes.
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
;
89 * Get the default mapping
92 public Mapping
getMapping ();
95 * Get a named mapping file
99 public Mapping
getMapping (String filename
);