01: /*
02: Copyright (C) 2007 Mobixess Inc. http://www.java-objects-database.com
03:
04: This file is part of the JODB (Java Objects Database) open source project.
05:
06: JODB is free software; you can redistribute it and/or modify it under
07: the terms of version 2 of the GNU General Public License as published
08: by the Free Software Foundation.
09:
10: JODB is distributed in the hope that it will be useful, but WITHOUT ANY
11: WARRANTY; without even the implied warranty of MERCHANTABILITY or
12: FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13: for more details.
14:
15: You should have received a copy of the GNU General Public License along
16: with this program; if not, write to the Free Software Foundation, Inc.,
17: 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18: */
19: package com.mobixess.jodb.soda.api;
20:
21: /**
22: * for implementation of callback evaluations.
23: * <br><br>
24: * To constrain a {@link Query} node with your own callback
25: * <code>Evaluation</code>, construct an object that implements the
26: * <code>Evaluation</code> interface and register it by passing it
27: * to {@link Query#constrain(Object) Query#constrain(Object)}.
28: * <br><br>
29: * Evaluations are called as the last step during query execution,
30: * after all other constraints have been applied. Evaluations in higher
31: * level {@link Query} nodes in the query graph are called first.
32: */
33: public interface Evaluation extends java.io.Serializable {
34:
35: /**
36: * callback method during {@linkplain Query#execute query execution}.
37: * @param Candidate reference to the candidate persistent object.
38: */
39: public void evaluate(Candidate candidate);
40:
41: /**
42: * get activation depth for evaluation object. Return -1 to use default activation depth
43: * @return int activation depth or -1 for default activation depth
44: */
45: public int getActivationDepth();
46:
47: }
|