1 22 package org.jboss.proxy.ejb; 23 24 import java.io.Serializable ; 25 import java.rmi.RemoteException ; 26 27 import javax.ejb.HomeHandle ; 28 import javax.ejb.EJBMetaData ; 29 import javax.ejb.EJBHome ; 30 import javax.ejb.EJBException ; 31 32 41 public class EJBMetaDataImpl 42 implements EJBMetaData , Serializable 43 { 44 45 private static final long serialVersionUID = -3698855455664391097L; 46 47 private final Class remote; 49 private final Class home; 50 private final Class pkClass; 51 52 private final boolean session; 53 private final boolean statelessSession; 54 private final HomeHandle homeHandle; 55 56 58 62 public EJBMetaDataImpl(final Class remote, 63 final Class home, 64 final Class pkClass, 65 final boolean session, 66 final boolean statelessSession, 67 final HomeHandle homeHandle) 68 { 69 this.remote = remote; 70 this.home = home; 71 this.pkClass = pkClass; 72 this.session = session; 73 this.statelessSession = statelessSession; 74 this.homeHandle = homeHandle; 75 } 76 77 79 81 82 84 89 90 public EJBHome getEJBHome() 91 { 92 try 93 { 94 return homeHandle.getEJBHome(); 95 } 96 catch (RemoteException e) 97 { 98 e.printStackTrace(); 99 throw new EJBException (e); 100 } 101 } 102 103 106 public Class getHomeInterfaceClass() 107 { 108 return home; 109 } 110 111 114 public Class getRemoteInterfaceClass() 115 { 116 return remote; 117 } 118 119 122 public Class getPrimaryKeyClass() 123 { 124 if (session == true) 125 throw new RuntimeException ("A session bean does not have a primary key class"); 126 127 return pkClass; 128 } 129 130 135 public boolean isSession() 136 { 137 return session; 138 } 139 140 145 public boolean isStatelessSession() 146 { 147 return statelessSession; 148 } 149 } 150 | Popular Tags |