01: /*
02: * JBoss, Home of Professional Open Source.
03: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
04: * as indicated by the @author tags. See the copyright.txt file in the
05: * distribution for a full listing of individual contributors.
06: *
07: * This is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU Lesser General Public License as
09: * published by the Free Software Foundation; either version 2.1 of
10: * the License, or (at your option) any later version.
11: *
12: * This software is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: *
17: * You should have received a copy of the GNU Lesser General Public
18: * License along with this software; if not, write to the Free
19: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21: */
22: package javax.resource.cci;
23:
24: import java.io.Serializable;
25:
26: import javax.resource.Referenceable;
27: import javax.resource.ResourceException;
28:
29: /**
30: * The ConnectionFactory provides an interface for getting a Connection from
31: * the Resource adapter.
32: *
33: * The application retrieves a reference to the ConnectionFactory through a
34: * JNDI lookup.
35: *
36: * ConnectionFactory extends java.io.Serializable and
37: * javax.resource.Referenceable in order to support JNDI lookup.
38: */
39: public interface ConnectionFactory extends Serializable, Referenceable {
40: /**
41: * Gets a connection from the resource adapter. When using this method the
42: * client does not pass any security information, and wants the container to
43: * manage sign-on. This is called container managed sign-on.
44: */
45: public Connection getConnection() throws ResourceException;
46:
47: /**
48: * Gets a connection from the resource adapter. When using this method the
49: * client passes in the security information. This is called component
50: * managed sign-on.
51: */
52: public Connection getConnection(ConnectionSpec properties)
53: throws ResourceException;
54:
55: /**
56: * Gets a RecordFactory instance for use in creating Record objects.
57: */
58: public RecordFactory getRecordFactory() throws ResourceException;
59:
60: /**
61: * Gets metadata for the resource adapter. This call does not require an
62: * active connection.
63: */
64: public ResourceAdapterMetaData getMetaData()
65: throws ResourceException;
66: }
|