01: package org.romaframework.module.admin.view.domain.activesession.http;
02:
03: import java.util.Collection;
04:
05: import org.romaframework.aspect.core.annotation.CoreClass;
06: import org.romaframework.aspect.session.SessionAspect;
07: import org.romaframework.aspect.session.SessionInfo;
08: import org.romaframework.core.flow.ObjectContext;
09: import org.romaframework.module.admin.view.domain.activesession.ActiveSessionListable;
10: import org.romaframework.module.admin.view.domain.activesession.ActiveSessionMain;
11:
12: @CoreClass(orderFields="info sessions",orderActions="view refresh sendMessage shutdown selectAll deselectAll")
13: public class HttpActiveSessionMain extends ActiveSessionMain {
14: @Override
15: protected void fillSessions() {
16: Collection<SessionInfo> activeSessions = ObjectContext
17: .getInstance().getComponent(SessionAspect.class)
18: .getSessionInfos();
19:
20: synchronized (activeSessions) {
21: sessions.clear();
22: for (SessionInfo s : activeSessions) {
23: sessions.add(new HttpActiveSessionListable(s));
24: }
25: }
26:
27: ObjectContext.getInstance().refresh(this , "sessions");
28: }
29:
30: @Override
31: public void view() {
32: Object[] sel = getSelection();
33: if (sel == null || sel.length == 0)
34: return;
35:
36: ObjectContext.getInstance().show(
37: new HttpActiveSessionInstance(
38: ((ActiveSessionListable) sel[0]).getEntity(),
39: this));
40: }
41: }
|