1 19 package mark.comps; 20 21 import mark.AddData; 22 23 import javax.ejb.SessionContext; 24 import javax.ejb.EJBException; 25 import java.rmi.RemoteException; 26 27 public class Add2Impl 28 implements javax.ejb.SessionBean 29 { 30 public int add( int a, int b ) 31 { 32 return a + b; 33 } 34 35 public AddData addData( AddData a, AddData b ) 36 { 37 return new AddData( a.getA() + b.getA() ); 38 } 39 40 public AddData addDatas( AddData a[] ) 41 { 42 int r = 0; 43 for( int i=0; i<a.length; i++ ) 44 { 45 r = r + a[i].getA(); 46 } 47 return new AddData( r ); 48 } 49 50 public void setSessionContext(SessionContext sessionContext) throws EJBException, RemoteException 51 { 52 } 54 55 public void ejbRemove() throws EJBException, RemoteException 56 { 57 } 59 60 public void ejbActivate() throws EJBException, RemoteException 61 { 62 } 64 65 public void ejbPassivate() throws EJBException, RemoteException 66 { 67 } 69 } 70 | Popular Tags |