KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > apollo > dev > DevServiceResolver


1 /*
2 ** Apollo - Test Skeleton Toolkit for Web Start/JNLP
3 ** Copyright (c) 2001, 2002, 2003 by Gerald Bauer
4 **
5 ** This program is free software.
6 **
7 ** You may redistribute it and/or modify it under the terms of the GNU
8 ** General Public License as published by the Free Software Foundation.
9 ** Version 2 of the license should be included with this distribution in
10 ** the file LICENSE, as well as License.html. If the license is not
11 ** included with this distribution, you may find a copy at the FSF web
12 ** site at 'www.gnu.org' or 'www.fsf.org', or you may write to the
13 ** Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139 USA.
14 **
15 ** THIS SOFTWARE IS PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND,
16 ** NOT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY. THE AUTHOR
17 ** OF THIS SOFTWARE, ASSUMES _NO_ RESPONSIBILITY FOR ANY
18 ** CONSEQUENCE RESULTING FROM THE USE, MODIFICATION, OR
19 ** REDISTRIBUTION OF THIS SOFTWARE.
20 **
21 */

22
23 package apollo.dev;
24
25 import apollo.*;
26 import apollo.spi.*;
27
28 public class DevServiceResolver implements ServiceResolver
29 {
30    BasicService _basic;
31    ClipboardService _clipboard;
32    FileOpenService _fileOpen;
33    FileSaveService _fileSave;
34    PersistenceService _persistence;
35    PrintService _print;
36
37
38    public BasicService lookupBasicService()
39    {
40       if( _basic == null )
41          _basic = new DevBasicService();
42
43       return _basic;
44    }
45
46    public ClipboardService lookupClipboardService()
47    {
48       if( _clipboard == null )
49          _clipboard = new DevClipboardService();
50
51       return _clipboard;
52    }
53
54    public FileOpenService lookupFileOpenService()
55    {
56       if( _fileOpen == null )
57          _fileOpen = new DevFileOpenService();
58
59       return _fileOpen;
60    }
61
62    public FileSaveService lookupFileSaveService()
63    {
64       if( _fileSave == null )
65          _fileSave = new DevFileSaveService();
66
67       return _fileSave;
68    }
69
70    public PersistenceService lookupPersistenceService()
71    {
72       if( _persistence == null )
73          _persistence = new DevPersistenceService();
74
75       return _persistence;
76    }
77
78    public PrintService lookupPrintService()
79    {
80       if( _print == null )
81          _print = new DevPrintService();
82
83       return _print;
84    }
85 }
86
Popular Tags