Errai 3.0.1-SNAPSHOT

org.jboss.errai.bus.server.annotations
Annotation Type Command


@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface Command

Indicates that the annotated method, which is part of a service class, implements a command callback of that service.

Example:

     @Service("TestSvc")
     public class ServiceWithMultipleEndpoints {

       @Command("foo")
       public void foo(Message message) {
         ...
       }

       @Command("bar")
       public void bar(Message message) {
         ...
       }
     }
 

To compose a message with a command, specify a command in the MessageBuilder like this:

     MessageBuilder.createMessage()
             .toSubject("TestSvc")
             .command("bar")
             .done()
             .repliesTo(new MessageCallback() { ... })
             .sendNowWith(bus);
 

See Also:
Service, MessageBuilder

Optional Element Summary
 String[] value
          The command names that this method handles within the service.
 

value

public abstract String[] value
The command names that this method handles within the service. Defaults to the name of the method.

Default:
""

Errai 3.0.1-SNAPSHOT

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