|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.directwebremoting.Browser
public class Browser
A collection of APIs that manage reverse ajax APIs.
See withAllSessions(java.lang.Runnable) for a menu of the various different with*
methods.
The Runnables that are passed to the with* methods may be executed
any number of times between 0 (nothing passes the filter) 1 (where
getTargetSessions() returns all the matching ScriptSessions)
and X (where X is the number of matching ScriptSessions, with
getTargetSessions() returning one of the ScriptSessions on
each invocation).
| Constructor Summary | |
|---|---|
Browser()
|
|
| Method Summary | |
|---|---|
static void |
close(java.lang.Object proxy)
If a browser passes an object or function to DWR then DWR may need to release the reference that DWR keeps. |
static java.util.Collection<ScriptSession> |
getTargetSessions()
This method discovers the sessions that are currently being targeted by browser updates. |
static void |
withAllSessions(java.lang.Runnable task)
Execute some task (represented by a Runnable) and aim the output
at all browser window open at all pages in this web application. |
static void |
withAllSessions(ServerContext serverContext,
java.lang.Runnable task)
As withAllSessions(Runnable), but for use when there is more
than one copy of DWR in the ServletContext. |
static void |
withAllSessionsFiltered(ScriptSessionFilter filter,
java.lang.Runnable task)
Execute a task an send the output to a subset of the total list of users. |
static void |
withAllSessionsFiltered(ServerContext serverContext,
ScriptSessionFilter filter,
java.lang.Runnable task)
As withAllSessionsFiltered(ScriptSessionFilter, Runnable), but
for use when there is more than one copy of DWR in the ServletContext. |
static void |
withCurrentPage(java.lang.Runnable task)
Execute a task and aim the output at all the browser windows open at the same page as the current request. |
static void |
withCurrentPageFiltered(ScriptSessionFilter filter,
java.lang.Runnable task)
Execute a task and aim the output at a subset of the browser windows open at the same page as the current request. |
static void |
withPage(ServerContext serverContext,
java.lang.String page,
java.lang.Runnable task)
As withPage(String, Runnable), but for use when there is more
than one copy of DWR in the ServletContext. |
static void |
withPage(java.lang.String page,
java.lang.Runnable task)
Execute a task and aim the output at all the browser windows open at a given page in this web application. |
static void |
withPageFiltered(ServerContext serverContext,
java.lang.String page,
ScriptSessionFilter filter,
java.lang.Runnable task)
As withPageFiltered(java.lang.String, org.directwebremoting.ScriptSessionFilter, java.lang.Runnable), but for use when there is more than one copy of DWR
in a ServletContext. |
static void |
withPageFiltered(java.lang.String page,
ScriptSessionFilter filter,
java.lang.Runnable task)
Execute a task and aim the output at a subset of the users on a page. |
static void |
withSession(ServerContext serverContext,
java.lang.String sessionId,
java.lang.Runnable task)
As withSession(String, Runnable), but for use when there is more
than one copy of DWR in a ServletContext. |
static void |
withSession(java.lang.String sessionId,
java.lang.Runnable task)
Execute a task and aim the output at a specific script session. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Browser()
| Method Detail |
|---|
public static void withAllSessions(java.lang.Runnable task)
Runnable) and aim the output
at all browser window open at all pages in this web application.
It is likely that a more fine-grained broadcast method will be applicable
to most situations. The other with* methods in this class provide extra
ways to filter the set of pages to broadcast to. This option could be
useful if all pages contain an 'update' area, or to broadcast status
information: Window.alert("System reboot in 20mins. Please log off");
To send UI code to browser windows looking at a specific page, see the
withPage(java.lang.String, java.lang.Runnable) method. To send to a custom set of browser windows,
see the withAllSessionsFiltered(org.directwebremoting.ScriptSessionFilter, java.lang.Runnable) method. To send to a specific
session, use withSession(java.lang.String, java.lang.Runnable).
task - A code block to execute
public static void withAllSessions(ServerContext serverContext,
java.lang.Runnable task)
withAllSessions(Runnable), but for use when there is more
than one copy of DWR in the ServletContext.
For 99% of cases the former method will be much simpler to use.
serverContext - The specific DWR context in which to execute
public static void withAllSessionsFiltered(ScriptSessionFilter filter,
java.lang.Runnable task)
ScriptSessionFilter defines which subset.
This method could be used to alert administrators wherever they are on a
site about urgent action that need attention.
filter - Used to define the set of browser windows which should
receive the update.task - A code block to execute
public static void withAllSessionsFiltered(ServerContext serverContext,
ScriptSessionFilter filter,
java.lang.Runnable task)
withAllSessionsFiltered(ScriptSessionFilter, Runnable), but
for use when there is more than one copy of DWR in the ServletContext.
For 99% of cases the former method will be much simpler to use.
serverContext - The specific DWR context in which to executepublic static void withCurrentPage(java.lang.Runnable task)
withCurrentPageFiltered(org.directwebremoting.ScriptSessionFilter, java.lang.Runnable) method.
task - A code block to execute
public static void withPage(java.lang.String page,
java.lang.Runnable task)
withPageFiltered(java.lang.String, org.directwebremoting.ScriptSessionFilter, java.lang.Runnable) method.
page - The page to send to, excluding protocol/host/port specifiers
but including context path and servlet path. For example to send to
http://example.com:8080/webapp/controller/path/index.html,
you should use "/webapp/controller/path/index.html" or since the default
PageNormalizer understands default pages, this is the same as sending to
browsers viewing "/webapp/controller/path/".
To discover the contextPath at runtime you can use
javax.servlet.ServletContext#getContextPath with servlet 2.5, or before
version 2.5 you can also use ServerContext.getContextPath() or
HttpServletRequest.getContextPath().task - A code block to execute
public static void withPage(ServerContext serverContext,
java.lang.String page,
java.lang.Runnable task)
withPage(String, Runnable), but for use when there is more
than one copy of DWR in the ServletContext.
For 99% of cases the former method will be much simpler to use.
serverContext - The specific DWR context in which to execute
public static void withCurrentPageFiltered(ScriptSessionFilter filter,
java.lang.Runnable task)
filter - Used to define the set of browser windows which should
receive the update.task - A code block to execute
public static void withPageFiltered(java.lang.String page,
ScriptSessionFilter filter,
java.lang.Runnable task)
page - The page to send to. See withPage(java.lang.String, java.lang.Runnable) for detailsfilter - Used to define the set of browser windows which should
receive the update.task - A code block to execute
public static void withPageFiltered(ServerContext serverContext,
java.lang.String page,
ScriptSessionFilter filter,
java.lang.Runnable task)
withPageFiltered(java.lang.String, org.directwebremoting.ScriptSessionFilter, java.lang.Runnable), but for use when there is more than one copy of DWR
in a ServletContext.
For 99% of cases the former method will be much simpler to use.
serverContext - The specific DWR context in which to execute
public static void withSession(java.lang.String sessionId,
java.lang.Runnable task)
sessionId - The ScriptSession.id of the browser windowtask - A code block to execute
public static void withSession(ServerContext serverContext,
java.lang.String sessionId,
java.lang.Runnable task)
withSession(String, Runnable), but for use when there is more
than one copy of DWR in a ServletContext.
For 99% of cases the former method will be much simpler to use.
serverContext - The specific DWR context in which to executepublic static void close(java.lang.Object proxy)
proxy - An proxy created interface implementation from a browser
that we no longer need.public static java.util.Collection<ScriptSession> getTargetSessions()
It will generally only be useful to authors of reverse ajax UI proxy APIs. Using it directly may cause scaling problems
|
Copyright ยจ 2008 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||