1 /*
2 * Copyright (c) 2006 Stiftung Deutsches Elektronen-Synchroton,
3 * Member of the Helmholtz Association, (DESY), HAMBURG, GERMANY.
4 *
5 * THIS SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "../AS IS" BASIS.
6 * WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
7 * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR PARTICULAR PURPOSE AND
8 * NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
9 * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
10 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
11 * THE USE OR OTHER DEALINGS IN THE SOFTWARE. SHOULD THE SOFTWARE PROVE DEFECTIVE
12 * IN ANY RESPECT, THE USER ASSUMES THE COST OF ANY NECESSARY SERVICING, REPAIR OR
13 * CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE.
14 * NO USE OF ANY SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
15 * DESY HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
16 * OR MODIFICATIONS.
17 * THE FULL LICENSE SPECIFYING FOR THE SOFTWARE THE REDISTRIBUTION, MODIFICATION,
18 * USAGE AND OTHER RIGHTS AND OBLIGATIONS IS INCLUDED WITH THE DISTRIBUTION OF THIS
19 * PROJECT IN THE FILE LICENSE.HTML. IF THE LICENSE IS NOT INCLUDED YOU MAY FIND A COPY
20 * AT HTTP://WWW.DESY.DE/LEGAL/LICENSE.HTM
21 */
22
23 package de.desy.acop.transport.adapters;
24
25 /**
26 * <code>AdapterFactoryService</code> supplies the implementation of the
27 * <code>AdapterFactory</code>. This class is a singleton object. One should
28 * used the {@link #getInstance()} method to obtain the instance of this object.
29 *
30 * @author <a href="mailto:jaka.bobnar@cosylab.com">Jaka Bobnar</a>
31 * @version $Id: Templates.xml,v 1.10 2004/01/13 16:17:13 jbobnar Exp $
32 *
33 */
34 public class AdapterFactoryService {
35
36 private static AdapterFactoryService instance;
37 private AdapterFactory factory;
38
39 /**
40 * Returns the instance of AdapterFactoryService.
41 *
42 * @return
43 */
44 public static AdapterFactoryService getInstance() {
45 if (instance == null) {
46 instance = new AdapterFactoryService();
47 }
48 return instance;
49 }
50
51 private AdapterFactoryService() {
52
53 }
54
55 /**
56 * Returns an implementaion of the <code>AdapterFactory</code>.
57 *
58 * @return the adapter factory
59 */
60 public AdapterFactory getAdapterFactory() {
61 if (factory == null) {
62 factory = new DefaultAdapterFactory();
63 }
64 return factory;
65 }
66
67 }
68
69
70 /* __oOo__ */