KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > mark > comps > AddImpl


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 AddImpl
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
51     public void mVOID()
52     {
53     }
54
55     public int mINT()
56     {
57         return (int)0;
58     }
59
60     public double mDOUBLE()
61     {
62         return (double)0.0;
63     }
64
65     public float mFLOAT()
66     {
67         return (float)0.0;
68     }
69
70     public long mLONG()
71     {
72         return (long)0;
73     }
74
75     public char mCHAR()
76     {
77         return (char)0;
78     }
79
80     public boolean mBOOLEAN()
81     {
82         return true;
83     }
84
85     public byte mBYTE()
86     {
87         return (byte)0;
88     }
89
90     public String mSTRING()
91     {
92         return "Hello";
93     }
94
95     public void mEXCEPTION() throws Exception
96     {
97
98     }
99
100     public void mNONE()
101     {
102
103     }
104
105     public void mONE( int a )
106     {
107
108     }
109
110     public void mTWO( int a, int b )
111     {
112
113     }
114
115     public void setSessionContext(SessionContext sessionContext) throws EJBException, RemoteException
116     {
117         //To change body of implemented methods use File | Settings | File Templates.
118
}
119
120     public void ejbRemove() throws EJBException, RemoteException
121     {
122         //To change body of implemented methods use File | Settings | File Templates.
123
}
124
125     public void ejbActivate() throws EJBException, RemoteException
126     {
127         //To change body of implemented methods use File | Settings | File Templates.
128
}
129
130     public void ejbPassivate() throws EJBException, RemoteException
131     {
132         //To change body of implemented methods use File | Settings | File Templates.
133
}
134 }
135
Popular Tags