|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--one.world.core.Component
|
+--one.gui.Application
|
+--one.toys.RemoteCounter
Implementation of a resettable, synchronizable counter.
Usage:
RemoteCounter
Imported and Exported Event Handlers
Exported event handlers:
Imported event handlers:
| Inner classes inherited from class one.gui.Application |
Application.Window |
| Inner classes inherited from class one.world.core.Component |
Component.HandlerReference, Component.Importer |
| Field Summary | |
protected int |
count
The counter value. |
protected Timer.Notification |
countUpdate
The count update timer notification. |
protected String |
host
The host name of the remote counter to synchronize with. |
protected LeaseMaintainer |
leaseMaintainer
A lease maintainer for the exported synchronization request handler. |
protected String |
name
The name of the remote counter to synchronize with. |
protected int |
port
The port number of the remote counter to synchronize with. |
protected RemoteReference |
syncReference
The remote reference for the exported synchronization request handler. |
protected EventHandler |
syncRequestHandler
The synchronization request handler. |
protected EventHandler |
updateHandler
The count update handler. |
| Fields inherited from class one.gui.Application |
ACTIVATING, ACTIVE, appName, height, INACTIVE, locationX, locationY, lock, main, mainWindow, operation, request, status, timer, width |
| Constructor Summary | |
RemoteCounter(Environment env)
Create a new instance of RemoteCounter. |
|
| Method Summary | |
void |
acquire()
Acquire the resources needed by the remote counter application. |
void |
cancelUpdateTimer()
Cancel the count update notifications. |
Application.Window |
createMainWindow()
Create the remote counter's main window. |
static void |
init(Environment env,
Object closure)
Initialize the remote counter.. |
void |
release()
Release the resources used by the remote counter application. |
void |
setCount(int newCount)
Sets the count to the specified value. |
void |
setRemoteCounter(String host,
int port,
String name)
Sets the host, port, and name fields. |
void |
setUpdateTimer()
Set up the timed count update notification. |
void |
synchronize()
Synchronizes this counter with the remote counter given by the host, port, and name fields. |
| Methods inherited from class one.gui.Application |
createMainHandler, getDescriptor, signalError, start, stop |
| Methods inherited from class one.world.core.Component |
declareExported, declareImported, equals, eventHandlers, getDescriptor, getEnvironment, getLinkedHandlers, getLinkedNumber, getTimer, hasEventHandler, hashCode, isFullyLinked, isLinked, isSealed, link, link, run, seal, unbox, undeclare, unlink, wrap |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected final EventHandler updateHandler
protected final EventHandler syncRequestHandler
protected int count
protected String host
protected int port
protected String name
protected Timer.Notification countUpdate
protected transient RemoteReference syncReference
protected transient LeaseMaintainer leaseMaintainer
| Constructor Detail |
public RemoteCounter(Environment env)
RemoteCounter.env - The environment for the new instance.| Method Detail |
public void acquire()
acquire in class Applicationpublic void release()
release in class Applicationpublic void setUpdateTimer()
public void cancelUpdateTimer()
public Application.Window createMainWindow()
createMainWindow in class Applicationone.gui.Applicationnull
if the application does not have a main window.public void setCount(int newCount)
count - The new count value.
public void setRemoteCounter(String host,
int port,
String name)
host, port, and name fields.host - The new remote host name.port - The new remote port number.name - The new remote counter name.public void synchronize()
host, port, and name fields.
public static void init(Environment env,
Object closure)
env - The environment.closure - The closure.IllegalArgumentException - Signals that the closure is not a string array
or a string array with illegal arguments.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||