KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > hivemind > test > lib > impl > SimpleHomeImpl


1 // Copyright 2004, 2005 The Apache Software Foundation
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14

15 package hivemind.test.lib.impl;
16
17 import hivemind.test.lib.SimpleHome;
18 import hivemind.test.lib.SimpleRemote;
19
20 import java.rmi.RemoteException JavaDoc;
21
22 import javax.ejb.EJBMetaData JavaDoc;
23 import javax.ejb.Handle JavaDoc;
24 import javax.ejb.HomeHandle JavaDoc;
25 import javax.ejb.RemoveException JavaDoc;
26
27 /**
28  * Implementation of fake EJB Home interface.
29  *
30  * @author Howard Lewis Ship
31  */

32 public class SimpleHomeImpl implements SimpleHome
33 {
34     private boolean _forceError;
35
36     private SimpleRemote _object = new SimpleEJB();
37
38     public SimpleRemote create() throws RemoteException JavaDoc
39     {
40         if (_forceError)
41             throw new RemoteException JavaDoc("Forced error.");
42
43         return _object;
44     }
45
46     public EJBMetaData JavaDoc getEJBMetaData() throws RemoteException JavaDoc
47     {
48         return null;
49     }
50
51     public HomeHandle JavaDoc getHomeHandle() throws RemoteException JavaDoc
52     {
53         return null;
54     }
55
56     public void remove(Object JavaDoc arg0) throws RemoteException JavaDoc, RemoveException JavaDoc
57     {
58
59     }
60
61     public void remove(Handle JavaDoc arg0) throws RemoteException JavaDoc, RemoveException JavaDoc
62     {
63
64     }
65
66     public boolean isForceError()
67     {
68         return _forceError;
69     }
70
71     public void setForceError(boolean b)
72     {
73         _forceError = b;
74     }
75
76 }
77
Popular Tags