Skip to content

Commit 5115b3a

Browse files
JBRULES-1734 Drools-API
-added SessionClock git-svn-id: http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk@21561 c60d74c8-e8f6-0310-9e8f-d4a2fc68ab70
1 parent c0086e4 commit 5115b3a

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
package org.drools;
22

3+
import org.drools.time.SessionClock;
4+
35
public interface StatefulRuleSession {
46
FactHandle insertObject(Object object);
57
void retractObject(FactHandle factHandle);
68
void updateObject(FactHandle factHandle);
79
void updateObject(FactHandle factHandle, Object object);
810

911
void fireAllRules();
12+
13+
void halt();
14+
15+
/**
16+
* Returns the session clock instance associated with this session
17+
* @return
18+
*/
19+
public SessionClock getSessionClock();
1020
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Copyright 2007 JBoss Inc
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
* Created on Oct 17, 2007
17+
*/
18+
package org.drools.time;
19+
20+
21+
/**
22+
* A clock interface that all engine clocks must implement
23+
*
24+
*/
25+
public interface SessionClock {
26+
27+
/**
28+
* Returns the current time. There is no semantics attached
29+
* to the long return value, so it will depend on the actual
30+
* implementation. For isntance, for a real clock it may be
31+
* milliseconds.
32+
*
33+
* @return The current time. The unit of the time, depends on
34+
* the actual clock implementation.
35+
*
36+
*/
37+
public long getCurrentTime();
38+
39+
}

0 commit comments

Comments
 (0)