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.spi;
  6. import javax.resource.ResourceException;
  7. /** <p>ConnectionManager interface provides a hook for the resource adapter to
  8. * pass a connection request to the application server.
  9. *
  10. * <p>An application server provides implementation of the ConnectionManager
  11. * interface. This implementation is not specific to any particular type of
  12. * the resource adapter or connection factory interface.
  13. *
  14. * <p>The ConnectionManager implementation delegates to the application
  15. * server to enable latter to provide quality of services (QoS) - security,
  16. * connection pool management, transaction management and error
  17. * logging/tracing.
  18. *
  19. * <p>An application server implements these services in a generic manner,
  20. * independent of any resource adapter and EIS specific mechanisms. The
  21. * connector architecture does not specify how an application server
  22. * implements these services; the implementation is specific to an
  23. * application server.
  24. *
  25. * <p>After an application server hooks-in its services, the connection
  26. * request gets delegated to a ManagedConnectionFactory instance either
  27. * for the creation of a new physical connection or for the matching of
  28. * an already existing physical connection.
  29. *
  30. * <p><b<Note</b>An implementation class for ConnectionManager interface is
  31. * required to implement the java.io.Serializable interface.
  32. *
  33. * <p>In the non-managed application scenario, the ConnectionManager
  34. * implementation class can be provided either by a resource adapter (as
  35. * a default ConnectionManager implementation) or by application
  36. * developers. In both cases, QOS can be provided as components by third
  37. * party vendors.</p>
  38. *
  39. * @since 0.6
  40. * @author Rahul Sharma
  41. * @see javax.resource.spi.ManagedConnectionFactory
  42. **/
  43. public interface ConnectionManager
  44. extends java.io.Serializable {
  45. /** <p>The method allocateConnection gets called by the resource adapter's
  46. * connection factory instance. This lets connection factory instance
  47. * (provided by the resource adapter) pass a connection request to
  48. * the ConnectionManager instance.</p>
  49. *
  50. * <p>The connectionRequestInfo parameter represents information specific
  51. * to the resource adapter for handling of the connection request.</p>
  52. *
  53. * @param ManagedConnectionFactory
  54. * used by application server to delegate
  55. * connection matching/creation
  56. * @param ConnectionRequestInfo
  57. * connection request Information
  58. *
  59. * @return connection handle with an EIS specific connection interface.
  60. *
  61. *
  62. * @throws ResourceException Generic exception
  63. * @throws ApplicationServerInternalException
  64. * Application server specific exception
  65. * @throws SecurityException Security related error
  66. * @throws ResourceAllocationException
  67. * Failed to allocate system resources for
  68. * connection request
  69. * @throws ResourceAdapterInternalException
  70. * Resource adapter related error condition
  71. **/
  72. public
  73. Object allocateConnection(ManagedConnectionFactory mcf,
  74. ConnectionRequestInfo cxRequestInfo)
  75. throws ResourceException;
  76. }