Source Code Cross Referenced for Session.java in  » Profiler » MessAdmin » clime » messadmin » jmx » mbeans » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Profiler » MessAdmin » clime.messadmin.jmx.mbeans 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * 
003:         */package clime.messadmin.jmx.mbeans;
004:
005:        import java.security.Principal;
006:        import java.util.Collections;
007:        import java.util.Date;
008:        import java.util.Enumeration;
009:        import java.util.List;
010:        import java.util.Locale;
011:        import java.util.Map;
012:
013:        import javax.servlet.ServletContext;
014:        import javax.servlet.http.HttpSession;
015:        import javax.servlet.http.HttpSessionContext;
016:
017:        import clime.messadmin.core.Constants;
018:        import clime.messadmin.core.MessAdmin;
019:        import clime.messadmin.model.ErrorData;
020:        import clime.messadmin.model.ISessionInfo;
021:        import clime.messadmin.model.Server;
022:
023:        /**
024:         * IMPLEMENTATION NOTE: don't forget to synchronize setters!
025:         * @author Cédrik LIME
026:         */
027:        public class Session implements  SessionMBean { //extends NotificationBroadcasterSupport
028:            private String context;
029:            private String sessionId;
030:
031:            /**
032:             * 
033:             */
034:            public Session() {
035:                super ();
036:            }
037:
038:            public void setContext(String ctx) {
039:                context = ctx;
040:            }
041:
042:            public void setSessionId(String id) {
043:                sessionId = id;
044:            }
045:
046:            // Methods from HttpSession
047:
048:            public long getCreationTime() {
049:                try {
050:                    HttpSession session = Server.getInstance().getApplication(
051:                            context).getSession(sessionId).getSessionInfo();
052:                    return session == null ? -1 : session.getCreationTime();
053:                } catch (IllegalStateException ise) {
054:                    // session is invalidated
055:                    return -1;
056:                }
057:            }
058:
059:            public long getLastAccessedTime() {
060:                try {
061:                    HttpSession session = Server.getInstance().getApplication(
062:                            context).getSession(sessionId).getSessionInfo();
063:                    return session == null ? -1 : session.getLastAccessedTime();
064:                } catch (IllegalStateException ise) {
065:                    // session is invalidated
066:                    return -1;
067:                }
068:            }
069:
070:            public int getMaxInactiveInterval() {
071:                try {
072:                    HttpSession session = Server.getInstance().getApplication(
073:                            context).getSession(sessionId).getSessionInfo();
074:                    return session == null ? -1 : session
075:                            .getMaxInactiveInterval();
076:                } catch (IllegalStateException ise) {
077:                    // session is invalidated
078:                    return 0;
079:                }
080:            }
081:
082:            public void invalidate() {
083:                HttpSession session = Server.getInstance().getApplication(
084:                        context).getSession(sessionId).getSessionInfo();
085:                if (session != null) {
086:                    try {
087:                        session.invalidate();
088:                    } catch (IllegalStateException ise) {
089:                        // session is invalidated
090:                    }
091:                }
092:            }
093:
094:            public boolean isNew() {
095:                try {
096:                    HttpSession session = Server.getInstance().getApplication(
097:                            context).getSession(sessionId).getSessionInfo();
098:                    return session == null ? true : session.isNew();
099:                } catch (IllegalStateException ise) {
100:                    // session is invalidated
101:                    return false;
102:                }
103:            }
104:
105:            public void removeAttribute(String in_name) {
106:                HttpSession session = Server.getInstance().getApplication(
107:                        context).getSession(sessionId).getSessionInfo();
108:                if (session != null) {
109:                    try {
110:                        session.removeAttribute(in_name);
111:                    } catch (IllegalStateException ise) {
112:                        // session is invalidated
113:                    }
114:                }
115:            }
116:
117:            public synchronized void setMaxInactiveInterval(int in_interval) {
118:                HttpSession session = Server.getInstance().getApplication(
119:                        context).getSession(sessionId).getSessionInfo();
120:                if (session != null) {
121:                    try {
122:                        session.setMaxInactiveInterval(in_interval);
123:                    } catch (IllegalStateException ise) {
124:                        // session is invalidated
125:                    }
126:                }
127:            }
128:
129:            public Object getAttribute(String name) {
130:                HttpSession session = Server.getInstance().getApplication(
131:                        context).getSession(sessionId).getSessionInfo();
132:                return (session == null) ? null : session.getAttribute(name);
133:            }
134:
135:            public Enumeration getAttributeNames() {
136:                HttpSession session = Server.getInstance().getApplication(
137:                        context).getSession(sessionId).getSessionInfo();
138:                return (session == null) ? null : session.getAttributeNames();
139:            }
140:
141:            public void setAttribute(String name, Object value) {
142:                HttpSession session = Server.getInstance().getApplication(
143:                        context).getSession(sessionId).getSessionInfo();
144:                if (session != null) {
145:                    session.setAttribute(name, value);
146:                }
147:            }
148:
149:            public String getId() {
150:                return sessionId;
151:            }
152:
153:            public ServletContext getServletContext() {
154:                return null;
155:            }
156:
157:            /**
158:             * @deprecated
159:             */
160:            @Deprecated
161:            public HttpSessionContext getSessionContext() {
162:                return null;
163:            }
164:
165:            /**
166:             * @deprecated
167:             */
168:            @Deprecated
169:            public Object getValue(String name) {
170:                return null;
171:            }
172:
173:            /**
174:             * @deprecated
175:             */
176:            @Deprecated
177:            public String[] getValueNames() {
178:                return null;
179:            }
180:
181:            /**
182:             * @deprecated
183:             */
184:            @Deprecated
185:            public void putValue(String name, Object value) {
186:            }
187:
188:            /**
189:             * @deprecated
190:             */
191:            @Deprecated
192:            public void removeValue(String name) {
193:            }
194:
195:            // Methods from SessionInfo
196:
197:            /** {@inheritDoc} */
198:            public int getNErrors() {
199:                ISessionInfo extraSessionInfo = Server.getInstance()
200:                        .getApplication(context).getSession(sessionId)
201:                        .getSessionInfo();
202:                return extraSessionInfo == null ? 0 : extraSessionInfo
203:                        .getNErrors();
204:            }
205:
206:            /** {@inheritDoc} */
207:            public ErrorData getLastError() {
208:                ISessionInfo extraSessionInfo = Server.getInstance()
209:                        .getApplication(context).getSession(sessionId)
210:                        .getSessionInfo();
211:                return extraSessionInfo == null ? null : extraSessionInfo
212:                        .getLastError();
213:            }
214:
215:            /**
216:             * {@inheritDoc}
217:             */
218:            public Map getAttributes() {
219:                ISessionInfo extraSessionInfo = Server.getInstance()
220:                        .getApplication(context).getSession(sessionId)
221:                        .getSessionInfo();
222:                return extraSessionInfo == null ? Collections.EMPTY_MAP
223:                        : extraSessionInfo.getAttributes();
224:            }
225:
226:            /**
227:             * {@inheritDoc}
228:             */
229:            public String getLastRequestURL() {
230:                ISessionInfo extraSessionInfo = Server.getInstance()
231:                        .getApplication(context).getSession(sessionId)
232:                        .getSessionInfo();
233:                return extraSessionInfo == null ? null : extraSessionInfo
234:                        .getLastRequestURL();
235:            }
236:
237:            /**
238:             * {@inheritDoc}
239:             */
240:            public String getRemoteHost() {
241:                ISessionInfo extraSessionInfo = Server.getInstance()
242:                        .getApplication(context).getSession(sessionId)
243:                        .getSessionInfo();
244:                return extraSessionInfo == null ? null : extraSessionInfo
245:                        .getRemoteHost();
246:            }
247:
248:            /**
249:             * {@inheritDoc}
250:             */
251:            public Principal getUserPrincipal() {
252:                ISessionInfo extraSessionInfo = Server.getInstance()
253:                        .getApplication(context).getSession(sessionId)
254:                        .getSessionInfo();
255:                return extraSessionInfo == null ? null : extraSessionInfo
256:                        .getUserPrincipal();
257:            }
258:
259:            /**
260:             * {@inheritDoc}
261:             */
262:            public String getRemoteUser() {
263:                ISessionInfo extraSessionInfo = Server.getInstance()
264:                        .getApplication(context).getSession(sessionId)
265:                        .getSessionInfo();
266:                return extraSessionInfo == null ? null : extraSessionInfo
267:                        .getRemoteUser();
268:            }
269:
270:            /**
271:             * {@inheritDoc}
272:             */
273:            public int getHits() {
274:                ISessionInfo extraSessionInfo = Server.getInstance()
275:                        .getApplication(context).getSession(sessionId)
276:                        .getSessionInfo();
277:                return extraSessionInfo == null ? -1 : extraSessionInfo
278:                        .getHits();
279:            }
280:
281:            /**
282:             * {@inheritDoc}
283:             */
284:            public long getRequestLastLength() {
285:                ISessionInfo extraSessionInfo = Server.getInstance()
286:                        .getApplication(context).getSession(sessionId)
287:                        .getSessionInfo();
288:                return extraSessionInfo == null ? -1 : extraSessionInfo
289:                        .getRequestLastLength();
290:            }
291:
292:            /**
293:             * {@inheritDoc}
294:             */
295:            public long getResponseLastLength() {
296:                ISessionInfo extraSessionInfo = Server.getInstance()
297:                        .getApplication(context).getSession(sessionId)
298:                        .getSessionInfo();
299:                return extraSessionInfo == null ? -1 : extraSessionInfo
300:                        .getResponseLastLength();
301:            }
302:
303:            /**
304:             * {@inheritDoc}
305:             */
306:            public long getRequestMinLength() {
307:                ISessionInfo extraSessionInfo = Server.getInstance()
308:                        .getApplication(context).getSession(sessionId)
309:                        .getSessionInfo();
310:                return extraSessionInfo == null ? -1 : extraSessionInfo
311:                        .getRequestMinLength();
312:            }
313:
314:            /**
315:             * {@inheritDoc}
316:             */
317:            public long getResponseMinLength() {
318:                ISessionInfo extraSessionInfo = Server.getInstance()
319:                        .getApplication(context).getSession(sessionId)
320:                        .getSessionInfo();
321:                return extraSessionInfo == null ? -1 : extraSessionInfo
322:                        .getResponseMinLength();
323:            }
324:
325:            /**
326:             * {@inheritDoc}
327:             */
328:            public Date getRequestMinLengthDate() {
329:                ISessionInfo extraSessionInfo = Server.getInstance()
330:                        .getApplication(context).getSession(sessionId)
331:                        .getSessionInfo();
332:                return extraSessionInfo == null ? null : extraSessionInfo
333:                        .getRequestMinLengthDate();
334:            }
335:
336:            /**
337:             * {@inheritDoc}
338:             */
339:            public Date getResponseMinLengthDate() {
340:                ISessionInfo extraSessionInfo = Server.getInstance()
341:                        .getApplication(context).getSession(sessionId)
342:                        .getSessionInfo();
343:                return extraSessionInfo == null ? null : extraSessionInfo
344:                        .getResponseMinLengthDate();
345:            }
346:
347:            /**
348:             * {@inheritDoc}
349:             */
350:            public long getRequestMaxLength() {
351:                ISessionInfo extraSessionInfo = Server.getInstance()
352:                        .getApplication(context).getSession(sessionId)
353:                        .getSessionInfo();
354:                return extraSessionInfo == null ? -1 : extraSessionInfo
355:                        .getRequestMaxLength();
356:            }
357:
358:            /**
359:             * {@inheritDoc}
360:             */
361:            public long getResponseMaxLength() {
362:                ISessionInfo extraSessionInfo = Server.getInstance()
363:                        .getApplication(context).getSession(sessionId)
364:                        .getSessionInfo();
365:                return extraSessionInfo == null ? -1 : extraSessionInfo
366:                        .getResponseMaxLength();
367:            }
368:
369:            /**
370:             * {@inheritDoc}
371:             */
372:            public Date getRequestMaxLengthDate() {
373:                ISessionInfo extraSessionInfo = Server.getInstance()
374:                        .getApplication(context).getSession(sessionId)
375:                        .getSessionInfo();
376:                return extraSessionInfo == null ? null : extraSessionInfo
377:                        .getRequestMaxLengthDate();
378:            }
379:
380:            /**
381:             * {@inheritDoc}
382:             */
383:            public Date getResponseMaxLengthDate() {
384:                ISessionInfo extraSessionInfo = Server.getInstance()
385:                        .getApplication(context).getSession(sessionId)
386:                        .getSessionInfo();
387:                return extraSessionInfo == null ? null : extraSessionInfo
388:                        .getResponseMaxLengthDate();
389:            }
390:
391:            /**
392:             * {@inheritDoc}
393:             */
394:            public long getRequestTotalLength() {
395:                ISessionInfo extraSessionInfo = Server.getInstance()
396:                        .getApplication(context).getSession(sessionId)
397:                        .getSessionInfo();
398:                return extraSessionInfo == null ? -1 : extraSessionInfo
399:                        .getRequestTotalLength();
400:            }
401:
402:            /**
403:             * {@inheritDoc}
404:             */
405:            public long getResponseTotalLength() {
406:                ISessionInfo extraSessionInfo = Server.getInstance()
407:                        .getApplication(context).getSession(sessionId)
408:                        .getSessionInfo();
409:                return extraSessionInfo == null ? -1 : extraSessionInfo
410:                        .getResponseTotalLength();
411:            }
412:
413:            /**
414:             * {@inheritDoc}
415:             */
416:            public double getRequestMeanLength() {
417:                ISessionInfo extraSessionInfo = Server.getInstance()
418:                        .getApplication(context).getSession(sessionId)
419:                        .getSessionInfo();
420:                return extraSessionInfo == null ? -1 : extraSessionInfo
421:                        .getRequestMeanLength();
422:            }
423:
424:            /**
425:             * {@inheritDoc}
426:             */
427:            public double getResponseMeanLength() {
428:                ISessionInfo extraSessionInfo = Server.getInstance()
429:                        .getApplication(context).getSession(sessionId)
430:                        .getSessionInfo();
431:                return extraSessionInfo == null ? -1 : extraSessionInfo
432:                        .getResponseMeanLength();
433:            }
434:
435:            /**
436:             * {@inheritDoc}
437:             */
438:            public double getRequestStdDevLength() {
439:                ISessionInfo extraSessionInfo = Server.getInstance()
440:                        .getApplication(context).getSession(sessionId)
441:                        .getSessionInfo();
442:                return extraSessionInfo == null ? -1 : extraSessionInfo
443:                        .getRequestStdDevLength();
444:            }
445:
446:            /**
447:             * {@inheritDoc}
448:             */
449:            public double getResponseStdDevLength() {
450:                ISessionInfo extraSessionInfo = Server.getInstance()
451:                        .getApplication(context).getSession(sessionId)
452:                        .getSessionInfo();
453:                return extraSessionInfo == null ? -1 : extraSessionInfo
454:                        .getResponseStdDevLength();
455:            }
456:
457:            /**
458:             * {@inheritDoc}
459:             */
460:            public Date getLastRequestDate() {
461:                ISessionInfo extraSessionInfo = Server.getInstance()
462:                        .getApplication(context).getSession(sessionId)
463:                        .getSessionInfo();
464:                return extraSessionInfo == null ? null : extraSessionInfo
465:                        .getLastRequestDate();
466:            }
467:
468:            /**
469:             * {@inheritDoc}
470:             */
471:            public Date getLastResponseDate() {
472:                ISessionInfo extraSessionInfo = Server.getInstance()
473:                        .getApplication(context).getSession(sessionId)
474:                        .getSessionInfo();
475:                return extraSessionInfo == null ? null : extraSessionInfo
476:                        .getLastResponseDate();
477:            }
478:
479:            /**
480:             * {@inheritDoc}
481:             */
482:            public boolean isSecure() {
483:                ISessionInfo extraSessionInfo = Server.getInstance()
484:                        .getApplication(context).getSession(sessionId)
485:                        .getSessionInfo();
486:                return extraSessionInfo == null ? false : extraSessionInfo
487:                        .isSecure();
488:            }
489:
490:            /**
491:             * {@inheritDoc}
492:             */
493:            public String getSslCipherSuite() {
494:                ISessionInfo extraSessionInfo = Server.getInstance()
495:                        .getApplication(context).getSession(sessionId)
496:                        .getSessionInfo();
497:                return extraSessionInfo == null ? null : extraSessionInfo
498:                        .getSslCipherSuite();
499:            }
500:
501:            /**
502:             * {@inheritDoc}
503:             */
504:            public Integer getSslAlgorithmSize() {
505:                ISessionInfo extraSessionInfo = Server.getInstance()
506:                        .getApplication(context).getSession(sessionId)
507:                        .getSessionInfo();
508:                return extraSessionInfo == null ? null : extraSessionInfo
509:                        .getSslAlgorithmSize();
510:            }
511:
512:            //	/**
513:            //	 * {@inheritDoc}
514:            //	 */
515:            //	public X509Certificate[] getSslCertificates() {
516:            //		ISessionInfo extraSessionInfo = Server.getInstance().getApplication(context).getSession(sessionId).getSessionInfo();
517:            //		return extraSessionInfo == null ? null : extraSessionInfo.getSslCertificates();
518:            //	}
519:
520:            /**
521:             * {@inheritDoc}
522:             */
523:            public boolean isSerializable() {
524:                ISessionInfo extraSessionInfo = Server.getInstance()
525:                        .getApplication(context).getSession(sessionId)
526:                        .getSessionInfo();
527:                return extraSessionInfo == null ? true : extraSessionInfo
528:                        .isSerializable();
529:            }
530:
531:            /**
532:             * {@inheritDoc}
533:             */
534:            public long getSize() {
535:                ISessionInfo extraSessionInfo = Server.getInstance()
536:                        .getApplication(context).getSession(sessionId)
537:                        .getSessionInfo();
538:                return extraSessionInfo == null ? -1 : extraSessionInfo
539:                        .getSize();
540:            }
541:
542:            /**
543:             * {@inheritDoc}
544:             */
545:            public String getUserAgent() {
546:                ISessionInfo extraSessionInfo = Server.getInstance()
547:                        .getApplication(context).getSession(sessionId)
548:                        .getSessionInfo();
549:                return extraSessionInfo == null ? null : extraSessionInfo
550:                        .getUserAgent();
551:            }
552:
553:            /**
554:             * {@inheritDoc}
555:             */
556:            public String getAuthType() {
557:                ISessionInfo extraSessionInfo = Server.getInstance()
558:                        .getApplication(context).getSession(sessionId)
559:                        .getSessionInfo();
560:                return extraSessionInfo == null ? null : extraSessionInfo
561:                        .getAuthType();
562:            }
563:
564:            /**
565:             * {@inheritDoc}
566:             */
567:            public String getReferer() {
568:                ISessionInfo extraSessionInfo = Server.getInstance()
569:                        .getApplication(context).getSession(sessionId)
570:                        .getSessionInfo();
571:                return extraSessionInfo == null ? null : extraSessionInfo
572:                        .getReferer();
573:            }
574:
575:            /**
576:             * {@inheritDoc}
577:             */
578:            public int getLastResponseStatus() {
579:                ISessionInfo extraSessionInfo = Server.getInstance()
580:                        .getApplication(context).getSession(sessionId)
581:                        .getSessionInfo();
582:                return extraSessionInfo == null ? -1 : extraSessionInfo
583:                        .getLastResponseStatus();
584:            }
585:
586:            // Some more methods
587:
588:            /**
589:             * {@inheritDoc}
590:             */
591:            public int getIdleTime() {
592:                ISessionInfo extraSessionInfo = Server.getInstance()
593:                        .getApplication(context).getSession(sessionId)
594:                        .getSessionInfo();
595:                return extraSessionInfo == null ? -1 : extraSessionInfo
596:                        .getIdleTime();
597:            }
598:
599:            /**
600:             * {@inheritDoc}
601:             */
602:            public int getTTL() {
603:                ISessionInfo extraSessionInfo = Server.getInstance()
604:                        .getApplication(context).getSession(sessionId)
605:                        .getSessionInfo();
606:                return extraSessionInfo == null ? -1 : extraSessionInfo
607:                        .getTTL();
608:            }
609:
610:            /**
611:             * {@inheritDoc}
612:             */
613:            public int getAge() {
614:                ISessionInfo extraSessionInfo = Server.getInstance()
615:                        .getApplication(context).getSession(sessionId)
616:                        .getSessionInfo();
617:                return extraSessionInfo == null ? -1 : extraSessionInfo
618:                        .getAge();
619:            }
620:
621:            /**
622:             * {@inheritDoc}
623:             */
624:            public Object getGuessedUser() {
625:                ISessionInfo extraSessionInfo = Server.getInstance()
626:                        .getApplication(context).getSession(sessionId)
627:                        .getSessionInfo();
628:                return extraSessionInfo == null ? null : extraSessionInfo
629:                        .getGuessedUser();
630:            }
631:
632:            /**
633:             * {@inheritDoc}
634:             */
635:            public Locale getGuessedLocale() {
636:                ISessionInfo extraSessionInfo = Server.getInstance()
637:                        .getApplication(context).getSession(sessionId)
638:                        .getSessionInfo();
639:                return extraSessionInfo == null ? null : extraSessionInfo
640:                        .getGuessedLocale();
641:            }
642:
643:            /**
644:             * {@inheritDoc}
645:             */
646:            public int getLastUsedTime() {
647:                ISessionInfo extraSessionInfo = Server.getInstance()
648:                        .getApplication(context).getSession(sessionId)
649:                        .getSessionInfo();
650:                return extraSessionInfo == null ? -1 : extraSessionInfo
651:                        .getLastUsedTime();
652:            }
653:
654:            /**
655:             * {@inheritDoc}
656:             */
657:            public int getMinUsedTime() {
658:                ISessionInfo extraSessionInfo = Server.getInstance()
659:                        .getApplication(context).getSession(sessionId)
660:                        .getSessionInfo();
661:                return extraSessionInfo == null ? -1 : extraSessionInfo
662:                        .getMinUsedTime();
663:            }
664:
665:            /**
666:             * {@inheritDoc}
667:             */
668:            public Date getMinUsedTimeDate() {
669:                ISessionInfo extraSessionInfo = Server.getInstance()
670:                        .getApplication(context).getSession(sessionId)
671:                        .getSessionInfo();
672:                return extraSessionInfo == null ? null : extraSessionInfo
673:                        .getMinUsedTimeDate();
674:            }
675:
676:            /**
677:             * {@inheritDoc}
678:             */
679:            public int getMaxUsedTime() {
680:                ISessionInfo extraSessionInfo = Server.getInstance()
681:                        .getApplication(context).getSession(sessionId)
682:                        .getSessionInfo();
683:                return extraSessionInfo == null ? -1 : extraSessionInfo
684:                        .getMaxUsedTime();
685:            }
686:
687:            /**
688:             * {@inheritDoc}
689:             */
690:            public Date getMaxUsedTimeDate() {
691:                ISessionInfo extraSessionInfo = Server.getInstance()
692:                        .getApplication(context).getSession(sessionId)
693:                        .getSessionInfo();
694:                return extraSessionInfo == null ? null : extraSessionInfo
695:                        .getMaxUsedTimeDate();
696:            }
697:
698:            /**
699:             * {@inheritDoc}
700:             */
701:            public int getTotalUsedTime() {
702:                ISessionInfo extraSessionInfo = Server.getInstance()
703:                        .getApplication(context).getSession(sessionId)
704:                        .getSessionInfo();
705:                return extraSessionInfo == null ? -1 : extraSessionInfo
706:                        .getTotalUsedTime();
707:            }
708:
709:            /**
710:             * {@inheritDoc}
711:             */
712:            public double getMeanUsedTime() {
713:                ISessionInfo extraSessionInfo = Server.getInstance()
714:                        .getApplication(context).getSession(sessionId)
715:                        .getSessionInfo();
716:                return extraSessionInfo == null ? 0 : extraSessionInfo
717:                        .getMeanUsedTime();
718:            }
719:
720:            /**
721:             * {@inheritDoc}
722:             */
723:            public double getStdDevUsedTime() {
724:                ISessionInfo extraSessionInfo = Server.getInstance()
725:                        .getApplication(context).getSession(sessionId)
726:                        .getSessionInfo();
727:                return extraSessionInfo == null ? 0 : extraSessionInfo
728:                        .getStdDevUsedTime();
729:            }
730:
731:            /**
732:             * {@inheritDoc}
733:             */
734:            @SuppressWarnings("unchecked")
735:            public List<Map.Entry<String, String>> getSessionSpecificData() {
736:                ISessionInfo extraSessionInfo = Server.getInstance()
737:                        .getApplication(context).getSession(sessionId)
738:                        .getSessionInfo();
739:                return extraSessionInfo == null ? null : extraSessionInfo
740:                        .getSessionSpecificData();
741:            }
742:
743:            // Session-related actions
744:
745:            /**
746:             * {@inheritDoc}
747:             */
748:            public synchronized void sendMessage(String in_message) {
749:                MessAdmin.injectSessions(context, new String[] { sessionId },
750:                        in_message);
751:            }
752:
753:            /**
754:             * {@inheritDoc}
755:             */
756:            public boolean getHasPendingMessage() {
757:                HttpSession session = Server.getInstance().getApplication(
758:                        context).getSession(sessionId).getSessionInfo();
759:                try {
760:                    return session == null ? false
761:                            : session
762:                                    .getAttribute(Constants.SESSION_MESSAGE_KEY) != null;
763:                } catch (IllegalStateException ise) {
764:                    // session is invalidated
765:                    return false;
766:                }
767:            }
768:
769:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.