01: /*
02: * CoadunationLib: The coaduntion implementation library.
03: * Copyright (C) 2006 Rift IT Contracting
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation; either
08: * version 2.1 of the License, or (at your option) any later version.
09: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this library; if not, write to the Free Software
17: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18: *
19: * MainInterface1Impl.java
20: *
21: * The main interface implementation for a test object.
22: */
23:
24: package com.rift.coad.lib.bean.test;
25:
26: /**
27: * The main interface implementation for a test object.
28: *
29: * @author Brett Chaldecott
30: */
31: public class MainInterface1Impl implements MainInterface1 {
32:
33: // static variables
34: public static int calledBean = 0;
35:
36: /** Creates a new instance of MainInterface1Impl */
37: public MainInterface1Impl() {
38: }
39:
40: /**
41: * The void method
42: */
43: public void callVoid() {
44: System.out.println("Calling void");
45: }
46:
47: /**
48: * This method throws and exceptions
49: */
50: public void throwException() throws TestProxyException {
51: throw new TestProxyException("Failed to get result.");
52: }
53:
54: /**
55: * Return an int value
56: */
57: public String getString() {
58: return "Test1";
59: }
60:
61: /**
62: * Return an int value
63: */
64: public int getInt() {
65: return 1;
66: }
67:
68: /**
69: * This method returns a key value.
70: */
71: public TestKey getAKeyValue() {
72: return new TestKey("1", "key1");
73: }
74:
75: /**
76: * This method addes a sub interface
77: */
78: public SubInterface1 addSubInterface(String key) {
79: return new SubInterface1Impl(key);
80: }
81:
82: /**
83: * This method retrieves a sub interface
84: */
85: public SubInterface1 getSubInterface(String key) throws Exception {
86: calledBean++;
87: return new SubInterface1Impl(key);
88: }
89:
90: /**
91: * This method removes a sub interface
92: */
93: public void removeSubInterface(String key) {
94:
95: }
96: }
|