01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. 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,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */
19: package org.apache.openjpa.kernel;
20:
21: /**
22: * Allows facades to control the particulars of persistence operations
23: * through callbacks.
24: *
25: * @author Abe White
26: */
27: public interface OpCallbacks {
28:
29: public static final int OP_PERSIST = 0;
30: public static final int OP_DELETE = 1;
31: public static final int OP_REFRESH = 2;
32: public static final int OP_RETRIEVE = 3;
33: public static final int OP_RELEASE = 4;
34: public static final int OP_EVICT = 5;
35: public static final int OP_ATTACH = 6;
36: public static final int OP_DETACH = 7;
37: public static final int OP_NONTRANSACTIONAL = 8;
38: public static final int OP_TRANSACTIONAL = 9;
39: public static final int OP_LOCK = 10;
40:
41: public static final int ACT_NONE = 0;
42: public static final int ACT_CASCADE = 2 << 0;
43: public static final int ACT_RUN = 2 << 1;
44:
45: /**
46: * Process operation argument. Throw proper
47: * {@link org.apache.openjpa.util.OpenJPAException} for illegal value.
48: *
49: * @param op the operation constant
50: * @param arg the object passed to the operation
51: * @param sm the argument's state manager, or null if none
52: * @return the action to take on the argument
53: */
54: public int processArgument(int op, Object arg,
55: OpenJPAStateManager sm);
56: }
|