public class

UserStreamMessageSource

extends Object
implements Runnable SourceCallback FlowConstructAware MuleContextAware Initialisable Startable Stoppable MessageSource
java.lang.Object
   ↳ org.mule.twitter.config.UserStreamMessageSource

Class Overview

UserStreamMessageSource wraps userStream(java.util.List, org.mule.api.callback.SourceCallback) method in TwitterConnector as a message source capable of generating Mule events. The POJO's method is invoked in its own thread.

Summary

[Expand]
Inherited Constants
From interface org.mule.api.lifecycle.Initialisable
From interface org.mule.api.lifecycle.Startable
From interface org.mule.api.lifecycle.Stoppable
Fields
private List<String> _keywordsType
private FlowConstruct flowConstruct Flow construct
private Object keywords
private MessageProcessor messageProcessor Message processor that will get called for processing incoming events
private TwitterConnectorLifecycleAdapter moduleObject Module object
private MuleContext muleContext Mule Context
private Thread thread Thread under which this message source will execute
Public Constructors
UserStreamMessageSource()
Public Methods
void initialise()
Obtains the expression manager from the Mule context and initialises the connector.
Object process(Object message, Map<String, Object> properties)
Implements SourceCallback#process(org.mule.api.MuleEvent).
Object process(Object message)
Implements SourceCallback#process(org.mule.api.MuleEvent).
void run()
Implementation run() that will invoke the method on the pojo that this message source wraps.
void setFlowConstruct(FlowConstruct flowConstruct)
Sets flow construct
void setKeywords(Object value)
Sets keywords
void setListener(MessageProcessor listener)
Sets the message processor that will "listen" the events generated by this message source
void setModuleObject(TwitterConnectorLifecycleAdapter moduleObject)
Sets the instance of the object under which the processor will execute
void setMuleContext(MuleContext context)
Set the Mule context
void start()
Method to be called when Mule instance gets started.
void stop()
Method to be called when Mule instance gets stopped.
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.lang.Runnable
From interface org.mule.api.callback.SourceCallback
From interface org.mule.api.construct.FlowConstructAware
From interface org.mule.api.context.MuleContextAware
From interface org.mule.api.lifecycle.Initialisable
From interface org.mule.api.lifecycle.Startable
From interface org.mule.api.lifecycle.Stoppable
From interface org.mule.api.source.MessageSource

Fields

private List<String> _keywordsType

private FlowConstruct flowConstruct

Flow construct

private Object keywords

private MessageProcessor messageProcessor

Message processor that will get called for processing incoming events

private TwitterConnectorLifecycleAdapter moduleObject

Module object

private MuleContext muleContext

Mule Context

private Thread thread

Thread under which this message source will execute

Public Constructors

public UserStreamMessageSource ()

Public Methods

public void initialise ()

Obtains the expression manager from the Mule context and initialises the connector. If a target object has not been set already it will search the Mule registry for a default one.

Throws
InitialisationException

public Object process (Object message, Map<String, Object> properties)

Implements SourceCallback#process(org.mule.api.MuleEvent). This message source will be passed on to the actual pojo's method as a callback mechanism.

Parameters
message
properties

public Object process (Object message)

Implements SourceCallback#process(org.mule.api.MuleEvent). This message source will be passed on to the actual pojo's method as a callback mechanism.

Parameters
message

public void run ()

Implementation run() that will invoke the method on the pojo that this message source wraps.

public void setFlowConstruct (FlowConstruct flowConstruct)

Sets flow construct

Parameters
flowConstruct Flow construct to set

public void setKeywords (Object value)

Sets keywords

Parameters
value Value to set

public void setListener (MessageProcessor listener)

Sets the message processor that will "listen" the events generated by this message source

Parameters
listener Message processor

public void setModuleObject (TwitterConnectorLifecycleAdapter moduleObject)

Sets the instance of the object under which the processor will execute

Parameters
moduleObject Instace of the module

public void setMuleContext (MuleContext context)

Set the Mule context

Parameters
context Mule context to set

public void start ()

Method to be called when Mule instance gets started.

Throws
MuleException

public void stop ()

Method to be called when Mule instance gets stopped.

Throws
MuleException