Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## context.apps.PersonPresenceApp
Class SimpleApp

    java.lang.Object
      |
      +--context.apps.PersonPresenceApp.SimpleApp

public class SimpleApp
extends java.lang.Object
implements Handler

This class is a test application that uses the WPersonNamePresence2. It contains code that tests subscribing to the widget.

See Also:
  `Handler`, `WPersonNamePresence2`

Field Summary
`static int` | `DEFAULT_PORT` Default port to start the BaseObject on is 5555
`static java.lang.String` | `SUBSCRIBER_ID` Subscription ID for WPersonNamePresence2 UPDATE callback

Constructor Summary
`SimpleApp(java.lang.String location, int localport, java.lang.String ppwHost, int ppwPort)` Constructor that creates an instance of BaseObject at the given 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 SimpleApp

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### 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 WPersonNamePresence2 UPDATE callback

Constructor Detail

### SimpleApp

    public SimpleApp(java.lang.String location,
                     int localport,
                     java.lang.String ppwHost,
                     int ppwPort)

  Constructor that creates an instance of BaseObject at the given port. It subscribes to the WPersonNamePresence2 and prints out callback info and polls the widget and prints out the results.
  Parameters:
    `localport` - Port the app is running on
    `ppwHost` - Hostname the widget is running on
    `ppwPort` - Port the widget is running on
  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)`, `WPersonNamePresence2`

Method Detail

### 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. In this case, it is called when a button is pressed in the WPersonNamePresence2 GUI.
  Specified by:
    handle in interface Handler
  Parameters:
    `callback` - Name of the callback to handle
    `data` - 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`, `WPersonNamePresence2`

### main

    public static void main(java.lang.String[] argv)

  Main method that creates an instance of SimpleApp

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD