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

Class EventService


The EventService provides a secure event layer. This might be more scalable as a secure RTP or other UDP solution, but for now we use TCP. In the TCP case the EventService is the Server, GSI is our secure version.


Method Summary
  __init__(self, server_address)
  AddChannel(self, channelId, authCallback)
This adds a new channel to the Event Service.
  CloseConnection(self, connObj)
  Distribute(self, channelId, data)
  EnqueueEOF(self, conn)
  EnqueueEvent(self, event, conn)
  EnqueueQuit(self)
  findConnectionChannel(self, id)
  GetChannel(self, id)
  GetLocation(self)
GetLocation returns the (host,port) for this service.
  HandleEOF(self, connObj)
Handle an EOF on a connection.
  HandleEvent(self, event, connObj)
Handle an incoming event.
  HandleEventForDisconnectedChannel(self, event, connObj)
We've received an event for a connection which hasn't yet been connected to a channel.
  listenCallback(self, arg, handle, result)
  RecvHandler(self)
Thread main routine for event queue handling.
  RegisterCallback(self, channelId, eventType, callback)
  RegisterChannelCallback(self, channelId, callback)
Register a callback for all events on this channel.
  registerForListen(self)
  RegisterObject(self, channel, object)
RegisterObject is short hand for registering multiple callbacks on the same object.
  RemoveChannel(self, channelId)
This removes a channel from the Event Service.
  SendHandler(self)
  start(self)
Start.
  Stop(self)
Stop the event service.

Method Details

AddChannel(self, channelId, authCallback=None)

This adds a new channel to the Event Service.

GetLocation(self)

GetLocation returns the (host,port) for this service.

HandleEOF(self, connObj)

Handle an EOF on a connection.

If this connection doesn't yet have a channel assignment, we can just delete it from our list of all channels.

If it does have a channel assignment, remove from there then delete from all-channels.

HandleEvent(self, event, connObj)

Handle an incoming event.

This is executed in the message handling thread after an event has been received by the async reader.

Exactly what happens with this event depends on whether the connection object has been connected to a channel or not.

If it has not, the only events that will be processed are Connect and Disconnect.

If it has, the event is passed along to the EventChannel for processing.

HandleEventForDisconnectedChannel(self, event, connObj)

We've received an event for a connection which hasn't yet been connected to a channel.

Pass the event to the channel to allow it to decide whether to allow the connection or not. If it allows it, add the connection to the channel. If not, close the channel.

RecvHandler(self)

Thread main routine for event queue handling.

RegisterChannelCallback(self, channelId, callback)

Register a callback for all events on this channel.

RegisterObject(self, channel, object)

RegisterObject is short hand for registering multiple callbacks on the same object. The object being registered has to define a table named callbacks that has event types as keys, and self.methods as values. Then these are automatically registered.

RemoveChannel(self, channelId)

This removes a channel from the Event Service.

start(self)

Start. Initialize the asynch io on accept.

Stop(self)

Stop the event service.

Close our listener socket and all the active connections; this should clear out any lingering state.


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