1 | public class CloseAllButCurrentSessionsCommand implements ICommand↵ | | 1 | public class CommitCommand implements ICommand↵
|
2 | {↵ | | 2 | {↵
|
3 | /** Application API. */↵ | | 3 | /** ↵
|
4 | private final IApplication _app↵ | | 4 | Current session. */↵
|
5 | ;↵ | | 5 | private ISession _session;↵
|
|
6 | /**↵ | | 6 | /**↵
|
7 | * Ctor.↵ | | 7 | * Ctor.↵
|
8 | *↵ | | 8 | *↵
|
9 | * @param app Application API.↵ | | 9 | * @param session Current session.↵
|
10 | *↵ | | 10 | *↵
|
11 | * @throws IllegalArgumentException↵ | | 11 | * @throws IllegalArgumentException↵
|
12 | * Thrown if a <TT>null</TT> <TT>IApplication</TT> passed.↵ | | 12 | * Thrown if a <TT>null</TT> <TT>ISession</TT> passed.↵
|
13 | */↵ | | 13 | */↵
|
14 | public CloseAllButCurrentSessionsCommand(IApplication app)↵ | | 14 | public C↵
|
15 | throws IllegalArgumentException↵ | | 15 | ommitCommand(ISession session)↵
|
16 | {↵ | | 16 | {↵
|
17 | super();↵ | | 17 | super();↵
|
18 | if (app == null)↵ | | 18 | if (session == null)↵
|
19 | {↵ | | 19 | {↵
|
20 | throw new IllegalArgumentException("IApplication == null");↵ | | 20 | throw new IllegalArgumentException("Null ISession passed");↵
|
21 | }↵ | | 21 | }↵
|
|
22 | _app = app;↵ | | 22 | _↵
|
23 | }↵ | | |
|
|
24 | /**↵ | | |
|
25 | * Close all sess↵ | | 23 | session = session;↵
|
| | | 24 | }↵
|
|
| | | 25 | /**↵
|
26 | ions.↵ | | 26 | * Commit the transaction.↵
|
27 | */↵ | | 27 | */↵
|
28 | public void execute()↵ | | 28 | public void execute()↵
|
29 | {↵ | | 29 | {↵
|
30 | _app.getSessionManager().closeAllButCurrentSessions() | | 30 | _session.commit()
|