|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pivot.wtk.ApplicationContext
public abstract class ApplicationContext
Base class for application contexts.
Nested Class Summary | |
---|---|
class |
ApplicationContext.DisplayHost
Native display host. |
static class |
ApplicationContext.QueuedCallback
Class representing a queued callback. |
static class |
ApplicationContext.ResourceCacheDictionary
Resource cache dictionary implementation. |
static class |
ApplicationContext.ScheduledCallback
Class representing a scheduled callback. |
Field Summary | |
---|---|
protected static URL |
origin
|
Constructor Summary | |
---|---|
protected |
ApplicationContext()
|
Method Summary | ||
---|---|---|
protected static void |
addApplication(Application application)
|
|
protected static void |
addDisplay(Display display)
|
|
protected static void |
createTimer()
|
|
protected static void |
destroyTimer()
|
|
protected Application |
getApplication()
|
|
protected Display |
getDisplay()
|
|
protected ApplicationContext.DisplayHost |
getDisplayHost()
|
|
static Version |
getJVMVersion()
Returns the current JVM version. |
|
static URL |
getOrigin()
Returns this application's origin (the URL of it's originating server). |
|
static ApplicationContext.ResourceCacheDictionary |
getResourceCache()
Resource properties accessor. |
|
protected static void |
invalidateDisplays()
|
|
static ApplicationContext.QueuedCallback |
queueCallback(Runnable callback)
Queues a task to execute after all pending events have been processed and returns without waiting for the task to complete. |
|
static ApplicationContext.QueuedCallback |
queueCallback(Runnable callback,
boolean wait)
Queues a task to execute after all pending events have been processed and optionally waits for the task to complete. |
|
static
|
queueMessage(T message)
Queues a callback to send a message via sendMessage(Object) . |
|
protected static void |
removeApplication(Application application)
|
|
protected static void |
removeDisplay(Display display)
|
|
static ApplicationContext.ScheduledCallback |
scheduleCallback(Runnable callback,
long delay)
Schedules a task for one-time execution. |
|
static ApplicationContext.ScheduledCallback |
scheduleRecurringCallback(Runnable callback,
long period)
Schedules a task for repeated execution. |
|
static ApplicationContext.ScheduledCallback |
scheduleRecurringCallback(Runnable callback,
long delay,
long period)
Schedules a task for repeated execution. |
|
static
|
sendMessage(T message)
Sends a message to subscribed topic listeners. |
|
protected void |
setApplication(Application application)
|
|
static
|
subscribe(Class<? super T> topic,
ApplicationContextMessageListener<T> messageListener)
Subscribes a listener to a message topic. |
|
static
|
unsubscribe(Class<? super T> topic,
ApplicationContextMessageListener<T> messageListener)
Unsubscribes a listener from a message topic. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static URL origin
Constructor Detail |
---|
protected ApplicationContext()
Method Detail |
---|
protected Application getApplication()
protected void setApplication(Application application)
protected ApplicationContext.DisplayHost getDisplayHost()
protected Display getDisplay()
public static URL getOrigin()
public static ApplicationContext.ResourceCacheDictionary getResourceCache()
public static Version getJVMVersion()
public static ApplicationContext.ScheduledCallback scheduleCallback(Runnable callback, long delay)
callback
- The task to execute.delay
- The length of time to wait before executing the task.public static ApplicationContext.ScheduledCallback scheduleRecurringCallback(Runnable callback, long period)
callback
- The task to execute.period
- The interval at which the task will be repeated.public static ApplicationContext.ScheduledCallback scheduleRecurringCallback(Runnable callback, long delay, long period)
callback
- The task to execute.delay
- The length of time to wait before the first execution of the taskperiod
- The interval at which the task will be repeated.public static ApplicationContext.QueuedCallback queueCallback(Runnable callback)
callback
- The task to execute.public static ApplicationContext.QueuedCallback queueCallback(Runnable callback, boolean wait)
callback
- The task to execute.wait
- If true, does not return until the task has executed.
Otherwise, returns immediately.public static <T> void subscribe(Class<? super T> topic, ApplicationContextMessageListener<T> messageListener)
topic
- messageListener
- public static <T> void unsubscribe(Class<? super T> topic, ApplicationContextMessageListener<T> messageListener)
topic
- messageListener
- public static <T> void sendMessage(T message)
message
- public static <T> void queueMessage(T message)
sendMessage(Object)
.
message
- protected static void createTimer()
protected static void destroyTimer()
protected static void addDisplay(Display display)
protected static void removeDisplay(Display display)
protected static void invalidateDisplays()
protected static void addApplication(Application application)
protected static void removeApplication(Application application)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |