KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > mc > formgenerator > servlets > bonita > ModeleInstances


1 /*
2  * Created on 12 mai 2004
3  *
4  * To change the template for this generated file go to
5  * Window>Preferences>Java>Code Generation>Code and Comments
6  */

7 package mc.formgenerator.servlets.bonita;
8
9 import hero.util.HeroException;
10 import hero.interfaces.UserSession;
11 import hero.interfaces.UserSessionHome;
12 import hero.interfaces.UserSessionUtil;
13
14 import java.rmi.RemoteException JavaDoc;
15 import java.util.Collection JavaDoc;
16
17 import javax.ejb.CreateException JavaDoc;
18 import javax.naming.NamingException JavaDoc;
19
20 /**
21  * @author delfourr
22  */

23 public class ModeleInstances {
24
25
26
27     /**
28      * Attribute which stocks the project names
29      */

30     private Collection JavaDoc instanceProjectList;
31
32
33
34
35     /**
36      * Default class constructor
37      */

38     public ModeleInstances() {
39     }
40
41
42
43
44
45     /**
46      * The main method which finds and initialises the model projects list.
47      * @throws LoginException
48      * @throws RemoteException
49      * @throws NamingException
50      * @throws CreateException
51      * @throws HeroException
52      */

53     public void process() throws RemoteException JavaDoc, NamingException JavaDoc, CreateException JavaDoc, HeroException {
54         
55         Collection JavaDoc list = this.getAllInstancesProjects();
56         
57         this.setInstanceProjectList(list);
58     }
59
60
61
62
63
64
65     /**
66      * Returns the projects instances list of the current user.
67      * @return Collection List of the projects instances of the user.
68      * @throws NamingException
69      * @throws CreateException
70      * @throws RemoteException
71      * @throws HeroException
72      */

73     private Collection JavaDoc getAllInstancesProjects() throws NamingException JavaDoc, CreateException JavaDoc, RemoteException JavaDoc, HeroException {
74         
75         UserSessionHome userh = UserSessionUtil.getHome();
76         
77         UserSession userSession = userh.create();
78         
79         Collection JavaDoc list = userSession.getInstancesListNames();
80         
81         return list;
82     }
83
84
85
86
87     /**
88      * Set the value of the attribute instanceProjectList with the value 'col'.
89      * @param col Collection List of all instance projects.
90      */

91     public void setInstanceProjectList(Collection JavaDoc col) {
92         
93         this.instanceProjectList = col;
94     }
95
96
97
98
99     /**
100      * Get the value of the attribute instanceProjectList.
101      * @return Collection List of all instance projects.
102      */

103     public Collection JavaDoc getInstanceProjectList() {
104         
105         return this.instanceProjectList;
106     }
107
108 }
109
Popular Tags