1 45 package org.openejb.test.entity.bmp; 46 47 import java.rmi.RemoteException ; 48 49 import javax.ejb.EJBException ; 50 import javax.ejb.EJBHome ; 51 import javax.ejb.EJBMetaData ; 52 import javax.ejb.EJBObject ; 53 import javax.ejb.EntityContext ; 54 import javax.ejb.Handle ; 55 import javax.ejb.RemoveException ; 56 import javax.naming.InitialContext ; 57 58 import org.openejb.test.object.ObjectGraph; 59 60 65 public class RmiIiopBmpBean implements javax.ejb.EntityBean { 66 private int primaryKey; 67 private String firstName; 68 private String lastName; 69 private EntityContext ejbContext; 70 71 72 76 84 public java.util.Collection ejbFindEmptyCollection() 85 throws javax.ejb.FinderException , java.rmi.RemoteException { 86 return new java.util.Vector (); 87 } 88 89 97 public Integer ejbFindByPrimaryKey(Integer primaryKey) 98 throws javax.ejb.FinderException { 99 return new Integer (-1); 100 } 101 102 110 public Integer ejbCreate(String name) 111 throws javax.ejb.CreateException { 112 return new Integer (-1); 113 } 114 115 public void ejbPostCreate(String name) 116 throws javax.ejb.CreateException { 117 } 118 119 120 124 125 129 130 131 132 public String returnStringObject(String data) { 133 return data; 134 } 135 136 public String [] returnStringObjectArray(String [] data) { 137 return data; 138 } 139 140 141 142 143 144 public Character returnCharacterObject(Character data) { 145 return data; 146 } 147 148 public char returnCharacterPrimitive(char data) { 149 return data; 150 } 151 152 public Character [] returnCharacterObjectArray(Character [] data) { 153 return data; 154 } 155 156 public char[] returnCharacterPrimitiveArray(char[] data) { 157 return data; 158 } 159 160 161 162 163 164 public Boolean returnBooleanObject(Boolean data) { 165 return data; 166 } 167 168 public boolean returnBooleanPrimitive(boolean data) { 169 return data; 170 } 171 172 public Boolean [] returnBooleanObjectArray(Boolean [] data) { 173 return data; 174 } 175 176 public boolean[] returnBooleanPrimitiveArray(boolean[] data) { 177 return data; 178 } 179 180 181 182 183 184 public Byte returnByteObject(Byte data) { 185 return data; 186 } 187 188 public byte returnBytePrimitive(byte data) { 189 return data; 190 } 191 192 public Byte [] returnByteObjectArray(Byte [] data) { 193 return data; 194 } 195 196 public byte[] returnBytePrimitiveArray(byte[] data) { 197 return data; 198 } 199 200 201 202 203 204 public Short returnShortObject(Short data) { 205 return data; 206 } 207 208 public short returnShortPrimitive(short data) { 209 return data; 210 } 211 212 public Short [] returnShortObjectArray(Short [] data) { 213 return data; 214 } 215 216 public short[] returnShortPrimitiveArray(short[] data) { 217 return data; 218 } 219 220 221 222 223 224 public Integer returnIntegerObject(Integer data) { 225 return data; 226 } 227 228 public int returnIntegerPrimitive(int data) { 229 return data; 230 } 231 232 public Integer [] returnIntegerObjectArray(Integer [] data) { 233 return data; 234 } 235 236 public int[] returnIntegerPrimitiveArray(int[] data) { 237 return data; 238 } 239 240 241 242 243 244 public Long returnLongObject(Long data) { 245 return data; 246 } 247 248 public long returnLongPrimitive(long data) { 249 return data; 250 } 251 252 public Long [] returnLongObjectArray(Long [] data) { 253 return data; 254 } 255 256 public long[] returnLongPrimitiveArray(long[] data) { 257 return data; 258 } 259 260 261 262 263 264 public Float returnFloatObject(Float data) { 265 return data; 266 } 267 268 public float returnFloatPrimitive(float data) { 269 return data; 270 } 271 272 public Float [] returnFloatObjectArray(Float [] data) { 273 return data; 274 } 275 276 public float[] returnFloatPrimitiveArray(float[] data) { 277 return data; 278 } 279 280 281 282 283 284 public Double returnDoubleObject(Double data) { 285 return data; 286 } 287 288 public double returnDoublePrimitive(double data) { 289 return data; 290 } 291 292 public Double [] returnDoubleObjectArray(Double [] data) { 293 return data; 294 } 295 296 public double[] returnDoublePrimitiveArray(double[] data) { 297 return data; 298 } 299 300 301 302 303 304 305 public EJBHome returnEJBHome(EJBHome data) { 306 return data; 307 } 308 309 public EJBHome returnEJBHome() throws javax.ejb.EJBException { 310 EJBHome data = null; 311 312 try{ 313 InitialContext ctx = new InitialContext (); 314 315 data = (EJBHome )ctx.lookup("java:comp/env/bmp/rmi-iiop/home"); 316 317 } catch (Exception e){ 318 e.printStackTrace(); 319 throw new javax.ejb.EJBException (e); 320 } 321 return data; 322 } 323 324 public ObjectGraph returnNestedEJBHome() throws javax.ejb.EJBException { 325 ObjectGraph data = null; 326 327 try{ 328 InitialContext ctx = new InitialContext (); 329 330 Object object = ctx.lookup("java:comp/env/bmp/rmi-iiop/home"); 331 data = new ObjectGraph(object); 332 333 } catch (Exception e){ 334 throw new javax.ejb.EJBException (e); 335 } 336 return data; 337 } 338 339 public EJBHome [] returnEJBHomeArray(EJBHome [] data) { 340 return data; 341 } 342 343 344 345 346 347 public EJBObject returnEJBObject(EJBObject data) { 348 return data; 349 } 350 351 public EJBObject returnEJBObject() throws javax.ejb.EJBException { 352 EncBmpObject data = null; 353 354 try{ 355 InitialContext ctx = new InitialContext (); 356 357 EncBmpHome home = (EncBmpHome)ctx.lookup("java:comp/env/bmp/rmi-iiop/home"); 358 data = home.create("Test01 BmpBean"); 359 360 } catch (Exception e){ 361 throw new javax.ejb.EJBException (e); 362 } 363 return data; 364 } 365 366 public ObjectGraph returnNestedEJBObject() throws javax.ejb.EJBException { 367 ObjectGraph data = null; 368 369 try{ 370 InitialContext ctx = new InitialContext (); 371 372 EncBmpHome home = (EncBmpHome)ctx.lookup("java:comp/env/bmp/rmi-iiop/home"); 373 EncBmpObject object = home.create("Test02 BmpBean"); 374 data = new ObjectGraph(object); 375 376 } catch (Exception e){ 377 throw new javax.ejb.EJBException (e); 378 } 379 return data; 380 } 381 382 public EJBObject [] returnEJBObjectArray(EJBObject [] data) { 383 return data; 384 } 385 386 387 388 389 390 public EJBMetaData returnEJBMetaData(EJBMetaData data) { 391 return data; 392 } 393 394 public EJBMetaData returnEJBMetaData() throws javax.ejb.EJBException { 395 EJBMetaData data = null; 396 397 try{ 398 InitialContext ctx = new InitialContext (); 399 400 EncBmpHome home = (EncBmpHome)ctx.lookup("java:comp/env/bmp/rmi-iiop/home"); 401 data = home.getEJBMetaData(); 402 403 } catch (Exception e){ 404 throw new javax.ejb.EJBException (e); 405 } 406 return data; 407 } 408 409 public ObjectGraph returnNestedEJBMetaData() throws javax.ejb.EJBException { 410 ObjectGraph data = null; 411 412 try{ 413 InitialContext ctx = new InitialContext (); 414 415 EncBmpHome home = (EncBmpHome)ctx.lookup("java:comp/env/bmp/rmi-iiop/home"); 416 EJBMetaData object = home.getEJBMetaData(); 417 data = new ObjectGraph(object); 418 419 } catch (Exception e){ 420 throw new javax.ejb.EJBException (e); 421 } 422 return data; 423 } 424 425 public EJBMetaData [] returnEJBMetaDataArray(EJBMetaData [] data) { 426 return data; 427 } 428 429 430 431 432 433 public Handle returnHandle(Handle data) { 434 return data; 435 } 436 437 public Handle returnHandle() throws javax.ejb.EJBException { 438 Handle data = null; 439 440 try{ 441 InitialContext ctx = new InitialContext (); 442 443 EncBmpHome home = (EncBmpHome)ctx.lookup("java:comp/env/bmp/rmi-iiop/home"); 444 EncBmpObject object = home.create("Test03 BmpBean"); 445 data = object.getHandle(); 446 447 } catch (Exception e){ 448 throw new javax.ejb.EJBException (e); 449 } 450 return data; 451 } 452 453 public ObjectGraph returnNestedHandle() throws javax.ejb.EJBException { 454 ObjectGraph data = null; 455 456 try{ 457 InitialContext ctx = new InitialContext (); 458 459 EncBmpHome home = (EncBmpHome)ctx.lookup("java:comp/env/bmp/rmi-iiop/home"); 460 EncBmpObject object = home.create("Test04 BmpBean"); 461 data = new ObjectGraph(object.getHandle()); 462 463 } catch (Exception e){ 464 throw new javax.ejb.EJBException (e); 465 } 466 return data; 467 } 468 469 public Handle [] returnHandleArray(Handle [] data) { 470 return data; 471 } 472 473 474 475 476 477 public ObjectGraph returnObjectGraph(ObjectGraph data) { 478 return data; 479 } 480 481 public ObjectGraph[] returnObjectGraphArray(ObjectGraph[] data) { 482 return data; 483 } 484 488 489 493 498 public void ejbLoad() throws EJBException ,RemoteException { 499 } 500 501 505 public void setEntityContext(EntityContext ctx) throws EJBException ,RemoteException { 506 ejbContext = ctx; 507 } 508 509 513 public void unsetEntityContext() throws EJBException ,RemoteException { 514 } 515 516 521 public void ejbStore() throws EJBException ,RemoteException { 522 } 523 524 532 public void ejbRemove() throws RemoveException ,EJBException ,RemoteException { 533 } 534 535 541 public void ejbActivate() throws EJBException ,RemoteException { 542 } 543 544 550 public void ejbPassivate() throws EJBException ,RemoteException { 551 } 552 553 } 557 | Popular Tags |