one.toys
Class RemoteSender
java.lang.Object
|
+--one.world.core.Component
|
+--one.toys.RemoteSender
- All Implemented Interfaces:
- Serializable
- public final class RemoteSender
- extends Component
Sends a remote event to a receiver every DELAY ms.
Usage:
RemoteSender [name] [hostname] [port]
The name is the name of the event handler to send to. If no name is
specified, "receiver" will be used. A hostname and
port may optionally be specified. If no hostname is specified, the event
will be routed through discovery rather than to a particular host.
Imported and Exported Event Handlers
Exported event handlers:
- main
- Handles environment events.
Imported event handlers:
- request
- The environment's request handler.
- Version:
- $Revision: 1.4 $
- See Also:
RemoteReceiver,
one.world.rep, Serialized Form
|
Field Summary |
protected static int |
DELAY
The delay between sending remote events (1000 ms). |
| 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 |
DELAY
protected static final int DELAY
- The delay between sending remote events (1000 ms).
RemoteSender
public RemoteSender(Environment env,
SymbolicHandler resource)
- Creates a new remote event sender.
- Parameters:
env - The environment for the new instance.resource - The remote resource to send events to.
getDescriptor
public ComponentDescriptor getDescriptor()
- Get the component descriptor.
- Overrides:
getDescriptor in class Component
- Following copied from class:
one.world.core.Component
- Returns:
- The component descriptor for this component.
init
public static void init(Environment env,
Object closure)
- Initialize the event sender. The closure must be a string array
that specifies
- The remote event receiver name (default is "receiver")
- The remote host name (discovery is used if no hostname is
provided)
- The remote port (default is
Constants.REP_PORT)
- Parameters:
env - The environment to run in.closure - The closure.- Throws:
IllegalArgumentException - Signals that the closure is not a string array or
that the port is not an integer.
(C) Copyright 2001 UW CSE