1 /* 2 * The contents of this file are subject to the terms 3 * of the Common Development and Distribution License 4 * (the License). You may not use this file except in 5 * compliance with the License. 6 * 7 * You can obtain a copy of the license at 8 * https://glassfish.dev.java.net/public/CDDLv1.0.html or 9 * glassfish/bootstrap/legal/CDDLv1.0.txt. 10 * See the License for the specific language governing 11 * permissions and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL 14 * Header Notice in each file and include the License file 15 * at glassfish/bootstrap/legal/CDDLv1.0.txt. 16 * If applicable, add the following below the CDDL Header, 17 * with the fields enclosed by brackets [] replaced by 18 * you own identifying information: 19 * "Portions Copyrighted [year] [name of copyright owner]" 20 * 21 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 22 */ 23 package javax.resource.cci; 24 25 import java.util.Map; 26 import java.util.Collection; 27 import javax.resource.ResourceException; 28 import javax.resource.NotSupportedException; 29 30 31 /** The RecordFactory interface is used for creating MappedRecord and 32 * IndexedRecord instances. Note that the RecordFactory is only used 33 * for creation of generic record instances. A CCI implementation 34 * provides an implementation class for the RecordFactory interface. 35 * 36 * @author Rahul Sharma 37 * @since 0.8 38 * @see javax.resource.cci.IndexedRecord 39 * @see javax.resource.cci.MappedRecord 40 **/ 41 public interface RecordFactory { 42 43 /** Creates a MappedRecord. The method takes the name of the record 44 * that is to be created by the RecordFactory. The name of the 45 * record acts as a pointer to the meta information (stored in 46 * the metadata repository) for a specific record type. 47 * 48 * @param recordName Name of the Record 49 * @return MappedRecord 50 * @throws ResourceException Failed to create a MappedRecord. 51 * Example error cases are: 52 * 53 * <UL> 54 * <LI> Invalid specification of record name 55 * <LI> Resource adapter internal error 56 * <LI> Failed to access metadata repository 57 * </UL> 58 * @throws NotSupportedException Operation not supported 59 * 60 **/ 61 public 62 MappedRecord createMappedRecord(String recordName) 63 throws ResourceException; 64 65 /** Creates a IndexedRecord. The method takes the name of the record 66 * that is to be created by the RecordFactory. The name of the 67 * record acts as a pointer to the meta information (stored in 68 * the metadata repository) for a specific record type. 69 * 70 * @param recordName Name of the Record 71 * @return IndexedRecord 72 * @throws ResourceException Failed to create an IndexedRecord. 73 * Example error cases are: 74 * 75 * <UL> 76 * <LI> Invalid specification of record name 77 * <LI> Resource adapter internal error 78 * <LI> Failed to access metadata repository 79 * </UL> 80 * @throws NotSupportedException Operation not supported 81 **/ 82 public 83 IndexedRecord createIndexedRecord(String recordName) 84 throws ResourceException; 85 86 } 87 88