001: /**
002: * EasyBeans
003: * Copyright (C) 2006 Bull S.A.S.
004: * Contact: easybeans@ow2.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * --------------------------------------------------------------------------
022: * $Id: JMessageDriven.java 1970 2007-10-16 11:49:25Z benoitf $
023: * --------------------------------------------------------------------------
024: */package org.ow2.easybeans.deployment.annotations.impl;
025:
026: import java.util.ArrayList;
027: import java.util.List;
028:
029: import javax.ejb.ActivationConfigProperty;
030:
031: /**
032: * Acts as an implementation of @{@link javax.ejb.MessageDriven} annotation.
033: * @author Florent Benoit
034: */
035: public class JMessageDriven extends JCommonBean {
036:
037: /**
038: * List of ActivationConfigProperty.
039: */
040: private List<ActivationConfigProperty> activationConfigProperties = null;
041:
042: /**
043: * Message listener Interface.
044: */
045: private String messageListenerInterface = null;
046:
047: /**
048: * Build an object which represents @{@link javax.ejb.MessageDriven} object.
049: */
050: public JMessageDriven() {
051: super ();
052: activationConfigProperties = new ArrayList<ActivationConfigProperty>();
053: }
054:
055: /**
056: * Adds an activation config property.
057: * @param activationConfigProperty object to add in the list
058: */
059: public void addActivationConfigProperty(
060: final ActivationConfigProperty activationConfigProperty) {
061: activationConfigProperties.add(activationConfigProperty);
062: }
063:
064: /**
065: * Gets the activation config properties.
066: * @return the list of activation config properties
067: */
068: public List<ActivationConfigProperty> getActivationConfigProperties() {
069: return activationConfigProperties;
070: }
071:
072: /**
073: * @return message listener interface.
074: */
075: public String getMessageListenerInterface() {
076: return messageListenerInterface;
077: }
078:
079: /**
080: * Sets the message listener interface.
081: * @param messageListenerInterface the given interface.
082: */
083: public void setMessageListenerInterface(
084: final String messageListenerInterface) {
085: this .messageListenerInterface = messageListenerInterface;
086: }
087:
088: /**
089: * @return string representation
090: */
091: @Override
092: public String toString() {
093: StringBuilder sb = new StringBuilder();
094: // classname
095: sb.append(this .getClass().getName().substring(
096: this .getClass().getPackage().getName().length() + 1));
097:
098: sb.append(super .toString());
099:
100: // messageListenerInterface
101: sb.append("[messageListenerInterface=");
102: sb.append(messageListenerInterface);
103:
104: // property value
105: sb.append(", activationConfigProperties=");
106: sb.append(activationConfigProperties);
107:
108: sb.append("]");
109: return sb.toString();
110: }
111: }
|