All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.openejb.jee.MessageDrivenBean Maven / Gradle / Ivy

The newest version!
/**
 *
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

package org.apache.openejb.jee;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlID;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;


/**
 * ejb-jar_3_1.xsd
 * 

*

Java class for message-driven-beanType complex type. *

*

The following schema fragment specifies the expected content contained within this class. *

*

 * <complexType name="message-driven-beanType">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <group ref="{http://java.sun.com/xml/ns/javaee}descriptionGroup"/>
 *         <element name="ejb-name" type="{http://java.sun.com/xml/ns/javaee}ejb-nameType"/>
 *         <element name="mapped-name" type="{http://java.sun.com/xml/ns/javaee}xsdStringType" minOccurs="0"/>
 *         <element name="ejb-class" type="{http://java.sun.com/xml/ns/javaee}ejb-classType" minOccurs="0"/>
 *         <element name="messaging-type" type="{http://java.sun.com/xml/ns/javaee}fully-qualified-classType" minOccurs="0"/>
 *         <element name="timeout-method" type="{http://java.sun.com/xml/ns/javaee}named-methodType" minOccurs="0"/>
 *         <element name="timer" type="{http://java.sun.com/xml/ns/javaee}timerType" maxOccurs="unbounded" minOccurs="0"/>
 *         <element name="transaction-type" type="{http://java.sun.com/xml/ns/javaee}transaction-typeType" minOccurs="0"/>
 *         <element name="message-destination-type" type="{http://java.sun.com/xml/ns/javaee}message-destination-typeType" minOccurs="0"/>
 *         <element name="message-destination-link" type="{http://java.sun.com/xml/ns/javaee}message-destination-linkType" minOccurs="0"/>
 *         <element name="activation-config" type="{http://java.sun.com/xml/ns/javaee}activation-configType" minOccurs="0"/>
 *         <element name="around-invoke" type="{http://java.sun.com/xml/ns/javaee}around-invokeType" maxOccurs="unbounded" minOccurs="0"/>
 *         <element name="around-timeout" type="{http://java.sun.com/xml/ns/javaee}around-timeoutType" maxOccurs="unbounded" minOccurs="0"/>
 *         <group ref="{http://java.sun.com/xml/ns/javaee}jndiEnvironmentRefsGroup"/>
 *         <element name="security-role-ref" type="{http://java.sun.com/xml/ns/javaee}security-role-refType" maxOccurs="unbounded" minOccurs="0"/>
 *         <element name="security-identity" type="{http://java.sun.com/xml/ns/javaee}security-identityType" minOccurs="0"/>
 *       </sequence>
 *       <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />
 *     </restriction>
 *   </complexContent>
 * </complexType>
 * 
*/ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "message-driven-beanType", propOrder = { "descriptions", "displayNames", "icon", "ejbName", "mappedName", "ejbClass", "messagingType", "timeoutMethod", "timer", "transactionType", "messageSelector", "acknowledgeMode", "messageDrivenDestination", "messageDestinationType", "messageDestinationLink", "activationConfig", "aroundInvoke", "aroundTimeout", "envEntry", "ejbRef", "ejbLocalRef", "serviceRef", "resourceRef", "resourceEnvRef", "messageDestinationRef", "persistenceContextRef", "persistenceUnitRef", "postConstruct", "preDestroy", "dataSource", "securityRoleRef", "securityIdentity" }) public class MessageDrivenBean implements EnterpriseBean, TimerConsumer, Invokable { @XmlTransient protected TextMap description = new TextMap(); @XmlTransient protected TextMap displayName = new TextMap(); @XmlElement(name = "icon", required = true) protected LocalCollection icon = new LocalCollection(); @XmlElement(name = "ejb-name", required = true) protected String ejbName; @XmlElement(name = "mapped-name") protected String mappedName; @XmlElement(name = "ejb-class") protected String ejbClass; @XmlElement(name = "messaging-type") protected String messagingType; @XmlElement(name = "timeout-method") protected NamedMethod timeoutMethod; protected List timer; @XmlElement(name = "transaction-type") protected TransactionType transactionType; @XmlElement(name = "message-destination-type") protected String messageDestinationType; @XmlElement(name = "message-destination-link") protected String messageDestinationLink; @XmlElement(name = "activation-config") protected ActivationConfig activationConfig; @XmlElement(name = "around-invoke", required = true) protected List aroundInvoke; @XmlElement(name = "around-timeout") protected List aroundTimeout; @XmlElement(name = "env-entry", required = true) protected KeyedCollection envEntry; @XmlElement(name = "ejb-ref", required = true) protected KeyedCollection ejbRef; @XmlElement(name = "ejb-local-ref", required = true) protected KeyedCollection ejbLocalRef; @XmlElement(name = "service-ref", required = true) protected KeyedCollection serviceRef; @XmlElement(name = "resource-ref", required = true) protected KeyedCollection resourceRef; @XmlElement(name = "resource-env-ref", required = true) protected KeyedCollection resourceEnvRef; @XmlElement(name = "message-destination-ref", required = true) protected KeyedCollection messageDestinationRef; @XmlElement(name = "persistence-context-ref", required = true) protected KeyedCollection persistenceContextRef; @XmlElement(name = "persistence-unit-ref", required = true) protected KeyedCollection persistenceUnitRef; @XmlElement(name = "data-source", required = true) protected KeyedCollection dataSource; @XmlElement(name = "post-construct", required = true) protected List postConstruct; @XmlElement(name = "pre-destroy", required = true) protected List preDestroy; @XmlElement(name = "security-role-ref", required = true) protected List securityRoleRef; @XmlElement(name = "security-identity") protected SecurityIdentity securityIdentity; @XmlAttribute @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlID protected String id; public MessageDrivenBean() { } public MessageDrivenBean(final String ejbName) { this.ejbName = ejbName; } public MessageDrivenBean(final String ejbName, final String ejbClass) { this.ejbName = ejbName; this.ejbClass = ejbClass; } public MessageDrivenBean(final Class ejbClass) { this(ejbClass.getSimpleName(), ejbClass.getName()); } public MessageDrivenBean(final String ejbName, final Class ejbClass) { this(ejbName, ejbClass.getName()); } public String getJndiConsumerName() { return ejbName; } @XmlElement(name = "description", required = true) public Text[] getDescriptions() { return description.toArray(); } public void setDescriptions(final Text[] text) { description.set(text); } public String getDescription() { return description.get(); } @XmlElement(name = "display-name", required = true) public Text[] getDisplayNames() { return displayName.toArray(); } public void setDisplayNames(final Text[] text) { displayName.set(text); } public String getDisplayName() { return displayName.get(); } public Collection getIcons() { if (icon == null) { icon = new LocalCollection(); } return icon; } public Map getIconMap() { if (icon == null) { icon = new LocalCollection(); } return icon.toMap(); } public Icon getIcon() { return icon.getLocal(); } public String getEjbName() { return ejbName; } /** * The ejb-nameType specifies an enterprise bean's name. It is * used by ejb-name elements. This name is assigned by the * ejb-jar file producer to name the enterprise bean in the * ejb-jar file's deployment descriptor. The name must be * unique among the names of the enterprise beans in the same * ejb-jar file. *

* There is no architected relationship between the used * ejb-name in the deployment descriptor and the JNDI name that * the Deployer will assign to the enterprise bean's home. *

* The name for an entity bean must conform to the lexical * rules for an NMTOKEN. *

* Example: *

* EmployeeService */ public void setEjbName(final String value) { this.ejbName = value; } public String getMappedName() { return mappedName; } public void setMappedName(final String value) { this.mappedName = value; } public String getEjbClass() { return ejbClass; } public void setEjbClass(final String value) { this.ejbClass = value; } public void setEjbClass(final Class value) { this.ejbClass = value.getName(); } public String getMessagingType() { return messagingType; } public void setMessagingType(final String value) { this.messagingType = value; } public void setMessagingType(final Class value) { this.messagingType = value.getName(); } public NamedMethod getTimeoutMethod() { return timeoutMethod; } public void setTimeoutMethod(final NamedMethod value) { this.timeoutMethod = value; } public List getTimer() { if (timer == null) { timer = new ArrayList(); } return this.timer; } public MessageDrivenDestination getMessageDrivenDestination() { return null; } @XmlElement(name = "message-driven-destination") public void setMessageDrivenDestination(final MessageDrivenDestination value) { if (activationConfig == null) activationConfig = new ActivationConfig(); final DestinationType destinationType = value.getDestinationType(); if (destinationType != null) { activationConfig.addProperty("destinationType", destinationType.getvalue()); } final SubscriptionDurability subscriptionDurability = value.getSubscriptionDurability(); if (subscriptionDurability != null) { activationConfig.addProperty("subscriptionDurability", subscriptionDurability.getvalue()); } } @XmlElement(name = "message-selector") public String getMessageSelector() { return null; } public void setMessageSelector(final String messageSelector) { if (messageSelector != null) { if (activationConfig == null) activationConfig = new ActivationConfig(); activationConfig.addProperty("messageSelector", messageSelector); } } @XmlElement(name = "acknowledge-mode") public String getAcknowledgeMode() { return null; } public void setAcknowledgeMode(final String acknowledgeMode) { if (acknowledgeMode != null) { if (activationConfig == null) activationConfig = new ActivationConfig(); activationConfig.addProperty("acknowledgeMode", acknowledgeMode); } } public TransactionType getTransactionType() { return transactionType; } public void setTransactionType(final TransactionType value) { this.transactionType = value; } public String getMessageDestinationType() { return messageDestinationType; } public void setMessageDestinationType(final String value) { this.messageDestinationType = value; } /** * The Assembler sets the value to reflect the flow of messages * between producers and consumers in the application. *

* The value must be the message-destination-name of a message * destination in the same Deployment File or in another * Deployment File in the same Java EE application unit. *

* Alternatively, the value may be composed of a path name * specifying a Deployment File containing the referenced * message destination with the message-destination-name of the * destination appended and separated from the path name by * "#". The path name is relative to the Deployment File * containing Deployment Component that is referencing the * message destination. This allows multiple message * destinations with the same name to be uniquely identified. */ public String getMessageDestinationLink() { return messageDestinationLink; } public void setMessageDestinationLink(final String value) { this.messageDestinationLink = value; } public ActivationConfig getActivationConfig() { return activationConfig; } public void setActivationConfig(final ActivationConfig value) { this.activationConfig = value; } public List getAroundInvoke() { if (aroundInvoke == null) { aroundInvoke = new ArrayList(); } return this.aroundInvoke; } public void addAroundInvoke(final String method) { assert ejbClass != null : "Set the ejbClass before calling this method"; getAroundInvoke().add(new AroundInvoke(ejbClass, method)); } public List getAroundTimeout() { if (aroundTimeout == null) { aroundTimeout = new ArrayList(); } return this.aroundTimeout; } public Collection getEnvEntry() { if (envEntry == null) { envEntry = new KeyedCollection(); } return this.envEntry; } public Map getEnvEntryMap() { if (envEntry == null) { envEntry = new KeyedCollection(); } return this.envEntry.toMap(); } public Collection getEjbRef() { if (ejbRef == null) { ejbRef = new KeyedCollection(); } return this.ejbRef; } public Map getEjbRefMap() { if (ejbRef == null) { ejbRef = new KeyedCollection(); } return this.ejbRef.toMap(); } public Collection getEjbLocalRef() { if (ejbLocalRef == null) { ejbLocalRef = new KeyedCollection(); } return this.ejbLocalRef; } public Map getEjbLocalRefMap() { if (ejbLocalRef == null) { ejbLocalRef = new KeyedCollection(); } return this.ejbLocalRef.toMap(); } public Collection getServiceRef() { if (serviceRef == null) { serviceRef = new KeyedCollection(); } return this.serviceRef; } public Map getServiceRefMap() { if (serviceRef == null) { serviceRef = new KeyedCollection(); } return this.serviceRef.toMap(); } public Collection getResourceRef() { if (resourceRef == null) { resourceRef = new KeyedCollection(); } return this.resourceRef; } public Map getResourceRefMap() { if (resourceRef == null) { resourceRef = new KeyedCollection(); } return this.resourceRef.toMap(); } public Collection getResourceEnvRef() { if (resourceEnvRef == null) { resourceEnvRef = new KeyedCollection(); } return this.resourceEnvRef; } public Map getResourceEnvRefMap() { if (resourceEnvRef == null) { resourceEnvRef = new KeyedCollection(); } return this.resourceEnvRef.toMap(); } public Collection getMessageDestinationRef() { if (messageDestinationRef == null) { messageDestinationRef = new KeyedCollection(); } return this.messageDestinationRef; } public Map getMessageDestinationRefMap() { if (messageDestinationRef == null) { messageDestinationRef = new KeyedCollection(); } return this.messageDestinationRef.toMap(); } public Collection getPersistenceContextRef() { if (persistenceContextRef == null) { persistenceContextRef = new KeyedCollection(); } return this.persistenceContextRef; } public Map getPersistenceContextRefMap() { if (persistenceContextRef == null) { persistenceContextRef = new KeyedCollection(); } return this.persistenceContextRef.toMap(); } public Collection getPersistenceUnitRef() { if (persistenceUnitRef == null) { persistenceUnitRef = new KeyedCollection(); } return this.persistenceUnitRef; } public Map getPersistenceUnitRefMap() { if (persistenceUnitRef == null) { persistenceUnitRef = new KeyedCollection(); } return this.persistenceUnitRef.toMap(); } public Collection getDataSource() { if (dataSource == null) { dataSource = new KeyedCollection(); } return this.dataSource; } public Map getDataSourceMap() { if (dataSource == null) { dataSource = new KeyedCollection(); } return this.dataSource.toMap(); } public List getPostConstruct() { if (postConstruct == null) { postConstruct = new ArrayList(); } return this.postConstruct; } public void addPostConstruct(final String method) { assert ejbClass != null : "Set the ejbClass before calling this method"; getPostConstruct().add(new LifecycleCallback(ejbClass, method)); } public List getPreDestroy() { if (preDestroy == null) { preDestroy = new ArrayList(); } return this.preDestroy; } public void addPreDestroy(final String method) { assert ejbClass != null : "Set the ejbClass before calling this method"; getPreDestroy().add(new LifecycleCallback(ejbClass, method)); } public List getSecurityRoleRef() { if (securityRoleRef == null) { securityRoleRef = new ArrayList(); } return this.securityRoleRef; } public SecurityIdentity getSecurityIdentity() { return securityIdentity; } public void setSecurityIdentity(final SecurityIdentity value) { this.securityIdentity = value; } public String getId() { return id; } public void setId(final String value) { this.id = value; } public void addAroundTimeout(final String method) { assert ejbClass != null : "Set the ejbClass before calling this method"; getAroundTimeout().add(new AroundTimeout(ejbClass, method)); } @Override public String getTimerConsumerName() { return ejbName; } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy