KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sape > carbon > core > component > proxy > test > TestComponentImpl


1 /*
2  * The contents of this file are subject to the Sapient Public License
3  * Version 1.0 (the "License"); you may not use this file except in compliance
4  * with the License. You may obtain a copy of the License at
5  * http://carbon.sf.net/License.html.
6  *
7  * Software distributed under the License is distributed on an "AS IS" basis,
8  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
9  * the specific language governing rights and limitations under the License.
10  *
11  * The Original Code is The Carbon Component Framework.
12  *
13  * The Initial Developer of the Original Code is Sapient Corporation
14  *
15  * Copyright (C) 2003 Sapient Corporation. All Rights Reserved.
16  */

17
18 package org.sape.carbon.core.component.proxy.test;
19
20
21
22 /**
23  * A simple Component that provides some simple methods used when testing
24  * Component Proxy functionality.
25  *
26  * Copyright 2002 Sapient
27  * @since carbon 1.0
28  * @author Chris Herron, Febuary 2002
29  * @version $Revision: 1.6 $($Author: ghinkl $ / $Date: 2003/10/10 14:55:33 $)
30  */

31 public class TestComponentImpl implements TestComponent {
32
33     /**
34      * Creates a new instance of TestComponent
35      */

36     public TestComponentImpl() {
37     }
38
39     private int x = 0;
40     public void doNothing() {
41         x++;
42     }
43
44     /**
45      * Checks-in with the caller to confirm it was called.
46      * @param callBackId A token to confirm the call
47      */

48     public void doSomeWork(String JavaDoc callBackId){
49         ExternalComponentProxyTest.calleeConfirm(callBackId);
50     }
51
52     /**
53      * Throws an Exception.
54      */

55     public void intentionalException() throws Exception JavaDoc {
56         throw new Exception JavaDoc("This is an intentional Exception");
57     }
58
59     /**
60      * Returns a TestReturnType Object
61      * @return Instance od TestReturnType
62      */

63     public TestReturnType returnTestReturnType() {
64         return new TestReturnType();
65     }
66
67     /**
68      * Sleeps for a second before returning.
69      */

70     public boolean reentrantMethod() {
71         try{
72             Thread.sleep(1000);
73         }
74         catch(InterruptedException JavaDoc IE) {
75             //swallow it
76
}
77         finally{
78             return true;
79         }
80     }
81
82 }
83
Popular Tags