01: /*
02: ItsNat Java Web Application Framework
03: Copyright (C) 2007 Innowhere Software Services S.L., Spanish Company
04: Author: Jose Maria Arranz Santamaria
05:
06: This program is free software: you can redistribute it and/or modify
07: it under the terms of the GNU Affero General Public License as published by
08: the Free Software Foundation, either version 3 of the License, or
09: (at your option) any later version. See the GNU Affero General Public
10: License for more details. See the copy of the GNU Affero General Public License
11: included in this program. If not, see <http://www.gnu.org/licenses/>.
12: */
13:
14: package org.itsnat.impl.core.client;
15:
16: import org.itsnat.impl.core.*;
17: import org.itsnat.impl.core.comet.CometNotifierImpl;
18: import org.itsnat.impl.core.comet.RemoteControlCometNotifierImpl;
19: import org.itsnat.impl.core.listener.CometTaskEventListenerWrapper;
20: import org.itsnat.impl.core.listener.CometTaskRegistry;
21: import org.itsnat.impl.core.listener.RemoteControlCometTaskRegistry;
22:
23: /**
24: *
25: * @author jmarranz
26: */
27: public class ClientDocumentInvitedRemoteCtrlCometImpl extends
28: ClientDocumentInvitedRemoteCtrlImpl {
29: protected RemoteControlCometNotifierImpl cometNotifier;
30: protected RemoteControlCometTaskRegistry cometTaskRegistry;
31:
32: /** Creates a new instance of ClientDocumentInvitedRemoteCtrlCometImpl */
33: public ClientDocumentInvitedRemoteCtrlCometImpl(int phase,
34: int syncMode, long ajaxTimeout, ItsNatSessionImpl session,
35: ItsNatDocumentImpl itsNatDoc) {
36: super (phase, syncMode, ajaxTimeout, session, itsNatDoc);
37:
38: this .cometNotifier = new RemoteControlCometNotifierImpl(this );
39: }
40:
41: public RemoteControlCometNotifierImpl getCometNotifier() {
42: return cometNotifier;
43: }
44:
45: public CometTaskRegistry getCometTaskRegistry() {
46: if (cometTaskRegistry == null)
47: this .cometTaskRegistry = new RemoteControlCometTaskRegistry(
48: this ); // para ahorrar memoria si no se usa
49: return cometTaskRegistry;
50: }
51:
52: public void addCometTask(CometNotifierImpl notifier) {
53: getCometTaskRegistry().addCometTask(notifier);
54: }
55:
56: public CometTaskEventListenerWrapper removeCometTask(String id) {
57: return getCometTaskRegistry().removeCometTask(id);
58: }
59:
60: public void setInvalid() {
61: super .setInvalid();
62:
63: cometNotifier.stop();
64: }
65:
66: public void normalEventReceived() {
67: cometNotifier.notifyClient();
68: }
69: }
|