queued.sdk.java.examples
Class SimpleService

java.lang.Object
  extended byqueued.sdk.java.examples.SimpleService
Direct Known Subclasses:
SimpleMonitorQueue

public class SimpleService
extends java.lang.Object

Monitors connection services. This example uses a GUI application to show how to monitor services:

PLEASE NOTE: This code example will not work unless you edit the configuration data in OpenMediaSdk.properties so that it matches objects that already exist in your local Configuration Layer.

There are several steps needed to prepare an application to use the services of the Queued Interaction Java API. This example uses the services of other classes to carry out these functions:


Constructor Summary
SimpleService(java.lang.String windowTitle)
          Creates an instance of SimpleService.
 
Method Summary
 void handleServiceEvent(ServiceEvent event)
          Receives ServiceEvent events, which report changes in a connection service.
 void linkWidgetsToGui()
          Links QIL information to GUI components.
static void main(java.lang.String[] args)
           
 void setExampleType()
          Indicates which example is running.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleService

public SimpleService(java.lang.String windowTitle)
Creates an instance of SimpleService.

Parameters:
windowTitle - The title of the GUI window for this example.
Method Detail

linkWidgetsToGui

public void linkWidgetsToGui()
Links QIL information to GUI components. The OpenMediaSdkGui class creates a single graphical user interface that is used by each of the Queued Interaction Java code examples. This GUI contains all of the widgets used by the examples, but they are only placeholders. That is, they have no functionality when they are created in the GUI class.

When an example is run, the linkWidgetsToGui() method is used to associate these widgets with the appropriate fields in the example class, and to fill-in tables.

sdkGui.setService(srv.getType().toString(), srv.getStatus().toString());


setExampleType

public void setExampleType()
Indicates which example is running. The OpenMediaSdkGui class creates a single graphical user interface that is used by each of Open Media SDK Java Library code examples. This GUI contains all of the widgets used by the examples -- but the class should enable only the widgets used by a particular example.

This method tells the OpenMediaSdkGui class which example has called the GUI, so that it can determine which widgets will be enabled when the GUI is created.


main

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

handleServiceEvent

public void handleServiceEvent(ServiceEvent event)
Receives ServiceEvent events, which report changes in a connection service. If you implement the ServiceListener interface, you must implement this method.

The SimpleService example uses this method to update the Service table that lists available services, and to log these ServiceEvents as they occur. Event processing is performed in a dedicated ServiceEventThread thread class.