01: package org.drools.spi;
02:
03: /*
04: * Copyright 2005 JBoss Inc
05: *
06: * Licensed under the Apache License, Version 2.0 (the "License");
07: * you may not use this file except in compliance with the License.
08: * You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
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: */
18:
19: import java.io.Serializable;
20:
21: import org.drools.FactHandle;
22: import org.drools.common.InternalFactHandle;
23:
24: /**
25: * Factory Interface to return new <code>FactHandle</code>s
26: *
27: * @see FactHandle
28: *
29: * @author <a href="mailto:mark.proctor@jboss.com">Mark Proctor</a>
30: * @author <a href="mailto:bob@werken.com">Bob McWhirter</a>
31: */
32: public interface FactHandleFactory extends Serializable {
33: /**
34: * Construct a handle with a new id.
35: *
36: * @return The handle.
37: */
38: InternalFactHandle newFactHandle(Object object);
39:
40: /**
41: * Increases the recency of the FactHandle
42: *
43: * @param factHandle
44: * The fact handle to have its recency increased.
45: */
46: public void increaseFactHandleRecency(InternalFactHandle factHandle);
47:
48: public void destroyFactHandle(InternalFactHandle factHandle);
49:
50: /**
51: * @return a fresh instance of the fact handle factory, with any IDs reset etc.
52: */
53: public FactHandleFactory newInstance();
54:
55: public Class getFactHandleType();
56: }
|