1. /*
  2. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  3. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  4. */
  5. package javax.resource.cci;
  6. import java.util.Map;
  7. import java.util.Collection;
  8. import javax.resource.ResourceException;
  9. import javax.resource.NotSupportedException;
  10. /** The RecordFactory interface is used for creating MappedRecord and
  11. * IndexedRecord instances. Note that the RecordFactory is only used
  12. * for creation of generic record instances. A CCI implementation
  13. * provides an implementation class for the RecordFactory interface.
  14. *
  15. * @author Rahul Sharma
  16. * @since 0.8
  17. * @see javax.resource.cci.IndexedRecord
  18. * @see javax.resource.cci.MappedRecord
  19. **/
  20. public interface RecordFactory {
  21. /** Creates a MappedRecord. The method takes the name of the record
  22. * that is to be created by the RecordFactory. The name of the
  23. * record acts as a pointer to the meta information (stored in
  24. * the metadata repository) for a specific record type.
  25. *
  26. * @param recordName Name of the Record
  27. * @return MappedRecord
  28. * @throws ResourceException Failed to create a MappedRecord.
  29. * Example error cases are:
  30. *
  31. * <UL>
  32. * <LI> Invalid specification of record name
  33. * <LI> Resource adapter internal error
  34. * <LI> Failed to access metadata repository
  35. * </UL>
  36. * @throws NotSupportedException Operation not supported
  37. *
  38. **/
  39. public
  40. MappedRecord createMappedRecord(String recordName)
  41. throws ResourceException;
  42. /** Creates a IndexedRecord. The method takes the name of the record
  43. * that is to be created by the RecordFactory. The name of the
  44. * record acts as a pointer to the meta information (stored in
  45. * the metadata repository) for a specific record type.
  46. *
  47. * @param recordName Name of the Record
  48. * @return IndexedRecord
  49. * @throws ResourceException Failed to create an IndexedRecord.
  50. * Example error cases are:
  51. *
  52. * <UL>
  53. * <LI> Invalid specification of record name
  54. * <LI> Resource adapter internal error
  55. * <LI> Failed to access metadata repository
  56. * </UL>
  57. * @throws NotSupportedException Operation not supported
  58. **/
  59. public
  60. IndexedRecord createIndexedRecord(String recordName)
  61. throws ResourceException;
  62. }