View Javadoc

1   package com.bm.ejb3metadata.annotations.impl;
2   
3   import java.util.ArrayList;
4   import java.util.List;
5   
6   import javax.ejb.ActivationConfigProperty;
7   
8   /**
9    * Acts as an implementation of @{@link javax.ejb.MessageDriven} annotation.
10   * @author Daniel Wiese
11   */
12  public class JMessageDriven extends JCommonBean {
13  
14      /**
15       * List of ActivationConfigProperty.
16       */
17      private List<ActivationConfigProperty> activationConfigProperties = null;
18  
19      /**
20       * Message listener Interface.
21       */
22      private String messageListenerInterface = null;
23  
24      /**
25       * Build an object which represents &#64;{@link javax.ejb.MessageDriven} object.
26       */
27      public JMessageDriven() {
28          super();
29          activationConfigProperties = new ArrayList<ActivationConfigProperty>();
30      }
31  
32      /**
33       * Adds an activation config property.
34       * @param activationConfigProperty object to add in the list
35       */
36      public void addActivationConfigProperty(final ActivationConfigProperty activationConfigProperty) {
37          activationConfigProperties.add(activationConfigProperty);
38      }
39  
40      /**
41       * Gets the activation config properties.
42       * @return the list of activation config properties
43       */
44      public List<ActivationConfigProperty> getActivationConfigProperties() {
45          return activationConfigProperties;
46      }
47  
48      /**
49       * @return message listener interface.
50       */
51      public String getMessageListenerInterface() {
52          return messageListenerInterface;
53      }
54  
55      /**
56       * Sets the message listener interface.
57       * @param messageListenerInterface the given interface.
58       */
59      public void setMessageListenerInterface(final String messageListenerInterface) {
60          this.messageListenerInterface = messageListenerInterface;
61      }
62  
63      /**
64       * @return string representation
65       */
66      @Override
67      public String toString() {
68          StringBuilder sb = new StringBuilder();
69          // classname
70          sb.append(this.getClass().getName().substring(this.getClass().getPackage().getName().length() + 1));
71  
72          sb.append(super.toString());
73  
74          // messageListenerInterface
75          sb.append("[messageListenerInterface=");
76          sb.append(messageListenerInterface);
77  
78          // property value
79          sb.append(", activationConfigProperties=");
80          sb.append(activationConfigProperties);
81  
82          sb.append("]");
83          return sb.toString();
84      }
85  }