Errai 3.0.1-SNAPSHOT

org.jboss.errai.bus.client.api.builder
Interface MessageBuildParms<R>

All Superinterfaces:
MessageBuild, Sendable
All Known Subinterfaces:
MessageBuildCommand<R>

public interface MessageBuildParms<R>
extends MessageBuild

A template for building the different parameters of a message. This ensures that they are constructed properly.

Part of the fluent API centered around MessageBuilder.


Method Summary
 MessageBuildParms<R> copy(Enum<?> part, Message m)
          Copies a message part to the specified message, replacing that part in the target message if it already exists.
 MessageBuildParms<R> copy(String part, Message m)
          Copies the message part to the specified message
 MessageBuildParms<R> copyResource(String part, Message m)
          Copies a message resource to the specified message, replacing that resource in the target message if it already exists.
 R defaultErrorHandling()
          Specifies that the default error handler should be notified when there are errors in transmitting this builder's message (see DefaultErrorCallback).
 R done()
          No-op method for returning the underlying message being built.
 R errorsHandledBy(ErrorCallback callback)
          Sets the error callback function for the message.
 MessageBuildParms<R> flag(RoutingFlag flag)
          Sets a RoutingFlag on the underlying message.
 R noErrorHandling()
          Specifies that any errors encountered while handling or transmitting this builder's message should be silently ignored.
 MessageBuildParms<R> with(Enum<?> part, Object value)
          Sets the message part to the specified value, replacing any old value associated with that part.
 MessageBuildParms<R> with(String part, Object value)
          Sets the message part to the specified value, replacing any old value associated with that part.
 MessageBuildParms<R> withProvided(Enum<?> part, ResourceProvider<?> provider)
          Sets the message part to be generated at message transmission time by the given provider, replacing any old value associated with that part.
 MessageBuildParms<R> withProvided(String part, ResourceProvider<?> provider)
          Sets the message part to be generated at message transmission time by the given provider, replacing any old value associated with that part.
 MessageBuildParms<R> withValue(Object value)
          Include a default value with the message.
 
Methods inherited from interface org.jboss.errai.bus.client.api.builder.MessageBuild
getMessage
 

Method Detail

withValue

MessageBuildParms<R> withValue(Object value)
Include a default value with the message. This is the same as with(MessageParts.Value, value). This offers a convenience method for sending messages which contain a single object payload.

Parameters:
value -
Returns:
the updated MessageBuildParms for chaining additional calls

with

MessageBuildParms<R> with(String part,
                          Object value)
Sets the message part to the specified value, replacing any old value associated with that part.

Parameters:
part - the message part to add or replace
value - the value of the message part
Returns:
the updated MessageBuildParms for chaining additional calls

flag

MessageBuildParms<R> flag(RoutingFlag flag)
Sets a RoutingFlag on the underlying message.

Parameters:
flag - the RoutingFlag to set
Returns:
the updated MessageBuildParms for chaining additional calls

with

MessageBuildParms<R> with(Enum<?> part,
                          Object value)
Sets the message part to the specified value, replacing any old value associated with that part.

Parameters:
part - the message part to add or replace
value - the value of the message part
Returns:
the updated MessageBuildParms for chaining additional calls

withProvided

MessageBuildParms<R> withProvided(String part,
                                  ResourceProvider<?> provider)
Sets the message part to be generated at message transmission time by the given provider, replacing any old value associated with that part.

Parameters:
part - the message part to add or replace
provider - the provider that generates the value for this message part each time the message is transmitted.
Returns:
the updated MessageBuildParms for chaining additional calls

withProvided

MessageBuildParms<R> withProvided(Enum<?> part,
                                  ResourceProvider<?> provider)
Sets the message part to be generated at message transmission time by the given provider, replacing any old value associated with that part.

Parameters:
part - the message part to add or replace
provider - the provider that generates the value for this message part each time the message is transmitted.
Returns:
the updated MessageBuildParms for chaining additional calls

copy

MessageBuildParms<R> copy(String part,
                          Message m)
Copies the message part to the specified message

Parameters:
part - the message part
m - the target message to receive the copied part.
Returns:
the updated MessageBuildParms for chaining additional calls

copy

MessageBuildParms<R> copy(Enum<?> part,
                          Message m)
Copies a message part to the specified message, replacing that part in the target message if it already exists.

Parameters:
part - the message part to copy from this builder's message.
m - the target message to receive the copied part.
Returns:
the updated MessageBuildParms for chaining additional calls

copyResource

MessageBuildParms<R> copyResource(String part,
                                  Message m)
Copies a message resource to the specified message, replacing that resource in the target message if it already exists.

Parameters:
part - the message resource to copy from this builder's message.
m - the target message to receive the copied resource.
Returns:
the updated MessageBuildParms for chaining additional calls

errorsHandledBy

R errorsHandledBy(ErrorCallback callback)
Sets the error callback function for the message.

Parameters:
callback - the function to be called when an error occurs.
Returns:
the underlying Sendable from this builder.

noErrorHandling

R noErrorHandling()
Specifies that any errors encountered while handling or transmitting this builder's message should be silently ignored.

Returns:
the underlying Sendable from this builder.

defaultErrorHandling

R defaultErrorHandling()
Specifies that the default error handler should be notified when there are errors in transmitting this builder's message (see DefaultErrorCallback).

Returns:
the underlying Sendable from this builder.

done

R done()
No-op method for returning the underlying message being built.

Returns:
the underlying Sendable from this builder.

Errai 3.0.1-SNAPSHOT

Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.