| org.itsnat.core.ClientDocument
All known Subclasses: org.itsnat.impl.core.client.ClientDocumentImpl,
Method Summary | |
public void | addCodeToSend(Object code) Add JavaScript code to send to the client (pending code). | public void | addCodeToSendListener(CodeToSendListener listener) Registers a new CodeToSendListener , this listener is called
every time
ClientDocument.addCodeToSend(Object) is called. | public CometNotifier | createCometNotifier() Creates a COMET notifier bound to this client and to the server document associated. | public CometNotifier | createCometNotifier(long ajaxTimeout) Creates a COMET notifier bound to this client and to the server document associated.
Parameters: ajaxTimeout - the timeout for the AJAX requests used to notify the client. | public void | disableSendCode() Disables the
ClientDocument.addCodeToSend(Object) method, no new code can be added
to send to the client. | public boolean | dispatchEvent(EventTarget target, Event evt, int syncMode, long ajaxTimeout) Sends the specified event to the browser and waits until this event is dispatched
calling dispatchEvent (FireFox) or fireEvent (MSIE) on the browser. | public void | enableSendCode() Enables the
ClientDocument.addCodeToSend(Object) method, new code can be added
to send to the client. | public Date | getCreationDate() Returns the date when this object was created. | public String | getId() Returns the client identity. | public ItsNatDocument | getItsNatDocument() Returns the ItsNat document associated. | public ItsNatSession | getItsNatSession() Returns the parent ItsNat session. | public boolean | isSendCodeEnabled() | public void | removeCodeToSendListener(CodeToSendListener listener) Removes a previously registered CodeToSendListener . | public void | startEventDispatcherThread(Runnable task) Executes the specified task in a new thread, this code is ready to
call EventTarget.dispatchEvent(Event) or
ClientDocument.dispatchEvent(EventTarget,Event,int,long) many times. |
createCometNotifier | public CometNotifier createCometNotifier(long ajaxTimeout)(Code) | | Creates a COMET notifier bound to this client and to the server document associated.
Parameters: ajaxTimeout - the timeout for the AJAX requests used to notify the client. If negative no timeout is defined. a new COMET notifier. |
dispatchEvent | public boolean dispatchEvent(EventTarget target, Event evt, int syncMode, long ajaxTimeout) throws EventException(Code) | | Sends the specified event to the browser and waits until this event is dispatched
calling dispatchEvent (FireFox) or fireEvent (MSIE) on the browser.
The call returns when the event is processed by the browser.
This method must not be called using a servlet-request thread.
See the Reference Manual ("Events fired by the server" chapter) about requirements of the caller thread.
The syncMode parameter and ajaxTimeout are used to specify the synchronous
mode and timeout of the internal event sent to the server to notify the client has
already dispatched the event.
Parameters: target - the event target DOM object. Parameters: evt - the DOM event to send to target. Parameters: syncMode - synchronization mode. Parameters: ajaxTimeout - the timeout of the AJAX event whether asynchronous. If negative no timeout is defined. See Also: ItsNatDocument.dispatchEvent(EventTargetEvent) See Also: ClientDocument.startEventDispatcherThread(Runnable code) |
getCreationDate | public Date getCreationDate()(Code) | | Returns the date when this object was created.
the creation date |
getId | public String getId()(Code) | | Returns the client identity. This value is unique per
ItsNatSession and never reused in this context.
The identity value is unique no other session-identified object in the same session
shares the same id.
Although this object is garbage collected, the identity value is never reused
by another session-identified object in the same session.
the identity value. |
getItsNatDocument | public ItsNatDocument getItsNatDocument()(Code) | | Returns the ItsNat document associated. If this object is a viewer
the document is not hold by a strong reference and may be null if
it was destroyed (the observer browser page may outlive to the main/owner page, only
the owner destroys the document).
the ItsNat document, may be null if this client is a viewer. |
getItsNatSession | public ItsNatSession getItsNatSession()(Code) | | Returns the parent ItsNat session. If this object is a viewer the session
may be different to the document owner session.
the ItsNat session. |
startEventDispatcherThread | public void startEventDispatcherThread(Runnable task)(Code) | | Executes the specified task in a new thread, this code is ready to
call EventTarget.dispatchEvent(Event) or
ClientDocument.dispatchEvent(EventTarget,Event,int,long) many times.
Use the thread created by this method to send events fired in the server
to the browser simulating user actions.
This method must be called using a servlet-request thread.
Parameters: task - the task to execute. |
|
|