KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > mark > comps > Add2Impl


1 /*
2  * Copyright 2004 The Apache Software Foundation or its licensors, as
3  * applicable.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
14  * implied.
15  *
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */

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         //To change body of implemented methods use File | Settings | File Templates.
53
}
54
55     public void ejbRemove() throws EJBException, RemoteException
56     {
57         //To change body of implemented methods use File | Settings | File Templates.
58
}
59
60     public void ejbActivate() throws EJBException, RemoteException
61     {
62         //To change body of implemented methods use File | Settings | File Templates.
63
}
64
65     public void ejbPassivate() throws EJBException, RemoteException
66     {
67         //To change body of implemented methods use File | Settings | File Templates.
68
}
69 }
70
Popular Tags