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.persistence;
20:
21: import java.util.Map;
22:
23: import org.apache.openjpa.conf.OpenJPAConfiguration;
24:
25: public interface OpenJPAEntityManagerFactorySPI extends
26: OpenJPAEntityManagerFactory {
27:
28: /**
29: * Register a listener for lifecycle-related events on the specified
30: * classes. If the classes are null, all events will be propagated to
31: * the listener. The listener will be passed on to all new entity
32: * managers. See the <code>org.apache.openjpa.event</code> package for
33: * listener types.
34: *
35: * @since 0.3.3
36: */
37: public void addLifecycleListener(Object listener, Class... classes);
38:
39: /**
40: * Remove a listener for lifecycle-related events.
41: *
42: * @since 0.3.3
43: */
44: public void removeLifecycleListener(Object listener);
45:
46: /**
47: * Register a listener for transaction-related events on the specified
48: * classes. The listener will be passed on to all new entity
49: * managers. See the <code>org.apache.openjpa.event</code> package for
50: * listener types.
51: *
52: * @since 1.0.0
53: */
54: public void addTransactionListener(Object listener);
55:
56: /**
57: * Remove a listener for transaction-related events.
58: *
59: * @since 1.0.0
60: */
61: public void removeTransactionListener(Object listener);
62:
63: /**
64: * Return the configuration for this factory.
65: */
66: public OpenJPAConfiguration getConfiguration();
67:
68: public OpenJPAEntityManagerSPI createEntityManager();
69:
70: public OpenJPAEntityManagerSPI createEntityManager(Map props);
71: }
|