001: /**
002: * JOnAS : Java(TM) OpenSource Application Server
003: * Copyright (C) 2005 Bull S.A.
004: * Contact: jonas-team@objectweb.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * --------------------------------------------------------------------------
022: * $Id: ManagedConnectionFactoryImpl.java 7251 2005-08-17 13:13:45Z sauthieg $
023: * --------------------------------------------------------------------------
024: */package org.objectweb.jonas.jaxr.scout;
025:
026: import java.io.PrintWriter;
027: import java.util.Set;
028: import javax.resource.ResourceException;
029: import javax.resource.spi.ConnectionManager;
030: import javax.resource.spi.ConnectionRequestInfo;
031: import javax.resource.spi.ManagedConnection;
032: import javax.resource.spi.ManagedConnectionFactory;
033: import javax.security.auth.Subject;
034: import javax.xml.registry.ConnectionFactory;
035: import org.apache.ws.scout.registry.ConnectionFactoryImpl;
036:
037: /**
038: *
039: *
040: * @author Guillaume Sauthier
041: */
042: public class ManagedConnectionFactoryImpl implements
043: ManagedConnectionFactory {
044:
045: /**
046: * UID
047: */
048: private static final long serialVersionUID = 3258690988061833009L;
049:
050: /**
051: * PrintWriter
052: */
053: private PrintWriter pw = null;
054:
055: /**
056: * Query Manager URL
057: */
058: private String queryManagerURL = null;
059:
060: /**
061: * LifeCycle Manager URL
062: */
063: private String lifeCycleManagerURL = null;
064:
065: /**
066: * semantic Equivalence property
067: */
068: private String semanticEquivalences = null;
069:
070: /**
071: * Authentication method name to use
072: */
073: private String authenticationMethod = null;
074:
075: /**
076: * maxRows property
077: */
078: private Integer maxRows = null;
079:
080: /**
081: * Scheme of the postal address
082: */
083: private String postalAddressScheme = null;
084:
085: /**
086: * @see javax.resource.spi.ManagedConnectionFactory#createConnectionFactory(javax.resource.spi.ConnectionManager)
087: */
088: public Object createConnectionFactory(ConnectionManager manager)
089: throws ResourceException {
090: return newConnectionFactory();
091: }
092:
093: /**
094: * @return Returns a new JAXr ConnectionFactory instance
095: */
096: private ConnectionFactory newConnectionFactory() {
097: // create the CF
098: ConnectionFactoryImpl factory = new JConnectionFactory();
099: // assign properties
100: factory.setAuthenticationMethod(this .authenticationMethod);
101: factory.setLifeCycleManagerURL(this .lifeCycleManagerURL);
102: factory.setQueryManagerURL(this .queryManagerURL);
103: factory.setMaxRows(this .maxRows);
104: factory.setPostalAddressScheme(this .postalAddressScheme);
105: factory.setSemanticEquivalences(this .semanticEquivalences);
106: return factory;
107: }
108:
109: /**
110: * @see javax.resource.spi.ManagedConnectionFactory#createConnectionFactory()
111: */
112: public Object createConnectionFactory() throws ResourceException {
113: return newConnectionFactory();
114: }
115:
116: /**
117: * Not used.
118: * @see javax.resource.spi.ManagedConnectionFactory#createManagedConnection(javax.security.auth.Subject, javax.resource.spi.ConnectionRequestInfo)
119: */
120: public ManagedConnection createManagedConnection(Subject subject,
121: ConnectionRequestInfo cri) throws ResourceException {
122: // NA
123: return null;
124: }
125:
126: /**
127: * Not used.
128: * @see javax.resource.spi.ManagedConnectionFactory#matchManagedConnections(java.util.Set, javax.security.auth.Subject, javax.resource.spi.ConnectionRequestInfo)
129: */
130: public ManagedConnection matchManagedConnections(Set set,
131: Subject subject, ConnectionRequestInfo cri)
132: throws ResourceException {
133: // NA
134: return null;
135: }
136:
137: /**
138: * @see javax.resource.spi.ManagedConnectionFactory#setLogWriter(java.io.PrintWriter)
139: */
140: public void setLogWriter(PrintWriter pw) throws ResourceException {
141: this .pw = pw;
142: }
143:
144: /**
145: * @see javax.resource.spi.ManagedConnectionFactory#getLogWriter()
146: */
147: public PrintWriter getLogWriter() throws ResourceException {
148: return pw;
149: }
150:
151: /**
152: * @return Returns the authenticationMethod.
153: */
154: public String getAuthenticationMethod() {
155: return authenticationMethod;
156: }
157:
158: /**
159: * @param authenticationMethod The authenticationMethod to set.
160: */
161: public void setAuthenticationMethod(String authenticationMethod) {
162: this .authenticationMethod = authenticationMethod;
163: }
164:
165: /**
166: * @return Returns the lifeCycleManagerURL.
167: */
168: public String getLifeCycleManagerURL() {
169: return lifeCycleManagerURL;
170: }
171:
172: /**
173: * @param lifeCycleManagerURL The lifeCycleManagerURL to set.
174: */
175: public void setLifeCycleManagerURL(String lifeCycleManagerURL) {
176: this .lifeCycleManagerURL = lifeCycleManagerURL;
177: }
178:
179: /**
180: * @return Returns the maxRows.
181: */
182: public Integer getMaxRows() {
183: return maxRows;
184: }
185:
186: /**
187: * @param maxRows The maxRows to set.
188: */
189: public void setMaxRows(Integer maxRows) {
190: this .maxRows = maxRows;
191: }
192:
193: /**
194: * @return Returns the postalAddressScheme.
195: */
196: public String getPostalAddressScheme() {
197: return postalAddressScheme;
198: }
199:
200: /**
201: * @param postalAddressScheme The postalAddressScheme to set.
202: */
203: public void setPostalAddressScheme(String postalAddressScheme) {
204: this .postalAddressScheme = postalAddressScheme;
205: }
206:
207: /**
208: * @return Returns the queryManagerURL.
209: */
210: public String getQueryManagerURL() {
211: return queryManagerURL;
212: }
213:
214: /**
215: * @param queryManagerURL The queryManagerURL to set.
216: */
217: public void setQueryManagerURL(String queryManagerURL) {
218: this .queryManagerURL = queryManagerURL;
219: }
220:
221: /**
222: * @return Returns the semanticEquivalences.
223: */
224: public String getSemanticEquivalences() {
225: return semanticEquivalences;
226: }
227:
228: /**
229: * @param semanticEquivalences The semanticEquivalences to set.
230: */
231: public void setSemanticEquivalences(String semanticEquivalences) {
232: this.semanticEquivalences = semanticEquivalences;
233: }
234:
235: }
|