context.apps.Tour
Class TourApp
java.lang.Object
|
+--context.apps.Tour.TourApp
- public class TourApp
- extends java.lang.Object
- implements Handler
This class is an application that uses a WTourDemo, WTourEnd, and WTourRegistration.
It is a very simple context-aware tour guide that collects information about the user
displays information about the demo the user is in front of, and then when the user
is ready to leave, it emails a list of the demos (and corresponding information) that
the user visited. Also, for each demo, the application lists a number of other demos
that are related.
- See Also:
Handler
,
WTourEnd
,
WTourDemo
,
WTourRegistration
Field Summary |
static int |
DEFAULT_PORT
Default port to start the BaseObject on is 5555 |
static java.lang.String |
NO_INTEREST
|
static java.lang.String |
SUBSCRIBER_ID
Subscription ID for callbacks |
Constructor Summary |
TourApp(int localport,
java.lang.String userid,
java.lang.String configFile,
java.lang.String demoFile)
Constructor that creates an instance of BaseObject at the DEFAULT_PORT. |
TourApp(java.lang.String userid,
java.lang.String configFile,
java.lang.String demoFile)
Constructor that creates an instance of BaseObject at the DEFAULT_PORT. |
Method Summary |
DataObject |
handle(java.lang.String callback,
DataObject data)
This method is required to implement the Handler interface. |
static void |
main(java.lang.String[] argv)
Main method that creates an instance of TourApp |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
DEFAULT_PORT
public static final int DEFAULT_PORT
- Default port to start the BaseObject on is 5555
SUBSCRIBER_ID
public static final java.lang.String SUBSCRIBER_ID
- Subscription ID for callbacks
NO_INTEREST
public static final java.lang.String NO_INTEREST
TourApp
public TourApp(java.lang.String userid,
java.lang.String configFile,
java.lang.String demoFile)
- Constructor that creates an instance of BaseObject at the DEFAULT_PORT. It
subscribes to the various demo widgets.
- Parameters:
userid
- Id of the userconfigFile
- Configuration file containing widget informationdemoFile
- File containing information about each demo- See Also:
BaseObject
,
BaseObject.subscribeTo(context.arch.handler.Handler, int, java.lang.String,
java.lang.String, int, java.lang.String, java.lang.String, java.lang.String)
TourApp
public TourApp(int localport,
java.lang.String userid,
java.lang.String configFile,
java.lang.String demoFile)
- Constructor that creates an instance of BaseObject at the DEFAULT_PORT. It
subscribes to the various demo widgets.
- Parameters:
localport
- Port the app is running onuserid
- Id of the userconfigFile
- Configuration file containing widget informationdemoFile
- File containing information about each demo- See Also:
BaseObject
,
BaseObject.subscribeTo(context.arch.handler.Handler, int, java.lang.String,
java.lang.String, int, java.lang.String, java.lang.String, java.lang.String)
handle
public DataObject handle(java.lang.String callback,
DataObject data)
throws InvalidMethodException,
MethodException
- This method is required to implement the Handler interface. It is called when
the callbacks this object subscribes to are triggered.
- Specified by:
- handle in interface Handler
- Parameters:
callback
- Name of the callback to handledata
- DataObject containing the callback event data- Throws:
- InvalidMethodException - if the callback specified isn't recognized
- MethodException - if the callback specified can't be handled successfully
- See Also:
Handler
main
public static void main(java.lang.String[] argv)
- Main method that creates an instance of TourApp