01: // Copyright 2004, 2005 The Apache Software Foundation
02: //
03: // Licensed under the Apache License, Version 2.0 (the "License");
04: // you may not use this file except in compliance with the License.
05: // You may obtain a copy of the License at
06: //
07: // http://www.apache.org/licenses/LICENSE-2.0
08: //
09: // 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;
21:
22: import javax.ejb.EJBMetaData;
23: import javax.ejb.Handle;
24: import javax.ejb.HomeHandle;
25: import javax.ejb.RemoveException;
26:
27: /**
28: * Implementation of fake EJB Home interface.
29: *
30: * @author Howard Lewis Ship
31: */
32: public class SimpleHomeImpl implements SimpleHome {
33: private boolean _forceError;
34:
35: private SimpleRemote _object = new SimpleEJB();
36:
37: public SimpleRemote create() throws RemoteException {
38: if (_forceError)
39: throw new RemoteException("Forced error.");
40:
41: return _object;
42: }
43:
44: public EJBMetaData getEJBMetaData() throws RemoteException {
45: return null;
46: }
47:
48: public HomeHandle getHomeHandle() throws RemoteException {
49: return null;
50: }
51:
52: public void remove(Object arg0) throws RemoteException,
53: RemoveException {
54:
55: }
56:
57: public void remove(Handle arg0) throws RemoteException,
58: RemoveException {
59:
60: }
61:
62: public boolean isForceError() {
63: return _forceError;
64: }
65:
66: public void setForceError(boolean b) {
67: _forceError = b;
68: }
69:
70: }
|