1 22 package org.jboss.ejb3.proxy; 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 (EJBException e) 97 { 98 throw e; 99 } 100 catch (RemoteException e) 101 { 102 e.printStackTrace(); 103 throw new EJBException (e); 104 } 105 } 106 107 110 public Class getHomeInterfaceClass() 111 { 112 return home; 113 } 114 115 118 public Class getRemoteInterfaceClass() 119 { 120 return remote; 121 } 122 123 126 public Class getPrimaryKeyClass() 127 { 128 if (session == true) 129 throw new RuntimeException ("A session bean does not have a primary key class"); 130 131 return pkClass; 132 } 133 134 139 public boolean isSession() 140 { 141 return session; 142 } 143 144 149 public boolean isStatelessSession() 150 { 151 return statelessSession; 152 } 153 } 154 | Popular Tags |