Package AccessGrid :: Module SharedAppClient :: Class SharedAppClient
[show private | hide private]
[frames | no frames]

Class SharedAppClient


The SharedAppClient may be used when building shared applications. This class encapsulates a handler to the application service and the event service associated with the application. The SharedAppClient provides an interface to the Shared Application.
Method Summary
  __init__(self, appName)
Creates the client.
  GetApplicationID(self)
Access method for application service specific ID.
  GetApplicationState(self)
Access method for application state.
  GetComponents(self)
Access method for all instances connected to the application service.
  GetData(self, dataKey)
Get data from application service
  GetDataKeys(self)
Access method for data keys.
  GetParticipants(self)
Access method for participants.
  GetPublicId(self)
Access method for public ID.
  GetVenueURL(self)
Access method for venue URL where the application service is running.
  HandleEvent(self, event)
This method is called when an event is distributed in the application service.
  InitLogging(self, debug, log)
Returns the log file.
  Join(self, appServiceUrl, clientProfile)
Connect registers this client with the SharedApplication at specified URL.
  RegisterEventCallback(self, eventType, callback)
Register callback for event.
  SendEvent(self, eventType, data)
Post an event to all applications connected to the service.
  SetData(self, dataKey, dataValue)
Add data to application service.
  SetParticipantProfile(self, profile)
Set your profile.
  SetParticipantStatus(self, status)
Set your status.
  Shutdown(self)
Exit from application service and shut down event client.
  UpdateDataCache(self, dataKey)
Make sure we have the most recent value for a cached data key.
  __EventIsRegistered(self, eventType)
Check if event is registered locally in callback table.
  __ReceiveDataUpdate(self, event)
This method is called when data has been set in the application service.

Method Details

__init__(self, appName)
(Constructor)

Creates the client.

**Arguments**

*appName* The name of the application.

GetApplicationID(self)

Access method for application service specific ID.

**Returns**

*appId* ID associated with the application service we are connected to.

GetApplicationState(self)

Access method for application state.

**Returns**

*state* Application state.

GetComponents(self)

Access method for all instances connected to the application service.

**Returns**

*components* List of public IDs for each instance connected to the application service.

GetData(self, dataKey)

Get data from application service

**Arguments**

*dataKey* Unique id of data available in the service

**Returns**

*dataValue* The value associated with the specified dataKey

GetDataKeys(self)

Access method for data keys.

**Returns**

*keys* List of data keys.

GetParticipants(self)

Access method for participants.

**Returns**

*participants* List of AppParticipantDescriptions.

GetPublicId(self)

Access method for public ID.

**Returns**

*publicId* Id associated with this client.

GetVenueURL(self)

Access method for venue URL where the application service is running.

**Returns**

*url* URL to venue where the application service is running.

HandleEvent(self, event)

This method is called when an event is distributed in the application service. NOTE: Used internally.

InitLogging(self, debug=0, log=None)

Returns the log file.

**Arguments**

*debug* Not relevant. Note: Use WXGUIApplication.Initialize() in application main method instead.

*log* Not relevant. Note: Use WXGUIApplication.Initialize() in application main method instead.

Join(self, appServiceUrl, clientProfile=None)

Connect registers this client with the SharedApplication at specified URL. The registration gives access to the EventService used for data communication among applications connected to this service.

**Arguments**

*appServiceUrl* location of application service.

RegisterEventCallback(self, eventType, callback)

Register callback for event. Several callbacks can be registered for each event.

**Arguments**

*eventType* Event to listen for.

*callback* Method called when receiving event of type eventType.

SendEvent(self, eventType, data)

Post an event to all applications connected to the service.

Note: This client will receive its own events.

**Arguments**

*eventType* Event to send

*data* Data associated with this event

SetData(self, dataKey, dataValue)

Add data to application service.

Note: If data with same dataKey is already present in the application service, the old dataValue will be overwritten.

**Arguments**

*dataKey* Unique id for this data

*dataValue* The actual data

SetParticipantProfile(self, profile)

Set your profile.

**Arguments**

*profile* Your ClientProfile.

SetParticipantStatus(self, status)

Set your status.

**Arguments**

*status* Status string

Shutdown(self)

Exit from application service and shut down event client.

UpdateDataCache(self, dataKey=None)

Make sure we have the most recent value for a cached data key.

**Arguments**

*dataKey* Unique id of data available in the service. If dataKey is None, update the entire cache.

__EventIsRegistered(self, eventType)

Check if event is registered locally in callback table.

__ReceiveDataUpdate(self, event)

This method is called when data has been set in the application service.

**Arguments**

*event* Received event.

Generated by Epydoc 2.1 on Thu Apr 14 16:39:28 2005 http://epydoc.sf.net