Payload - the generic type for the generated message's payloadA - the generic type for the generated message's attributespublic abstract class Source<Payload,A extends org.mule.runtime.api.message.Attributes> extends Object
SourceModel.
This class acts as an adapter between the extensions API representation of a message source and Mule's actual MessageSource concept.
The source is configured through a SourceContext which is set using the
setSourceContext(SourceContext) method. Implementations can access
the set value through the sourceContext field.
This class relies on generics to specify the payload and attribute types that the source
is going to generate. Although the java compiler does allow for raw uses of the class,
this API forbids that since those generics are needed for metadata purposes. For the case
of Sources which don't generate a response, the Payload is to be assigned to
Void.
| Modifier and Type | Field and Description |
|---|---|
protected SourceContext<Payload,A> |
sourceContext
The configured
SourceContext. |
| Constructor and Description |
|---|
Source() |
| Modifier and Type | Method and Description |
|---|---|
void |
setSourceContext(SourceContext<Payload,A> sourceContext)
Configures
this instances with sourceContext. |
abstract void |
start() |
abstract void |
stop() |
protected SourceContext<Payload,A extends org.mule.runtime.api.message.Attributes> sourceContext
SourceContext. The platform is to have set
this through the setSourceContext(SourceContext) method
before start() is to be invokedpublic void setSourceContext(SourceContext<Payload,A> sourceContext)
this instances with sourceContext.
This method should only be used by the runtime, which also
guarantees to have used it before start() is invokedsourceContext - a SourceContextCopyright © 2016 MuleSoft, Inc.. All rights reserved.