Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
DroolsInterface |
|
| 1.0;1 |
1 | /* | |
2 | Drools5 Integration Helper | |
3 | Copyright (C) 2009 Mathieu Boretti mathieu.boretti@gmail.com | |
4 | ||
5 | This program is free software: you can redistribute it and/or modify | |
6 | it under the terms of the GNU General Public License as published by | |
7 | the Free Software Foundation, either version 3 of the License, or | |
8 | (at your option) any later version. | |
9 | ||
10 | This program is distributed in the hope that it will be useful, | |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | GNU General Public License for more details. | |
14 | ||
15 | You should have received a copy of the GNU General Public License | |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | |
17 | ||
18 | */ | |
19 | package org.boretti.drools.integration.drools5; | |
20 | ||
21 | import org.drools.RuleBase; | |
22 | import org.drools.StatefulSession; | |
23 | ||
24 | /** | |
25 | * This interface is implemented by concrete instance of Drools Proxy. | |
26 | * | |
27 | * These methods are only provided for case it is required for user of | |
28 | * the interface to have access to internal Drools Stuff. | |
29 | * | |
30 | * The proxy must be explicitly casted to DroolsInterface. | |
31 | * | |
32 | * @author mbo | |
33 | * | |
34 | */ | |
35 | public interface DroolsInterface { | |
36 | /** | |
37 | * This method returns the RuleBase associated with this drools proxy. | |
38 | * @return The RuleBase or null if no rule base was found | |
39 | */ | |
40 | public RuleBase getRuleBase(); | |
41 | ||
42 | /** | |
43 | * This method returns the current session. | |
44 | * @return The current session or null if the session has not been started. | |
45 | */ | |
46 | public StatefulSession getCurrentSession(); | |
47 | ||
48 | /** | |
49 | * This method returns a specific field of the variable internal field of the | |
50 | * DroolsInterface | |
51 | * @param name | |
52 | * @param clazz | |
53 | * @return null if the field is not set or doesn't exists. Else, it return the | |
54 | * field. | |
55 | */ | |
56 | public <T> T getFieldByName(String name,Class<T> clazz); | |
57 | } |