KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > league > ws > LeagueWebServiceBean


1 package league.ws;
2
3 import java.rmi.RemoteException JavaDoc;
4 import java.util.Collection JavaDoc;
5 import java.util.Date JavaDoc;
6 import java.util.Hashtable JavaDoc;
7 import league.ejb.entity.PlayerLocal;
8 import league.ejb.entity.RoundLocal;
9 import league.util.League;
10 import league.util.Match;
11 import league.util.Player;
12 import league.util.Round;
13
14
15
16 /**
17  * This is the bean class for the LeagueWebService enterprise bean.
18  * Created Jun 4, 2005 12:37:36 AM
19  * @author jungi
20  */

21 public class LeagueWebServiceBean implements javax.ejb.SessionBean JavaDoc {
22     private javax.ejb.SessionContext JavaDoc context;
23     
24     // <editor-fold defaultstate="collapsed" desc="EJB infrastructure methods. Click the + sign on the left to edit the code.">
25
// TODO Add code to acquire and use other enterprise resources (DataSource, JMS, enterprise bean, Web services)
26
// TODO Add business methods or web service operations
27
/**
28      * @see javax.ejb.SessionBean#setSessionContext(javax.ejb.SessionContext)
29      */

30     public void setSessionContext(javax.ejb.SessionContext JavaDoc aContext) {
31         context = aContext;
32     }
33     
34     /**
35      * @see javax.ejb.SessionBean#ejbActivate()
36      */

37     public void ejbActivate() {
38         
39     }
40     
41     /**
42      * @see javax.ejb.SessionBean#ejbPassivate()
43      */

44     public void ejbPassivate() {
45         
46     }
47     
48     /**
49      * @see javax.ejb.SessionBean#ejbRemove()
50      */

51     public void ejbRemove() {
52         
53     }
54     // </editor-fold>
55

56     /**
57      * See section 7.10.3 of the EJB 2.0 specification
58      * See section 7.11.3 of the EJB 2.1 specification
59      */

60     public void ejbCreate() {
61         // TODO implement ejbCreate if necessary, acquire resources
62
// This method has access to the JNDI context so resource aquisition
63
// spanning all methods can be performed here such as home interfaces
64
// and data sources.
65
}
66     
67     
68     
69     // Add business logic below. (Right-click in editor and choose
70
// "EJB Methods > Add Business Method" or "Web Service > Add Operation")
71

72     private league.ejb.session.LeagueFacadeRemote lookupLeagueFacadeBean() {
73         try {
74             return ((league.ejb.session.LeagueFacadeRemoteHome) league.ejb.CachingServiceLocator.getInstance().getRemoteHome("java:comp/env/ejb/LeagueFacadeBean",league.ejb.session.LeagueFacadeRemoteHome.class)).create();
75         } catch(javax.naming.NamingException JavaDoc ne) {
76             java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE,"exception caught" ,ne);
77             throw new RuntimeException JavaDoc(ne);
78         } catch(javax.ejb.CreateException JavaDoc ce) {
79             java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE,"exception caught" ,ce);
80             throw new RuntimeException JavaDoc(ce);
81         } catch(java.rmi.RemoteException JavaDoc re) {
82             java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE,"exception caught" ,re);
83             throw new RuntimeException JavaDoc(re);
84         }
85     }
86
87     /**
88      * Web service operation
89      */

90     public void addTeamToLastPlace(Integer JavaDoc roundId, Integer JavaDoc teamId) {
91         // TODO implement operation
92
try {
93             lookupLeagueFacadeBean().addTeamToLastPlace(roundId, teamId);
94         } catch (RemoteException JavaDoc re) {
95             
96         }
97     }
98
99     /**
100      * Web service operation
101      */

102     public String JavaDoc testGroups() {
103         // TODO implement operation
104
try {
105             return lookupLeagueFacadeBean().testGroups();
106         } catch (RemoteException JavaDoc re) {
107         }
108         return null;
109     }
110
111     /**
112      * Web service operation
113      */

114     public void updateMatch(Match m) {
115         // TODO implement operation
116
try {
117             lookupLeagueFacadeBean().updateMatch(m);
118         } catch (RemoteException JavaDoc re) {
119         }
120     }
121
122     /**
123      * Web service operation
124      */

125     public Integer JavaDoc createMatch(Integer JavaDoc roundId, Hashtable JavaDoc results) {
126         try {
127             return lookupLeagueFacadeBean().createMatch(roundId, results);
128         } catch (RemoteException JavaDoc re) {
129         }
130         return null;
131     }
132
133     /**
134      * Web service operation
135      */

136     public Round getActiveRound(Integer JavaDoc leagueId) {
137         try {
138             return lookupLeagueFacadeBean().getActiveRound(leagueId);
139         } catch (RemoteException JavaDoc re) {
140         }
141         return null;
142     }
143
144     /**
145      * Web service operation
146      */

147     public League createLeague(java.lang.String JavaDoc name, Date JavaDoc startDate, Date JavaDoc endDate, java.lang.String JavaDoc note) {
148         try {
149             return lookupLeagueFacadeBean().createLeague(name, startDate, endDate, note);
150         } catch (RemoteException JavaDoc re) {
151         }
152         return null;
153     }
154
155     /**
156      * Web service operation
157      */

158     public void createRound(Integer JavaDoc leagueId, java.lang.String JavaDoc name, Date JavaDoc startDate) {
159         try {
160             lookupLeagueFacadeBean().createRound(leagueId, name, startDate);
161         } catch (RemoteException JavaDoc re) {
162         }
163     }
164
165     /**
166      * Web service operation
167      */

168     public Collection JavaDoc getPlayersInRound(RoundLocal rl) {
169         try {
170             return lookupLeagueFacadeBean().getPlayersInRound(rl);
171         } catch (RemoteException JavaDoc re) {
172         }
173         return null;
174     }
175
176     /**
177      * Web service operation
178      */

179     public void setTeamStartPoints(Integer JavaDoc teamId, Integer JavaDoc groupId, Integer JavaDoc startPoints) {
180         try {
181             lookupLeagueFacadeBean().setTeamStartPoints(teamId, groupId, startPoints);
182         } catch (RemoteException JavaDoc re) {
183         }
184     }
185
186     /**
187      * Web service operation
188      */

189     public Integer JavaDoc createPlayer(java.lang.String JavaDoc name, java.lang.String JavaDoc note, java.lang.String JavaDoc userId) {
190         try {
191             return lookupLeagueFacadeBean().createPlayer(name, note, userId);
192         } catch (RemoteException JavaDoc re) {
193         }
194         return null;
195     }
196
197     /**
198      * Web service operation
199      */

200     public Player getPlayer(PlayerLocal player) {
201         return null;
202     }
203     
204     
205 }
206
Popular Tags