Annotation Interface ForJmsType


@Retention(RUNTIME) @Target(TYPE) public @interface ForJmsType
Indicates that the class defines methods that should be invoked on a message by matching on message's JMS type, i.e., Message.getJMSType().

The method that is to be invoked is determined by the following lookup process:

  • Only public methods declared directly on the class are considered. No inherited.
  • a method annotated by Invoking. Or...
  • a method named 'invoke'.
The signature and the declaration order are not considered. The first found is accepted. If no method is found, it's an exception.

If the incoming's Message.getJMSReplyTo() is specified and the invocation is successful, a reply message will be sent to the destination. The message will have:

  • the same type
  • the same correlation id
  • the return value as body. null if the method has no return.
Since:
1.0
Author:
Lei Yang
See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Not implemented.
    Specifies how to instantiate an instance of the class.
    Specifies the message types for which a method of the class should be invoked.
  • Element Details

    • value

      String[] value
      Specifies the message types for which a method of the class should be invoked.

      The matching is done via String.matches(String) where the this object is from Message.getJMSType() and the argument is the value specified here which could be a regular expression.

      When multiple values are specified, the matching follows the declaration order. Any single value could trigger invocation. I.e., multiple expressions are considered logical ||.

      If no value is specified, the class' simple name, i.e., Class.getSimpleName(), is used as the default.

      The type matching is done without a defined order. Overlapping expressions from multiple ForJmsType's might result in un-deterministic behavior.

      Default:
      {}
    • scope

      Specifies how to instantiate an instance of the class.
      See Also:
      Default:
      MESSAGE
    • invocation

      InvocationModel invocation
      Not implemented.
      Default:
      DEFAULT