KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > orm > jpa > persistenceunit > PersistenceUnitManager


1 /*
2  * Copyright 2002-2006 the original author or authors.
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
17 package org.springframework.orm.jpa.persistenceunit;
18
19 import javax.persistence.spi.PersistenceUnitInfo;
20
21 /**
22  * Interface that defines an abstraction for finding and managing JPA
23  * PersistenceUnitInfos. Used by LocalContainerEntityManagerFactoryBean
24  * to obtain a PersistenceUnitInfo for building an EntityManagerFactory.
25  *
26  * <p>Obtaining a PersistenceUnitInfo instance is an exclusive process.
27  * A PersistenceUnitInfo instance is not available for further calls
28  * anymore once it has been obtained.
29  *
30  * @author Juergen Hoeller
31  * @since 2.0
32  * @see DefaultPersistenceUnitManager
33  * @see org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean#setPersistenceUnitManager
34  */

35 public interface PersistenceUnitManager {
36
37     /**
38      * Obtain the default PersistenceUnitInfo from this manager.
39      * @throws IllegalStateException if there is no default PersistenceUnitInfo defined
40      * or it has already been obtained
41      */

42     PersistenceUnitInfo obtainDefaultPersistenceUnitInfo() throws IllegalStateException JavaDoc;
43
44     /**
45      * Obtain the default PersistenceUnitInfo from this manager.
46      * @throws IllegalArgumentException if no PersistenceUnitInfo with the given
47      * name is defined
48      * @throws IllegalStateException if the PersistenceUnitInfo with the given
49      * name has already been obtained
50      */

51     PersistenceUnitInfo obtainPersistenceUnitInfo(String JavaDoc persistenceUnitName)
52             throws IllegalArgumentException JavaDoc, IllegalStateException JavaDoc;
53
54 }
55
Popular Tags