1 4 5 package com.sun.j2ee.blueprints.objectposervice; 6 7 import java.rmi.*; 8 import javax.ejb.*; 9 10 14 15 public class SchemaDefinedPurchaseOrderServiceBean implements SessionBean { 16 17 private SessionContext sc; 18 public SchemaDefinedPurchaseOrderServiceBean(){} 19 20 public String submitPO(PurchaseOrder po) throws InvalidPOException, RemoteException { 21 if(po.getPoId().equals("100")) 23 throw new InvalidPOException("Invalid ID for the purchase order!!! " + 24 "For demo purposes, we throw " + 25 "an application defined exception for the ID value of 100."); 26 27 return po.getPoId(); 29 } 30 31 public void ejbCreate() throws CreateException {} 33 34 public void setSessionContext(SessionContext sc) { 35 this.sc = sc; 36 } 37 38 public void ejbRemove(){} 39 40 public void ejbActivate() {} 41 42 public void ejbPassivate() {} 43 } 44 45 | Popular Tags |