KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > caucho > ejb > hessian > HomeStub


1 /*
2  * Copyright (c) 1998-2006 Caucho Technology -- all rights reserved
3  *
4  * This file is part of Resin(R) Open Source
5  *
6  * Each copy or derived work must preserve the copyright notice and this
7  * notice unmodified.
8  *
9  * Resin Open Source is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * Resin Open Source is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
17  * of NON-INFRINGEMENT. See the GNU General Public License for more
18  * details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with Resin Open Source; if not, write to the
22  * Free SoftwareFoundation, Inc.
23  * 59 Temple Place, Suite 330
24  * Boston, MA 02111-1307 USA
25  *
26  * @author Scott Ferguson
27  */

28
29 package com.caucho.ejb.hessian;
30
31 import javax.ejb.EJBHome JavaDoc;
32 import javax.ejb.EJBMetaData JavaDoc;
33 import javax.ejb.Handle JavaDoc;
34 import javax.ejb.HomeHandle JavaDoc;
35 import javax.ejb.RemoveException JavaDoc;
36 import java.rmi.RemoteException JavaDoc;
37
38 /**
39  * Base class for home stubs.
40  */

41 abstract public class HomeStub extends HessianStub implements EJBHome JavaDoc {
42   private transient EJBMetaData JavaDoc _metaData;
43
44   abstract public String JavaDoc getHessianType();
45   
46   /**
47    * Returns the stub's home handle
48    */

49   public HomeHandle JavaDoc getHomeHandle() throws RemoteException JavaDoc
50   {
51     return _client.getHomeHandle();
52   }
53
54   public EJBMetaData JavaDoc getEJBMetaData() throws RemoteException JavaDoc
55   {
56     if (_metaData == null)
57       _metaData = _ejb_getEJBMetaData();
58     
59     return _metaData;
60   }
61
62   /**
63    * Remove the object specified by the handle from the server.
64    *
65    * @param handle the handle to the object to remove
66    */

67   public void remove(Handle JavaDoc handle) throws RemoteException JavaDoc, RemoveException JavaDoc
68   {
69     _ejb_remove(handle);
70   }
71
72   /**
73    * Remove the object specified by the public key from the server.
74    *
75    * @param publicKey the public key of the object to remove
76    */

77   public void remove(Object JavaDoc publicKey) throws RemoteException JavaDoc, RemoveException JavaDoc
78   {
79     _ejb_remove(publicKey);
80   }
81
82   protected EJBMetaData JavaDoc _ejb_getEJBMetaData() throws RemoteException JavaDoc
83   {
84     throw new UnsupportedOperationException JavaDoc();
85   }
86   
87   protected void _ejb_remove(Handle JavaDoc handle)
88     throws RemoteException JavaDoc, RemoveException JavaDoc
89   {
90     throw new UnsupportedOperationException JavaDoc();
91   }
92   
93   protected void _ejb_remove(Object JavaDoc primaryKey)
94     throws RemoteException JavaDoc, RemoveException JavaDoc
95   {
96     throw new UnsupportedOperationException JavaDoc();
97   }
98 }
99
Popular Tags