comparison gnv/src/main/java/de/intevation/gnv/action/sessionmodel/SessionModelFactory.java @ 954:a88fc6320cf8

Add more Javadocs gnv/trunk@1098 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Tue, 18 May 2010 09:11:31 +0000
parents 2659a5b1fa1e
children 28a0628b11b0
comparison
equal deleted inserted replaced
953:4b64b4d1f0cf 954:a88fc6320cf8
10 * 10 *
11 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> 11 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a>
12 */ 12 */
13 public class SessionModelFactory { 13 public class SessionModelFactory {
14 14
15 public final static String SESSION_MODEL_ID = "de.intevation.gnv.action.sessionmodel.SessionModel.ID"; 15 /**
16 * The id of the <code>SessionModel</code> that must be used to lookup the
17 * model from the given <code>HttpSession<Code> of the request.
18 */
19 public final static String SESSION_MODEL_ID = "de.intevation.gnv.action." +
20 "sessionmodel.SessionModel.ID";
21
16 /** 22 /**
17 * the logger, used to log exceptions and additonaly information 23 * the logger, used to log exceptions and additonaly information
18 */ 24 */
19 private static Logger log = Logger.getLogger(SessionModelFactory.class); 25 private static Logger log = Logger.getLogger(SessionModelFactory.class);
20 26
30 super(); 36 super();
31 } 37 }
32 38
33 /** 39 /**
34 * This Method provides an singleton Instance of this Class. 40 * This Method provides an singleton Instance of this Class.
35 *
36 * @return an singleton Instance of this Class 41 * @return an singleton Instance of this Class
37 */ 42 */
38 public synchronized static SessionModelFactory getInstance() { 43 public synchronized static SessionModelFactory getInstance() {
44 log.debug("SessionModelFactory.getInstance");
39 if (instance == null) { 45 if (instance == null) {
40 instance = new SessionModelFactory(); 46 instance = new SessionModelFactory();
41 } 47 }
42 return instance; 48 return instance;
43 } 49 }
44 50
45 /** 51 /**
46 * Getting the ArtifactDatabaseClient 52 * Getting the ArtifactDatabaseClient
47 * 53 * @param request the tequest from which the SessionModel should be read.
48 * @return the ArtifactDatabaseClient 54 * @return the ArtifactDatabaseClient
49 */ 55 */
50 public SessionModel getSessionModel(HttpServletRequest request) { 56 public SessionModel getSessionModel(HttpServletRequest request) {
57 log.debug("SessionModelFactory.getSessionModel");
51 synchronized (request) { 58 synchronized (request) {
52 SessionModel sm = null; 59 SessionModel sm = null;
53 Object obj = request.getSession().getAttribute(SESSION_MODEL_ID); 60 Object obj = request.getSession().getAttribute(SESSION_MODEL_ID);
54 if (obj instanceof SessionModel) { 61 if (obj instanceof SessionModel) {
55 sm = (SessionModel) obj; 62 sm = (SessionModel) obj;

http://dive4elements.wald.intevation.org