KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > rift > coad > lib > bean > test > MainInterface1Impl


1 /*
2  * CoadunationLib: The coaduntion implementation library.
3  * Copyright (C) 2006 Rift IT Contracting
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
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     /**
42      * The void method
43      */

44     public void callVoid() {
45         System.out.println("Calling void");
46     }
47     
48     
49     /**
50      * This method throws and exceptions
51      */

52     public void throwException() throws TestProxyException {
53         throw new TestProxyException("Failed to get result.");
54     }
55     
56     /**
57      * Return an int value
58      */

59     public String JavaDoc getString() {
60         return "Test1";
61     }
62     
63     
64     /**
65      * Return an int value
66      */

67     public int getInt(){
68         return 1;
69     }
70     
71     
72     /**
73      * This method returns a key value.
74      */

75     public TestKey getAKeyValue(){
76         return new TestKey("1","key1");
77     }
78     
79     
80     /**
81      * This method addes a sub interface
82      */

83     public SubInterface1 addSubInterface(String JavaDoc key){
84         return new SubInterface1Impl(key);
85     }
86     
87     
88     /**
89      * This method retrieves a sub interface
90      */

91     public SubInterface1 getSubInterface(String JavaDoc key) throws Exception JavaDoc {
92         calledBean++;
93         return new SubInterface1Impl(key);
94     }
95     
96     /**
97      * This method removes a sub interface
98      */

99     public void removeSubInterface(String JavaDoc key){
100         
101     }
102 }
103
Popular Tags