Packagecom.pushtechnology.diffusion
Classpublic class TopicListener
InheritanceTopicListener Inheritance Object

Listener for topic messages.

Topic message listeners are constructed by the Diffusion client, using the DiffusionClient#addTopicListener(RegExp,Function,Object) method.

They are a tuple of the topic name pattern, a pointer to the callback function, the callback context and the topic handle. The topic handle is a number assigned by the Diffusion client. The topic name pattern is a regular expression used to match topic names of messages, if a message's topic name matches the pattern the callback will be made. The callback function pointer is used to make the callback, the context is optional and will be passed to the function pointer when it is called. The function pointer should accept a single TopicMessage object.



Public Methods
 MethodDefined By
  
TopicListener(pattern:RegExp, fp:Function, handle:int, thisContext:Object)
TopicListener
  
getFunction():Function
Get the callback function pointer for the topic listener.
TopicListener
  
getHandle():int
Get the handle for the topic listener.
TopicListener
  
getRegex():RegExp
Get the regular expression for the topic listener.
TopicListener
  
Get the callback context for the topic listener.
TopicListener
Constructor Detail
TopicListener()Constructor
public function TopicListener(pattern:RegExp, fp:Function, handle:int, thisContext:Object)



Parameters
pattern:RegExp
 
fp:Function
 
handle:int
 
thisContext:Object
Method Detail
getFunction()method
public function getFunction():Function

Get the callback function pointer for the topic listener.

Returns
Function
getHandle()method 
public function getHandle():int

Get the handle for the topic listener.

Returns
int
getRegex()method 
public function getRegex():RegExp

Get the regular expression for the topic listener.

Returns
RegExp
getThisContext()method 
public function getThisContext():Object

Get the callback context for the topic listener.

Returns
Object