01: package com.bm.ejb3metadata.annotations.impl;
02:
03: import java.util.ArrayList;
04: import java.util.List;
05:
06: import javax.ejb.ActivationConfigProperty;
07:
08: /**
09: * 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 @{@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(
37: final ActivationConfigProperty activationConfigProperty) {
38: activationConfigProperties.add(activationConfigProperty);
39: }
40:
41: /**
42: * Gets the activation config properties.
43: * @return the list of activation config properties
44: */
45: public List<ActivationConfigProperty> getActivationConfigProperties() {
46: return activationConfigProperties;
47: }
48:
49: /**
50: * @return message listener interface.
51: */
52: public String getMessageListenerInterface() {
53: return messageListenerInterface;
54: }
55:
56: /**
57: * Sets the message listener interface.
58: * @param messageListenerInterface the given interface.
59: */
60: public void setMessageListenerInterface(
61: final String messageListenerInterface) {
62: this .messageListenerInterface = messageListenerInterface;
63: }
64:
65: /**
66: * @return string representation
67: */
68: @Override
69: public String toString() {
70: StringBuilder sb = new StringBuilder();
71: // classname
72: sb.append(this .getClass().getName().substring(
73: this .getClass().getPackage().getName().length() + 1));
74:
75: sb.append(super .toString());
76:
77: // messageListenerInterface
78: sb.append("[messageListenerInterface=");
79: sb.append(messageListenerInterface);
80:
81: // property value
82: sb.append(", activationConfigProperties=");
83: sb.append(activationConfigProperties);
84:
85: sb.append("]");
86: return sb.toString();
87: }
88: }
|