KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > caucho > ejb > burlap > 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.burlap;
30
31 import com.caucho.ejb.EJBMetaDataImpl;
32
33 import javax.ejb.EJBHome JavaDoc;
34 import javax.ejb.EJBMetaData JavaDoc;
35 import javax.ejb.Handle JavaDoc;
36 import javax.ejb.HomeHandle JavaDoc;
37 import javax.ejb.RemoveException JavaDoc;
38 import java.rmi.RemoteException JavaDoc;
39
40 /**
41  * Base class for home stubs.
42  */

43 abstract public class HomeStub extends BurlapStub implements EJBHome JavaDoc {
44   private transient EJBMetaData JavaDoc metaData;
45
46   /*
47   public String getBurlapURL()
48   {
49     return _url;
50   }
51   */

52   public String JavaDoc getHessianURL()
53   {
54     return _url;
55   }
56
57   /*
58   abstract public String getBurlapType();
59   */

60   abstract public String JavaDoc getHessianType();
61   
62   /**
63    * Returns the stub's home handle
64    */

65   public HomeHandle JavaDoc getHomeHandle() throws RemoteException JavaDoc
66   {
67     return _client.getHomeHandle();
68   }
69
70   public EJBMetaData JavaDoc getEJBMetaData() throws RemoteException JavaDoc
71   {
72     if (this.metaData == null) {
73       EJBMetaDataImpl metaData = (EJBMetaDataImpl) _ejb_getEJBMetaData();
74       metaData.setEJBHome(this);
75       
76       this.metaData = metaData;
77     }
78     
79     return this.metaData;
80   }
81
82   /**
83    * Remove the object specified by the handle from the server.
84    *
85    * @param handle the handle to the object to remove
86    */

87   public void remove(Handle JavaDoc handle) throws RemoteException JavaDoc, RemoveException JavaDoc
88   {
89     _ejb_remove(handle);
90   }
91
92   /**
93    * Remove the object specified by the public key from the server.
94    *
95    * @param publicKey the public key of the object to remove
96    */

97   public void remove(Object JavaDoc publicKey) throws RemoteException JavaDoc, RemoveException JavaDoc
98   {
99     _ejb_remove(publicKey);
100   }
101
102   protected EJBMetaData JavaDoc _ejb_getEJBMetaData() throws RemoteException JavaDoc
103   {
104     throw new UnsupportedOperationException JavaDoc();
105   }
106   
107   protected void _ejb_remove(Handle JavaDoc handle)
108     throws RemoteException JavaDoc, RemoveException JavaDoc
109   {
110     throw new UnsupportedOperationException JavaDoc();
111   }
112   
113   protected void _ejb_remove(Object JavaDoc primaryKey)
114     throws RemoteException JavaDoc, RemoveException JavaDoc
115   {
116     throw new UnsupportedOperationException JavaDoc();
117   }
118 }
119
Popular Tags