[jboss-cvs] JBossAS SVN: r73129 - in projects/metadata/tags: 1.0.0.Beta12 and 4 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed May 7 20:46:24 EDT 2008
Author: scott.stark at jboss.org
Date: 2008-05-07 20:46:24 -0400 (Wed, 07 May 2008)
New Revision: 73129
Added:
projects/metadata/tags/1.0.0.Beta12/
projects/metadata/tags/1.0.0.Beta12/pom.xml
projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossConsumerBeanMetaData.java
projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossEnterpriseBeanMetaData.java
projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossEntityBeanMetaData.java
projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossGenericBeanMetaData.java
projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossMessageDrivenBeanMetaData.java
projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossMetaData.java
projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossSessionBeanMetaData.java
projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/plugins/BasicJndiBindingPolicy.java
projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/plugins/EjbNameJndiBindingPolicy.java
projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/plugins/SessionJndiBindingPolicy.java
projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/spi/DefaultJndiBindingPolicy.java
projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/spi/DeploymentSummary.java
projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/spi/EjbDeploymentSummary.java
projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/spi/KnownInterfaces.java
projects/metadata/tags/1.0.0.Beta12/src/test/java/org/jboss/test/metadata/ejb/EJBMetaDataTestSuite.java
projects/metadata/tags/1.0.0.Beta12/src/test/java/org/jboss/test/metadata/ejb/ResolvedJndiNameUnitTestCase.java
Removed:
projects/metadata/tags/1.0.0.Beta12/pom.xml
projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossConsumerBeanMetaData.java
projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossEnterpriseBeanMetaData.java
projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossEntityBeanMetaData.java
projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossGenericBeanMetaData.java
projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossMessageDrivenBeanMetaData.java
projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossMetaData.java
projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossSessionBeanMetaData.java
projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/plugins/EjbNameJndiBindingPolicy.java
projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/plugins/SessionJndiBindingPolicy.java
projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/spi/DefaultJndiBindingPolicy.java
projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/spi/EjbDeploymentSummary.java
projects/metadata/tags/1.0.0.Beta12/src/test/java/org/jboss/test/metadata/ejb/EJBMetaDataTestSuite.java
Log:
[maven-release-plugin] copy for tag 1.0.0.Beta12
Copied: projects/metadata/tags/1.0.0.Beta12 (from rev 73125, projects/metadata/trunk)
Deleted: projects/metadata/tags/1.0.0.Beta12/pom.xml
===================================================================
--- projects/metadata/trunk/pom.xml 2008-05-07 21:59:24 UTC (rev 73125)
+++ projects/metadata/tags/1.0.0.Beta12/pom.xml 2008-05-08 00:46:24 UTC (rev 73129)
@@ -1,212 +0,0 @@
-<!--
- vi:ts=2:sw=2:expandtab
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-parent</artifactId>
- <version>3</version>
- </parent>
- <groupId>org.jboss.metadata</groupId>
- <artifactId>jboss-metadata</artifactId>
- <packaging>jar</packaging>
- <version>1.0.0-SNAPSHOT</version>
- <name>JBoss Metadata</name>
- <url>http://www.jboss.org</url>
- <description>The common JavaEE metadata classes</description>
- <scm>
- <connection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/metadata/trunk/</connection>
- </scm>
- <licenses>
- <license>
- <name>lgpl</name>
- <url>http://repository.jboss.com/licenses/lgpl.txt</url>
- </license>
- </licenses>
- <organization>
- <name>JBoss, A division of Red Hat</name>
- <url>http://www.jboss.org</url>
- </organization>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.3</version>
- <configuration>
- <printSummary>true</printSummary>
- <disableXmlReport>false</disableXmlReport>
- <testFailureIgnore>true</testFailureIgnore>
- <redirectTestOutputToFile>true</redirectTestOutputToFile>
- <includes>
- <include>**/*TestCase.java</include>
- </includes>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <!--
- Eclipse settings have been removed from parent. This needs to be
- done via an eclipse profile.
- http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4085896#4085896
- -->
- <profiles>
- <profile>
- <id>eclipse</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-eclipse-plugin</artifactId>
- <configuration>
- <downloadSources>true</downloadSources>
- <buildOutputDirectory>target/eclipse-classes</buildOutputDirectory>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <!-- This profile allows hudson to skip the jboss-deploy step -->
- <id>jboss-deploy</id>
- <activation>
- <property>
- <name>!skip.jboss-deploy</name>
- </property>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jboss-deploy-plugin</artifactId>
- <version>1.5</version>
- <executions>
- <execution>
- <id>jboss-deploy</id>
- <goals>
- <goal>jboss-deploy</goal>
- </goals>
- <phase>deploy</phase>
- </execution>
- </executions>
- <configuration>
- <groupId>jboss</groupId>
- <imports>
- <jboss.common-core>2.2.1.GA,2.2.2.GA</jboss.common-core>
- </imports>
- <jbossDeployRoot>${jboss.repository.root}</jbossDeployRoot>
- <removeArtifactVersion>true</removeArtifactVersion>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
- <!-- Compile Dependencies -->
- <dependencies>
-
- <dependency>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-spi</artifactId>
- <version>2.0.5.GA</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-common-core</artifactId>
- <version>2.2.5.GA</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.ejb3</groupId>
- <artifactId>jboss-ejb3-ext-api</artifactId>
- <version>0.3</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.javaee</groupId>
- <artifactId>jboss-ejb-api</artifactId>
- <version>3.0.0.CR1</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.javaee</groupId>
- <artifactId>jboss-jms-api</artifactId>
- <version>1.1.0.CR1</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.javaee</groupId>
- <artifactId>jboss-persistence-api</artifactId>
- <version>3.0.0.CR1</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.javaee</groupId>
- <artifactId>jboss-transaction-api</artifactId>
- <version>1.0.1.CR1</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.ws</groupId>
- <artifactId>jbossws-spi</artifactId>
- <version>1.0.2.GA</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-jaxws</artifactId>
- <version>2.0.1.GA</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jbossxb</artifactId>
- <version>2.0.0.CR9</version>
- <exclusions>
- <exclusion>
- <groupId>jboss</groupId>
- <artifactId>jboss-common-logging-spi</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-vfs</artifactId>
- <version>2.0.0.Beta11</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-mdr</artifactId>
- <version>2.0.0.Beta15</version>
- </dependency>
-
- <dependency>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- <version>2.1</version>
- </dependency>
-
- <!-- Test Dependencies -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.test</groupId>
- <artifactId>jboss-test</artifactId>
- <version>1.1.0.GA</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
Copied: projects/metadata/tags/1.0.0.Beta12/pom.xml (from rev 73128, projects/metadata/trunk/pom.xml)
===================================================================
--- projects/metadata/tags/1.0.0.Beta12/pom.xml (rev 0)
+++ projects/metadata/tags/1.0.0.Beta12/pom.xml 2008-05-08 00:46:24 UTC (rev 73129)
@@ -0,0 +1,212 @@
+<!--
+ vi:ts=2:sw=2:expandtab
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-parent</artifactId>
+ <version>3</version>
+ </parent>
+ <groupId>org.jboss.metadata</groupId>
+ <artifactId>jboss-metadata</artifactId>
+ <packaging>jar</packaging>
+ <version>1.0.0.Beta12</version>
+ <name>JBoss Metadata</name>
+ <url>http://www.jboss.org</url>
+ <description>The common JavaEE metadata classes</description>
+ <scm>
+ <connection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/metadata/tags/1.0.0.Beta12</connection>
+ </scm>
+ <licenses>
+ <license>
+ <name>lgpl</name>
+ <url>http://repository.jboss.com/licenses/lgpl.txt</url>
+ </license>
+ </licenses>
+ <organization>
+ <name>JBoss, A division of Red Hat</name>
+ <url>http://www.jboss.org</url>
+ </organization>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.3</version>
+ <configuration>
+ <printSummary>true</printSummary>
+ <disableXmlReport>false</disableXmlReport>
+ <testFailureIgnore>true</testFailureIgnore>
+ <redirectTestOutputToFile>true</redirectTestOutputToFile>
+ <includes>
+ <include>**/*TestCase.java</include>
+ </includes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <!--
+ Eclipse settings have been removed from parent. This needs to be
+ done via an eclipse profile.
+ http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4085896#4085896
+ -->
+ <profiles>
+ <profile>
+ <id>eclipse</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-eclipse-plugin</artifactId>
+ <configuration>
+ <downloadSources>true</downloadSources>
+ <buildOutputDirectory>target/eclipse-classes</buildOutputDirectory>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <!-- This profile allows hudson to skip the jboss-deploy step -->
+ <id>jboss-deploy</id>
+ <activation>
+ <property>
+ <name>!skip.jboss-deploy</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jboss-deploy-plugin</artifactId>
+ <version>1.5</version>
+ <executions>
+ <execution>
+ <id>jboss-deploy</id>
+ <goals>
+ <goal>jboss-deploy</goal>
+ </goals>
+ <phase>deploy</phase>
+ </execution>
+ </executions>
+ <configuration>
+ <groupId>jboss</groupId>
+ <imports>
+ <jboss.common-core>2.2.1.GA,2.2.2.GA</jboss.common-core>
+ </imports>
+ <jbossDeployRoot>${jboss.repository.root}</jbossDeployRoot>
+ <removeArtifactVersion>true</removeArtifactVersion>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+ <!-- Compile Dependencies -->
+ <dependencies>
+
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ <version>2.0.5.GA</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ <version>2.2.5.GA</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-ext-api</artifactId>
+ <version>0.3</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.javaee</groupId>
+ <artifactId>jboss-ejb-api</artifactId>
+ <version>3.0.0.CR1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.javaee</groupId>
+ <artifactId>jboss-jms-api</artifactId>
+ <version>1.1.0.CR1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.javaee</groupId>
+ <artifactId>jboss-persistence-api</artifactId>
+ <version>3.0.0.CR1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.javaee</groupId>
+ <artifactId>jboss-transaction-api</artifactId>
+ <version>1.0.1.CR1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.ws</groupId>
+ <artifactId>jbossws-spi</artifactId>
+ <version>1.0.2.GA</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-jaxws</artifactId>
+ <version>2.0.1.GA</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossxb</artifactId>
+ <version>2.0.0.CR9</version>
+ <exclusions>
+ <exclusion>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-common-logging-spi</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-vfs</artifactId>
+ <version>2.0.0.Beta11</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-mdr</artifactId>
+ <version>2.0.0.Beta15</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>2.1</version>
+ </dependency>
+
+ <!-- Test Dependencies -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.test</groupId>
+ <artifactId>jboss-test</artifactId>
+ <version>1.1.0.GA</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+</project>
Deleted: projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossConsumerBeanMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/ejb/jboss/JBossConsumerBeanMetaData.java 2008-05-07 21:59:24 UTC (rev 73125)
+++ projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossConsumerBeanMetaData.java 2008-05-08 00:46:24 UTC (rev 73129)
@@ -1,141 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.metadata.ejb.jboss;
-
-import org.jboss.logging.Logger;
-import java.util.List;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-/**
- * An EJB 3 consumer bean.
- *
- * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
- * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
- * @version <tt>$Revision$</tt>
- */
- at XmlType(name="consumer-beanType")
-public class JBossConsumerBeanMetaData extends JBossEnterpriseBeanMetaData
-{
- private static final long serialVersionUID = 1L;
-
- @SuppressWarnings("unused")
- private static final Logger log = Logger.getLogger(JBossConsumerBeanMetaData.class);
-
- private String destination = null;
- private String destinationType = null;
- private MethodAttributesMetaData currentMessage = null;
- private List<MessagePropertiesMetaData> messageProperties = null;
- private List<ProducerMetaData> producers = null;
- private List<LocalProducerMetaData> localProducers = null;
-
- public String getMessageDestination()
- {
- return destination;
- }
-
- public void setMessageDestination(String destination)
- {
- this.destination = destination;
- }
-
- public String getMessageDestinationType()
- {
- return destinationType;
- }
-
- public void setMessageDestinationType(String destinationType)
- {
- this.destinationType = destinationType;
- }
-
- public MethodAttributesMetaData getCurrentMessage()
- {
- return currentMessage;
- }
-
- public void setCurrentMessage(MethodAttributesMetaData currentMessage)
- {
- this.currentMessage = currentMessage;
- }
-
- public List<MessagePropertiesMetaData> getMessageProperties()
- {
- return messageProperties;
- }
-
- public void setMessageProperties(List<MessagePropertiesMetaData> messageProperties)
- {
- this.messageProperties = messageProperties;
- }
-
- public List<ProducerMetaData> getProducers()
- {
- return producers;
- }
-
- @XmlElement(name="producer", required=false)
- public void setProducers(List<ProducerMetaData> producers)
- {
- this.producers = producers;
- }
-
- public List<LocalProducerMetaData> getLocalProducers()
- {
- return localProducers;
- }
-
- @XmlElement(name="local-producer", required=false)
- public void setLocalProducers(List<LocalProducerMetaData> producers)
- {
- this.localProducers = producers;
- }
-
- @Override
- public boolean isConsumer()
- {
- return true;
- }
-
- public String toString()
- {
- StringBuffer sb = new StringBuffer(100);
- sb.append("[Consumer:");
- sb.append(super.toString());
- sb.append(", destination=" + destination);
- sb.append(", destinationType=" + destinationType);
- sb.append(']');
- return sb.toString();
- }
-
- @Override
- public String getDefaultConfigurationName()
- {
- throw new RuntimeException("NYI");
- }
-
- @Override
- protected String getDefaultInvokerName()
- {
- throw new RuntimeException("NYI");
- }
-}
Copied: projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossConsumerBeanMetaData.java (from rev 73126, projects/metadata/trunk/src/main/java/org/jboss/metadata/ejb/jboss/JBossConsumerBeanMetaData.java)
===================================================================
--- projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossConsumerBeanMetaData.java (rev 0)
+++ projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossConsumerBeanMetaData.java 2008-05-08 00:46:24 UTC (rev 73129)
@@ -0,0 +1,148 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.metadata.ejb.jboss;
+
+import org.jboss.logging.Logger;
+import java.util.List;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * An EJB 3 consumer bean.
+ *
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version <tt>$Revision$</tt>
+ */
+ at XmlType(name="consumer-beanType")
+public class JBossConsumerBeanMetaData extends JBossEnterpriseBeanMetaData
+{
+ private static final long serialVersionUID = 1L;
+
+ @SuppressWarnings("unused")
+ private static final Logger log = Logger.getLogger(JBossConsumerBeanMetaData.class);
+
+ private String destination = null;
+ private String destinationType = null;
+ private MethodAttributesMetaData currentMessage = null;
+ private List<MessagePropertiesMetaData> messageProperties = null;
+ private List<ProducerMetaData> producers = null;
+ private List<LocalProducerMetaData> localProducers = null;
+
+ public String getMessageDestination()
+ {
+ return destination;
+ }
+
+ public void setMessageDestination(String destination)
+ {
+ this.destination = destination;
+ }
+
+ public String getMessageDestinationType()
+ {
+ return destinationType;
+ }
+
+ public void setMessageDestinationType(String destinationType)
+ {
+ this.destinationType = destinationType;
+ }
+
+ public MethodAttributesMetaData getCurrentMessage()
+ {
+ return currentMessage;
+ }
+
+ public void setCurrentMessage(MethodAttributesMetaData currentMessage)
+ {
+ this.currentMessage = currentMessage;
+ }
+
+ public List<MessagePropertiesMetaData> getMessageProperties()
+ {
+ return messageProperties;
+ }
+
+ public void setMessageProperties(List<MessagePropertiesMetaData> messageProperties)
+ {
+ this.messageProperties = messageProperties;
+ }
+
+ public List<ProducerMetaData> getProducers()
+ {
+ return producers;
+ }
+
+ @XmlElement(name="producer", required=false)
+ public void setProducers(List<ProducerMetaData> producers)
+ {
+ this.producers = producers;
+ }
+
+ public List<LocalProducerMetaData> getLocalProducers()
+ {
+ return localProducers;
+ }
+
+ @XmlElement(name="local-producer", required=false)
+ public void setLocalProducers(List<LocalProducerMetaData> producers)
+ {
+ this.localProducers = producers;
+ }
+
+ @Override
+ public boolean isConsumer()
+ {
+ return true;
+ }
+
+ public String toString()
+ {
+ StringBuffer sb = new StringBuffer(100);
+ sb.append("[Consumer:");
+ sb.append(super.toString());
+ sb.append(", destination=" + destination);
+ sb.append(", destinationType=" + destinationType);
+ sb.append(']');
+ return sb.toString();
+ }
+
+ @Override
+ public String getDefaultConfigurationName()
+ {
+ throw new RuntimeException("NYI");
+ }
+
+ @Override
+ protected String getDefaultInvokerName()
+ {
+ throw new RuntimeException("NYI");
+ }
+
+ @Override
+ public String determineJndiName()
+ {
+ return null;
+ }
+
+}
Deleted: projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossEnterpriseBeanMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/ejb/jboss/JBossEnterpriseBeanMetaData.java 2008-05-07 21:59:24 UTC (rev 73125)
+++ projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossEnterpriseBeanMetaData.java 2008-05-08 00:46:24 UTC (rev 73129)
@@ -1,1632 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.metadata.ejb.jboss;
-
-import java.lang.reflect.Method;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-
-import javax.ejb.TransactionAttributeType;
-import javax.ejb.TransactionManagementType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlTransient;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import org.jboss.metadata.common.ejb.IEnterpriseBeanMetaData;
-import org.jboss.metadata.ejb.jboss.jndipolicy.spi.DefaultJndiBindingPolicy;
-import org.jboss.metadata.ejb.spec.ContainerTransactionMetaData;
-import org.jboss.metadata.ejb.spec.ContainerTransactionsMetaData;
-import org.jboss.metadata.ejb.spec.EnterpriseBeanMetaData;
-import org.jboss.metadata.ejb.spec.EntityBeanMetaData;
-import org.jboss.metadata.ejb.spec.ExcludeListMetaData;
-import org.jboss.metadata.ejb.spec.MessageDrivenBeanMetaData;
-import org.jboss.metadata.ejb.spec.MethodInterfaceType;
-import org.jboss.metadata.ejb.spec.MethodMetaData;
-import org.jboss.metadata.ejb.spec.MethodPermissionMetaData;
-import org.jboss.metadata.ejb.spec.MethodPermissionsMetaData;
-import org.jboss.metadata.ejb.spec.SecurityIdentityMetaData;
-import org.jboss.metadata.ejb.spec.SessionBeanMetaData;
-import org.jboss.metadata.javaee.jboss.AnnotationsMetaData;
-import org.jboss.metadata.javaee.jboss.IgnoreDependencyMetaData;
-import org.jboss.metadata.javaee.jboss.JndiRefsMetaData;
-import org.jboss.metadata.javaee.spec.AnnotatedEJBReferencesMetaData;
-import org.jboss.metadata.javaee.spec.EJBLocalReferenceMetaData;
-import org.jboss.metadata.javaee.spec.EJBLocalReferencesMetaData;
-import org.jboss.metadata.javaee.spec.EJBReferenceMetaData;
-import org.jboss.metadata.javaee.spec.EJBReferencesMetaData;
-import org.jboss.metadata.javaee.spec.Environment;
-import org.jboss.metadata.javaee.spec.EnvironmentEntriesMetaData;
-import org.jboss.metadata.javaee.spec.EnvironmentEntryMetaData;
-import org.jboss.metadata.javaee.spec.LifecycleCallbacksMetaData;
-import org.jboss.metadata.javaee.spec.MessageDestinationReferenceMetaData;
-import org.jboss.metadata.javaee.spec.MessageDestinationReferencesMetaData;
-import org.jboss.metadata.javaee.spec.PersistenceContextReferenceMetaData;
-import org.jboss.metadata.javaee.spec.PersistenceContextReferencesMetaData;
-import org.jboss.metadata.javaee.spec.PersistenceUnitReferenceMetaData;
-import org.jboss.metadata.javaee.spec.PersistenceUnitReferencesMetaData;
-import org.jboss.metadata.javaee.spec.ResourceEnvironmentReferenceMetaData;
-import org.jboss.metadata.javaee.spec.ResourceEnvironmentReferencesMetaData;
-import org.jboss.metadata.javaee.spec.ResourceReferenceMetaData;
-import org.jboss.metadata.javaee.spec.ResourceReferencesMetaData;
-import org.jboss.metadata.javaee.spec.SecurityRoleMetaData;
-import org.jboss.metadata.javaee.spec.SecurityRoleRefsMetaData;
-import org.jboss.metadata.javaee.spec.ServiceReferenceMetaData;
-import org.jboss.metadata.javaee.spec.ServiceReferencesMetaData;
-import org.jboss.metadata.javaee.spec.TransactionManagementTypeAdapter;
-import org.jboss.metadata.javaee.support.AbstractMappedMetaData;
-import org.jboss.metadata.javaee.support.NamedMetaData;
-import org.jboss.metadata.javaee.support.NamedMetaDataWithDescriptionGroup;
-import org.jboss.metadata.javaee.support.NonNullLinkedHashSet;
-import org.jboss.xb.annotations.JBossXmlConstants;
-import org.jboss.xb.annotations.JBossXmlModelGroup;
-
-/**
- * enterprise-bean/{session,entity,message-driven} metadata
- *
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @author Scott.Stark at jboss.org
- * @version $Revision: 1.1 $
- */
- at JBossXmlModelGroup(
- kind=JBossXmlConstants.MODEL_GROUP_CHOICE,
- particles={
- @JBossXmlModelGroup.Particle(element=@XmlElement(name="session"), type=JBossSessionBeanMetaData.class),
- @JBossXmlModelGroup.Particle(element=@XmlElement(name="entity"), type=JBossEntityBeanMetaData.class),
- @JBossXmlModelGroup.Particle(element=@XmlElement(name="message-driven"), type=JBossMessageDrivenBeanMetaData.class),
- @JBossXmlModelGroup.Particle(element=@XmlElement(name="consumer"), type=JBossConsumerBeanMetaData.class),
- @JBossXmlModelGroup.Particle(element=@XmlElement(name="ejb"), type=JBossGenericBeanMetaData.class),
- @JBossXmlModelGroup.Particle(element=@XmlElement(name="service"), type=JBossServiceBeanMetaData.class)})
-public abstract class JBossEnterpriseBeanMetaData extends NamedMetaDataWithDescriptionGroup
- implements Environment,
- IEnterpriseBeanMetaData<JBossAssemblyDescriptorMetaData, JBossEnterpriseBeansMetaData, JBossEnterpriseBeanMetaData, JBossMetaData>
-{
- /** The serialVersionUID */
- private static final long serialVersionUID = 6909774842926430193L;
-
- /** The enterprise bean container */
- private JBossEnterpriseBeansMetaData enterpriseBeansMetaData;
-
- /** The mapped name */
- private String mappedName;
-
- /** The ejb class */
- private String ejbClass;
-
- /** The local jndi name */
- private String localJndiName;
-
- /** Whether to throw an exception if the transaction is marked for rollback */
- private boolean exceptionOnRollback;
-
- /** Whether to persist timers */
- private boolean timerPersistence = true;
-
- /** The configuration name */
- private String configurationName;
-
- /** The invokers */
- private InvokerBindingsMetaData invokers;
-
- /** The determined invokers */
- private transient InvokerBindingsMetaData determinedInvokers;
-
- /** The ior security config */
- private IORSecurityConfigMetaData iorSecurityConfig;
-
- /** The security proxy */
- private String securityProxy;
-
- /** The environment */
- private JBossEnvironmentRefsGroupMetaData jndiEnvironmentRefsGroup;
-
- /** The method attributes */
- private MethodAttributesMetaData methodAttributes;
-
- /** The security domain */
- private String securityDomain;
-
- /** The dependencies */
- private Set<String> depends;
-
- /** The annotations */
- private AnnotationsMetaData annotations;
-
- /** Ignore dependency */
- private IgnoreDependencyMetaData ignoreDependency;
-
- /** The aop domain name */
- private String aopDomainName;
-
- /** The pool configuration */
- private PoolConfigMetaData poolConfig;
-
- /** The jndi refs */
- private JndiRefsMetaData jndiRefs;
-
- /** The security identity */
- private SecurityIdentityMetaData securityIdentity;
-
- /** The cached container transactions */
- private transient ContainerTransactionsMetaData cachedContainerTransactions;
-
- /** The transaction type cache */
- private transient ConcurrentHashMap<Method, TransactionAttributeType> methodTx;
- /** The transaction type */
- private TransactionManagementType transactionType;
-
- /** the class name that implements the JNDI binding policy for this ejb */
- private String jndiBindingPolicy;
- /** The runtime name of the ejb container as known to the 'kernel', what ever it is */
- private String containerName;
- private String generatedContainerName;
-
- /**
- * Create the correct JBossEnterpriseBeanMetaData for the input
- * standard bean metadata.
- *
- * @param bean the standard bean metadata
- * @return the corresponding jboss extenstion metadata
- */
- public static JBossEnterpriseBeanMetaData newBean(EnterpriseBeanMetaData bean)
- {
- JBossEnterpriseBeanMetaData jbean = null;
- if(bean instanceof EntityBeanMetaData)
- jbean = new JBossEntityBeanMetaData();
- if(bean instanceof MessageDrivenBeanMetaData)
- jbean = new JBossMessageDrivenBeanMetaData();
- if(bean instanceof SessionBeanMetaData)
- jbean = new JBossSessionBeanMetaData();
- return jbean;
- }
-
- /**
- * Create a new EnterpriseBeanMetaData.
- */
- public JBossEnterpriseBeanMetaData()
- {
- // For serialization
- }
-
- /**
- * Get the enterpriseBeansMetaData.
- *
- * @return the enterpriseBeansMetaData.
- */
- public JBossEnterpriseBeansMetaData getEnterpriseBeansMetaData()
- {
- return enterpriseBeansMetaData;
- }
-
- /**
- * Set the enterpriseBeansMetaData.
- *
- * @param enterpriseBeansMetaData the enterpriseBeansMetaData.
- */
- @XmlTransient
- public void setEnterpriseBeansMetaData(JBossEnterpriseBeansMetaData enterpriseBeansMetaData)
- {
- assert enterpriseBeansMetaData != null : "enterpriseBeansMetaData is null";
-
- this.enterpriseBeansMetaData = enterpriseBeansMetaData;
- }
-
- /**
- * Get the jbossMetaData.
- *
- * @return the jbossMetaData.
- */
- @XmlTransient
- public JBossMetaData getJBossMetaData()
- {
- if (enterpriseBeansMetaData == null)
- return null;
- return enterpriseBeansMetaData.getEjbJarMetaData();
- }
-
- /**
- * Get the jbossMetaData.
- *
- * @return the jbossMetaData with check
- */
- @XmlTransient
- public JBossMetaData getJBossMetaDataWithCheck()
- {
- JBossMetaData jbossMetaData = getJBossMetaData();
- if (jbossMetaData == null)
- throw new IllegalStateException("This bean is not a part of a deployment " + this);
- return jbossMetaData;
- }
-
- /**
- * Get the jndiEnvironmentRefsGroup.
- *
- * @return the jndiEnvironmentRefsGroup.
- */
- public Environment getJndiEnvironmentRefsGroup()
- {
- return jndiEnvironmentRefsGroup;
- }
-
- @XmlElement(type=JBossEnvironmentRefsGroupMetaData.class)
- public void setJndiEnvironmentRefsGroup(Environment env)
- {
- if (env == null)
- throw new IllegalArgumentException("Null jndiEnvironmentRefsGroup");
- JBossEnvironmentRefsGroupMetaData jenv = (JBossEnvironmentRefsGroupMetaData) env;
- if(jndiEnvironmentRefsGroup != null)
- jndiEnvironmentRefsGroup.merge(jenv, null, null, "jboss.xml", "ejb-jar.xml", false);
- else
- jndiEnvironmentRefsGroup = jenv;
- }
-
- /**
- * Get the ejbName.
- *
- * @return the ejbName.
- */
- public String getEjbName()
- {
- return getName();
- }
-
- /**
- * Set the ejbName.
- *
- * @param ejbName the ejbName.
- * @throws IllegalArgumentException for a null ejbName
- */
- public void setEjbName(String ejbName)
- {
- setName(ejbName);
- }
-
- public String getEjbClass()
- {
- return ejbClass;
- }
-
- @XmlTransient
- public JBossMetaData getEjbJarMetaData()
- {
- return enterpriseBeansMetaData.getEjbJarMetaData();
- }
-
- /**
- * Get the container transactions
- *
- * @return the container transactions or null for no result
- */
- @XmlTransient
- public ContainerTransactionsMetaData getContainerTransactions()
- {
- if (cachedContainerTransactions != null)
- return cachedContainerTransactions;
- JBossAssemblyDescriptorMetaData assemblyDescriptor = getAssemblyDescriptor();
- if (assemblyDescriptor == null)
- return null;
- return assemblyDescriptor.getContainerTransactionsByEjbName(getEjbName());
- }
-
- /**
- * Get the method transaction type
- *
- * @param methodName the method name
- * @param params the parameters
- * @param iface the interface type
- * @return the method transaction type
- */
- public TransactionAttributeType getMethodTransactionType(String methodName, Class<?>[] params, MethodInterfaceType iface)
- {
- // default value
- TransactionAttributeType result = null;
-
- ContainerTransactionsMetaData containerTransactions = getContainerTransactions();
- if (containerTransactions == null || containerTransactions.isEmpty())
- return result;
-
- ContainerTransactionMetaData bestMatchTransaction = null;
- MethodMetaData bestMatch = null;
- for (ContainerTransactionMetaData transaction : containerTransactions)
- {
- MethodMetaData match = transaction.bestMatch(methodName, params, iface, bestMatch);
- if (match != bestMatch)
- {
- bestMatchTransaction = transaction;
- bestMatch = match;
- }
- }
-
- if (bestMatchTransaction != null)
- result = bestMatchTransaction.getTransAttribute();
-
- return result;
- }
-
- /**
- * Get the transaction type
- *
- * @param m the method
- * @param iface the interface type
- * @return the transaction type
- */
- public TransactionAttributeType getMethodTransactionType(Method m, MethodInterfaceType iface)
- {
- if (m == null)
- return TransactionAttributeType.SUPPORTS;
-
- TransactionAttributeType result = null;
- if (methodTx != null)
- {
- result = methodTx.get(m);
- if (result != null)
- return result;
- }
-
- result = getMethodTransactionType(m.getName(), m.getParameterTypes(), iface);
-
- // provide default if method is not found in descriptor
- if (result == null)
- result = TransactionAttributeType.REQUIRED;
-
- if (methodTx == null)
- methodTx = new ConcurrentHashMap<Method, TransactionAttributeType>();
- methodTx.put(m, result);
- return result;
- }
-
- /**
- * Get the exclude list
- *
- * @return the exclude list or null for no result
- */
- @XmlTransient
- public ExcludeListMetaData getExcludeList()
- {
- JBossAssemblyDescriptorMetaData assemblyDescriptor = getAssemblyDescriptor();
- if (assemblyDescriptor == null)
- return null;
- return assemblyDescriptor.getExcludeListByEjbName(getEjbName());
- }
-
- public String getMappedName()
- {
- return mappedName;
- }
-
- public void setEjbClass(String ejbClass)
- {
- this.ejbClass = ejbClass;
- }
-
- public void setMappedName(String mappedName)
- {
- this.mappedName = mappedName;
- }
-
- /**
- * Whether this is a consumer bean
- *
- * @return true when a consumer bean
- */
- @XmlTransient
- public boolean isConsumer()
- {
- return false;
- }
-
- /**
- * Whether this is a service bean
- *
- * @return true when a service bean
- */
- @XmlTransient
- public boolean isService()
- {
- return false;
- }
-
- /**
- * Whether this is a session bean
- *
- * @return true when a session bean
- */
- @XmlTransient
- public boolean isSession()
- {
- return false;
- }
-
- /**
- * Whether this is a message driven bean
- *
- * @return true when a message driven bean
- */
- @XmlTransient
- public boolean isMessageDriven()
- {
- return false;
- }
-
- /**
- * Whether this is an entity bean
- *
- * @return true when an entity bean
- */
- @XmlTransient
- public boolean isEntity()
- {
- return false;
- }
-
- /**
- * Is this container managed transactions
- *
- * @return true when CMT
- */
- @XmlTransient
- public boolean isCMT()
- {
- TransactionManagementType type = getTransactionType();
- if (type == null)
- return true;
- else
- return type == TransactionManagementType.CONTAINER;
- }
-
- /**
- * Is this bean managed transactions
- *
- * @return true when BMT
- */
- @XmlTransient
- public boolean isBMT()
- {
- return isCMT() == false;
- }
-
- public TransactionManagementType getTransactionType()
- {
- return transactionType;
- }
-
- @XmlJavaTypeAdapter(TransactionManagementTypeAdapter.class)
- public void setTransactionType(TransactionManagementType transactionType)
- {
- this.transactionType = transactionType;
- }
-
- /**
- * Get the localJndiName.
- *
- * @return the localJndiName.
- */
- public String getLocalJndiName()
- {
- return localJndiName;
- }
-
- /**
- * Set the localJndiName.
- *
- * @param localJndiName the localJndiName.
- * @throws IllegalArgumentException for a null localJndiName
- */
- public void setLocalJndiName(String localJndiName)
- {
- if (localJndiName == null)
- throw new IllegalArgumentException("Null localJndiName");
- this.localJndiName = localJndiName;
- }
-
- /**
- * Determine the localJndiName.
- *
- * @return the localJndiName.
- */
- @XmlTransient
- public String determineLocalJndiName()
- {
- if (localJndiName != null)
- return localJndiName;
-
- String ejbName = getEjbName();
- // Generate a unique name based on ejbName + identityHashCode
- return "local/" + ejbName + '@' + System.identityHashCode(ejbName);
- }
-
- /**
- * Create the DefaultJndiBindingPolicy from the bean metadata.
- *
- * @param loader - the class loader used to load the policy class
- * @param defaultPolicyClass - a fallback implementation to use if the
- * bean has no policy set.
- * @return the DefaultJndiBindingPolicy implementation
- * @throws Exception on failure to load the policy class or instantiate it
- */
- @XmlTransient
- public DefaultJndiBindingPolicy createPolicy(ClassLoader loader,
- Class<? extends DefaultJndiBindingPolicy> defaultPolicyClass)
- throws Exception
- {
- Class<? extends DefaultJndiBindingPolicy> policyClass = defaultPolicyClass;
- String policyClassName = getJndiBindingPolicy();
- if(policyClassName != null)
- {
- policyClass = (Class<? extends DefaultJndiBindingPolicy>)
- loader.loadClass(policyClassName);
- }
- DefaultJndiBindingPolicy policy = null;
- if(policyClass != null)
- policy = policyClass.newInstance();
- return policy;
- }
-
- /**
- * Determine the container jndi name used in the object name. This is
- * really obsolete as there is no need for jmx names.
- *
- * @return the jndi name suitable for use in the object name
- */
- @XmlTransient
- public String getContainerObjectNameJndiName()
- {
- return getLocalJndiName();
- }
-
- /**
- * Get the kernel name for the ejb container. This is the managed property
- * version admin tools may use to control the name. Generally its not set
- * and the server will set the name via the generatedContainerName
- * non-managed property.
- *
- * @see #setGeneratedContainerName(String)
- * @return containerName property value.
- */
- public String getContainerName()
- {
- return containerName;
- }
- public void setContainerName(String containerName)
- {
- this.containerName = containerName;
- }
-
- /**
- * Get the generated kernel name for the ejb container. This is the
- * non-managed property version that the server would use to set the name
- * it generated when no containerName property existed.
- *
- * @see #getContainerName()
- * @return generatedContainerName property value.
- */
- @XmlTransient
- public String getGeneratedContainerName()
- {
- return generatedContainerName;
- }
- public void setGeneratedContainerName(String containerName)
- {
- this.generatedContainerName = containerName;
- }
- /**
- * Get the kernel name for the ejb container. This is either the
- * containerName managed property, or a runtime generated name set via
- * the non-managed generatedContainerName property.
- * @return the kernel name for the ejb container
- */
- public String determineContainerName()
- {
- String name = containerName;
- if(name == null)
- name = generatedContainerName;
- return name;
- }
-
- /**
- * Get the exceptionOnRollback.
- *
- * @return the exceptionOnRollback.
- */
- public boolean isExceptionOnRollback()
- {
- return exceptionOnRollback;
- }
-
- /**
- * Set the exceptionOnRollback.
- *
- * @param exceptionOnRollback the exceptionOnRollback.
- */
- public void setExceptionOnRollback(boolean exceptionOnRollback)
- {
- this.exceptionOnRollback = exceptionOnRollback;
- }
-
- /**
- * Get the timerPersistence.
- *
- * @return the timerPersistence.
- */
- public boolean isTimerPersistence()
- {
- return timerPersistence;
- }
-
- /**
- * Set the timerPersistence.
- *
- * @param timerPersistence the timerPersistence.
- */
- public void setTimerPersistence(boolean timerPersistence)
- {
- this.timerPersistence = timerPersistence;
- }
-
- /**
- * Get the configurationName.
- *
- * @return the configurationName.
- */
- public String getConfigurationName()
- {
- return configurationName;
- }
-
- /**
- * Set the configurationName.
- *
- * @param configurationName the configurationName.
- * @throws IllegalArgumentException for a null configurationName
- */
- public void setConfigurationName(String configurationName)
- {
- if (configurationName == null)
- throw new IllegalArgumentException("Null configurationName");
- this.configurationName = configurationName;
- }
-
- /**
- * Determine the configuration name
- *
- * @return the configuration name
- */
- public String determineConfigurationName()
- {
- if (configurationName != null)
- return configurationName;
-
- return getDefaultConfigurationName();
- }
-
- /**
- * Get the container configuration
- *
- * @return the container configuration
- */
- public ContainerConfigurationMetaData determineContainerConfiguration()
- {
- String name = determineConfigurationName();
- ContainerConfigurationMetaData result = getJBossMetaDataWithCheck().getContainerConfiguration(name);
- if (result == null)
- throw new IllegalStateException("Container configuration not found: " + name + " available: " + getJBossMetaDataWithCheck().getContainerConfigurations());
- return result;
- }
-
- public void setPoolConfig(PoolConfigMetaData poolConfig)
- {
- this.poolConfig = poolConfig;
- }
-
- /**
- * Get the default configuration name
- *
- * @return the default name
- */
- public abstract String getDefaultConfigurationName();
-
- /**
- * Get the securityProxy.
- *
- * @return the securityProxy.
- */
- public String getSecurityProxy()
- {
- return securityProxy;
- }
-
- /**
- * Set the securityProxy.
- *
- * @param securityProxy the securityProxy.
- * @throws IllegalArgumentException for a null securityProxy
- */
- public void setSecurityProxy(String securityProxy)
- {
- if (securityProxy == null)
- throw new IllegalArgumentException("Null securityProxy");
- this.securityProxy = securityProxy;
- }
-
- /**
- * Get the securityDomain.
- *
- * @return the securityDomain.
- */
- public String getSecurityDomain()
- {
- return securityDomain;
- }
-
- /**
- * Set the securityDomain.
- *
- * @param securityDomain the securityDomain.
- * @throws IllegalArgumentException for a null securityDomain
- */
- @XmlElement(required=false)
- public void setSecurityDomain(String securityDomain)
- {
- if (securityDomain == null)
- throw new IllegalArgumentException("Null securityDomain");
- this.securityDomain = securityDomain;
- }
-
- /**
- * Get the depends.
- *
- * @return the depends.
- */
- public Set<String> getDepends()
- {
- return depends;
- }
-
- /**
- * Set the depends.
- *
- * @param depends the depends.
- * @throws IllegalArgumentException for a null depends
- */
- @XmlElement(/*type=NonNullLinkedHashSet.class*/)
- public void setDepends(Set<String> depends)
- {
- if (depends == null)
- throw new IllegalArgumentException("Null depends");
- this.depends = depends;
- }
-
- /**
- * Get the depends.
- *
- * @return the depends.
- */
- public Set<String> determineAllDepends()
- {
- NonNullLinkedHashSet<String> result = new NonNullLinkedHashSet<String>();
-
- Set<String> depends = getDepends();
- if (depends != null)
- result.addAll(depends);
-
- ContainerConfigurationMetaData containerConfigurationMetaData = determineContainerConfiguration();
- if (containerConfigurationMetaData != null)
- {
- depends = containerConfigurationMetaData.getDepends();
- if (depends != null)
- result.addAll(depends);
- }
-
- return result;
- }
-
- /**
- * Get the invokers.
- *
- * @return the invokers.
- */
- public InvokerBindingsMetaData getInvokerBindings()
- {
- return invokers;
- }
-
- /**
- * Set the invokers.
- *
- * @param invokers the invokers.
- * @throws IllegalArgumentException for a null invokers
- */
- public void setInvokerBindings(InvokerBindingsMetaData invokers)
- {
- if (invokers == null)
- throw new IllegalArgumentException("Null invokers");
- this.invokers = invokers;
- }
-
- /**
- * Determine the invokers
- *
- * @return the invokers.
- */
- public InvokerBindingsMetaData determineInvokerBindings()
- {
- // We already worked it out
- if (determinedInvokers != null)
- return determinedInvokers;
-
- // Use anything configured
- if (invokers != null)
- {
- determinedInvokers = invokers;
- return determinedInvokers;
- }
-
- // Look at the container configuration
- ContainerConfigurationMetaData containerConfiguration = determineContainerConfiguration();
- Set<String> invokerProxyBindingNames = containerConfiguration.getInvokerProxyBindingNames();
- if (invokerProxyBindingNames != null && invokerProxyBindingNames.isEmpty() == false)
- {
- determinedInvokers = new InvokerBindingsMetaData();
-
- // Like the original code, they all get bound with the same name?
- String jndiName = getDefaultInvokerJndiName();
- for (String name : invokerProxyBindingNames)
- {
- InvokerBindingMetaData invoker = new InvokerBindingMetaData();
- invoker.setInvokerProxyBindingName(name);
- if (jndiName != null)
- invoker.setJndiName(jndiName);
- determinedInvokers.add(invoker);
- }
- }
- else
- {
- determinedInvokers = getDefaultInvokers();
- }
- return determinedInvokers;
- }
-
- /**
- * Determine an invoker binding
- *
- * @param invokerName the invoker proxy binding name
- * @return the invoke binding
- * @throws IllegalStateException if there is no such binding
- */
- public InvokerBindingMetaData determineInvokerBinding(String invokerName)
- {
- InvokerBindingMetaData binding = determineInvokerBindings().get(invokerName);
- if (binding == null)
- throw new IllegalStateException("No such binding: " + invokerName + " available: " + determinedInvokers);
- return binding;
- }
-
- /**
- * Determine the jndi name for invoker bindings that come from the container configuration
- *
- * @return the jndi name suitable for use on the default invoker
- */
- protected String getDefaultInvokerJndiName()
- {
- return null;
- }
-
- /**
- * Get the default invokers
- *
- * @return the default invokers
- */
- protected InvokerBindingsMetaData getDefaultInvokers()
- {
- InvokerBindingsMetaData bindings = new InvokerBindingsMetaData();
- InvokerBindingMetaData binding = new InvokerBindingMetaData();
- binding.setInvokerProxyBindingName(getDefaultInvokerName());
- String jndiName = getDefaultInvokerJndiName();
- if (jndiName != null)
- binding.setJndiName(getDefaultInvokerJndiName());
- bindings.add(binding);
- return bindings;
- }
-
- /**
- * Get the default invokers
- *
- * @return the default invokers
- */
- protected abstract String getDefaultInvokerName();
-
- public EJBLocalReferenceMetaData getEjbLocalReferenceByName(String name)
- {
- return AbstractMappedMetaData.getByName(name, getEjbLocalReferences());
- }
-
- @XmlTransient
- public EJBLocalReferencesMetaData getEjbLocalReferences()
- {
- EJBLocalReferencesMetaData refs = null;
- if(jndiEnvironmentRefsGroup != null)
- refs = jndiEnvironmentRefsGroup.getEjbLocalReferences();
- return refs;
- }
-
- public EJBReferenceMetaData getEjbReferenceByName(String name)
- {
- return AbstractMappedMetaData.getByName(name, getEjbReferences());
- }
-
- @XmlTransient
- public EJBReferencesMetaData getEjbReferences()
- {
- EJBReferencesMetaData refs = null;
- if(jndiEnvironmentRefsGroup != null)
- refs = jndiEnvironmentRefsGroup.getEjbReferences();
- return refs;
- }
- // TODO?
- @XmlTransient
- public AnnotatedEJBReferencesMetaData getAnnotatedEjbReferences()
- {
- AnnotatedEJBReferencesMetaData refs = null;
- if(jndiEnvironmentRefsGroup != null)
- refs = jndiEnvironmentRefsGroup.getAnnotatedEjbReferences();
- return refs;
- }
-
- @XmlTransient
- public EnvironmentEntriesMetaData getEnvironmentEntries()
- {
- EnvironmentEntriesMetaData env = null;
- if(jndiEnvironmentRefsGroup != null)
- env = jndiEnvironmentRefsGroup.getEnvironmentEntries();
- return env;
- }
-
- public EnvironmentEntryMetaData getEnvironmentEntryByName(String name)
- {
- return AbstractMappedMetaData.getByName(name, getEnvironmentEntries());
- }
-
- public MessageDestinationReferenceMetaData getMessageDestinationReferenceByName(String name)
- {
- return AbstractMappedMetaData.getByName(name, getMessageDestinationReferences());
- }
-
- @XmlTransient
- public MessageDestinationReferencesMetaData getMessageDestinationReferences()
- {
- MessageDestinationReferencesMetaData refs = null;
- if(jndiEnvironmentRefsGroup != null)
- refs = jndiEnvironmentRefsGroup.getMessageDestinationReferences();
- return refs;
- }
-
- public PersistenceContextReferenceMetaData getPersistenceContextReferenceByName(String name)
- {
- return AbstractMappedMetaData.getByName(name, getPersistenceContextRefs());
- }
-
- @XmlTransient
- public PersistenceContextReferencesMetaData getPersistenceContextRefs()
- {
- PersistenceContextReferencesMetaData refs = null;
- if(jndiEnvironmentRefsGroup != null)
- refs = jndiEnvironmentRefsGroup.getPersistenceContextRefs();
- return refs;
- }
-
- public PersistenceUnitReferenceMetaData getPersistenceUnitReferenceByName(String name)
- {
- return AbstractMappedMetaData.getByName(name, getPersistenceUnitRefs());
- }
-
- @XmlTransient
- public PersistenceUnitReferencesMetaData getPersistenceUnitRefs()
- {
- PersistenceUnitReferencesMetaData refs = null;
- if(jndiEnvironmentRefsGroup != null)
- refs = jndiEnvironmentRefsGroup.getPersistenceUnitRefs();
- return refs;
- }
-
- public PoolConfigMetaData getPoolConfig()
- {
- return poolConfig;
- }
-
- @XmlTransient
- public LifecycleCallbacksMetaData getPostConstructs()
- {
- LifecycleCallbacksMetaData lcs = null;
- if(jndiEnvironmentRefsGroup != null)
- lcs = jndiEnvironmentRefsGroup.getPostConstructs();
- return lcs;
- }
-
- @XmlTransient
- public LifecycleCallbacksMetaData getPreDestroys()
- {
- LifecycleCallbacksMetaData lcs = null;
- if(jndiEnvironmentRefsGroup != null)
- lcs = jndiEnvironmentRefsGroup.getPreDestroys();
- return lcs;
- }
-
- public ResourceEnvironmentReferenceMetaData getResourceEnvironmentReferenceByName(String name)
- {
- return AbstractMappedMetaData.getByName(name, getResourceEnvironmentReferences());
- }
-
- @XmlTransient
- public ResourceEnvironmentReferencesMetaData getResourceEnvironmentReferences()
- {
- ResourceEnvironmentReferencesMetaData refs = null;
- if(jndiEnvironmentRefsGroup != null)
- refs = jndiEnvironmentRefsGroup.getResourceEnvironmentReferences();
- return refs;
- }
-
- public ResourceReferenceMetaData getResourceReferenceByName(String name)
- {
- return AbstractMappedMetaData.getByName(name, getResourceReferences());
- }
-
- @XmlTransient
- public ResourceReferencesMetaData getResourceReferences()
- {
- ResourceReferencesMetaData refs = null;
- if(jndiEnvironmentRefsGroup != null)
- refs = jndiEnvironmentRefsGroup.getResourceReferences();
- return refs;
- }
-
- public ServiceReferenceMetaData getServiceReferenceByName(String name)
- {
- return AbstractMappedMetaData.getByName(name, getServiceReferences());
- }
-
- @XmlTransient
- public ServiceReferencesMetaData getServiceReferences()
- {
- ServiceReferencesMetaData refs = null;
- if(jndiEnvironmentRefsGroup != null)
- refs = jndiEnvironmentRefsGroup.getServiceReferences();
- return refs;
- }
-
- /**
- * Provies a common accessor that returns an empty security role refs.
- * Subclasses that support security-role-refs must override.
- * @return An empty security role refs.
- */
- @XmlTransient
- public SecurityRoleRefsMetaData getSecurityRoleRefs()
- {
- return new SecurityRoleRefsMetaData();
- }
-
- /**
- * Get the annotations.
- *
- * @return the annotations.
- */
- public AnnotationsMetaData getAnnotations()
- {
- return annotations;
- }
-
- /**
- * Set the annotations.
- *
- * @param annotations the annotations.
- * @throws IllegalArgumentException for a null annotations
- */
- @XmlElement(name="annotation")
- public void setAnnotations(AnnotationsMetaData annotations)
- {
- if (annotations == null)
- throw new IllegalArgumentException("Null annotations");
- this.annotations = annotations;
- }
-
- /**
- * Get the aopDomainName.
- *
- * @return the aopDomainName.
- */
- public String getAopDomainName()
- {
- return aopDomainName;
- }
-
- /**
- * Set the aopDomainName.
- *
- * @param aopDomainName the aopDomainName.
- * @throws IllegalArgumentException for a null aopDomainName
- */
- public void setAopDomainName(String aopDomainName)
- {
- if (aopDomainName == null)
- throw new IllegalArgumentException("Null aopDomainName");
- this.aopDomainName = aopDomainName;
- }
-
- /**
- * Get the jndiRefs.
- *
- * @return the jndiRefs.
- */
- public JndiRefsMetaData getJndiRefs()
- {
- return jndiRefs;
- }
-
- /**
- * Set the jndiRefs.
- *
- * @param jndiRefs the jndiRefs.
- * @throws IllegalArgumentException for a null jndiRefs
- */
- @XmlElement(name="jndi-ref")
- public void setJndiRefs(JndiRefsMetaData jndiRefs)
- {
- if (jndiRefs == null)
- throw new IllegalArgumentException("Null jndiRefs");
- this.jndiRefs = jndiRefs;
- }
-
- /**
- * Get a security role
- *
- * @param roleName the role name
- * @return the security role or null if not found
- */
- @XmlTransient
- public SecurityRoleMetaData getSecurityRole(String roleName)
- {
- JBossAssemblyDescriptorMetaData assemblyDescriptor = getJBossMetaDataWithCheck().getAssemblyDescriptor();
- if (assemblyDescriptor == null)
- return null;
- else
- return assemblyDescriptor.getSecurityRole(roleName);
- }
-
- /**
- * Get a security role's principals
- *
- * @param roleName the role name
- * @return the principals or null if not found
- */
- public Set<String> getSecurityRolePrincipals(String roleName)
- {
- JBossAssemblyDescriptorMetaData assemblyDescriptor = getJBossMetaDataWithCheck().getAssemblyDescriptor();
- if (assemblyDescriptor == null)
- return null;
- else
- return assemblyDescriptor.getSecurityRolePrincipals(roleName);
- }
-
- /**
- * Get the methods permissions
- *
- * @return the method permissions or null for no result
- */
- @XmlTransient
- public MethodPermissionsMetaData getMethodPermissions()
- {
- JBossAssemblyDescriptorMetaData assemblyDescriptor = getAssemblyDescriptor();
- if (assemblyDescriptor == null)
- return null;
- return assemblyDescriptor.getMethodPermissionsByEjbName(getEjbName());
- }
-
- /**
- * A somewhat tedious method that builds a Set<Principal> of the roles
- * that have been assigned permission to execute the indicated method. The
- * work performed is tedious because of the wildcard style of declaring
- * method permission allowed in the ejb-jar.xml descriptor. This method is
- * called by the Container.getMethodPermissions() when it fails to find the
- * prebuilt set of method roles in its cache.
- *
- * @param methodName the method name
- * @param params the parameters
- * @param interfaceType the interface type
- * @return The Set<String> for the application domain roles that caller principal's are to be validated against.
- */
- public Set<String> getMethodPermissions(String methodName, Class<?>[] params, MethodInterfaceType interfaceType)
- {
- Set<String> result = null;
-
- JBossMetaData jbossMetaData = getJBossMetaDataWithCheck();
-
- // First check the excluded method list as this takes priority over
- // all other assignments
- ExcludeListMetaData excluded = getExcludeList();
- if (excluded != null && excluded.matches(methodName, params, interfaceType))
- {
- // No one is allowed to execute this method so add a role that
- // fails to equate to any Principal or Principal name and return.
- // We don't return null to differentiate between an explicit
- // assignment of no access and no assignment information.
- if (result == null)
- result = new HashSet<String>();
- result.add(SecurityRoleNames.NOBODY_PRINCIPAL);
- return result;
- }
-
- // Check the permissioned methods list
- MethodPermissionsMetaData permissions = getMethodPermissions();
- if (permissions != null)
- {
- for (MethodPermissionMetaData permission : permissions)
- {
- if (permission.isNotChecked(methodName, params, interfaceType))
- {
- if (result == null)
- result = new HashSet<String>();
- result.clear();
- result.add(SecurityRoleNames.ANYBODY_PRINCIPAL);
- break;
- }
- else if (permission.matches(methodName, params, interfaceType))
- {
- Set<String> roles = permission.getRoles();
- if (roles != null)
- {
- if (result == null)
- result = new HashSet<String>();
- for (String roleName : roles)
- {
- // Get any extra principal names assigned to the role
- Set<String> principals = getSecurityRolePrincipals(roleName);
- if (principals != null)
- {
- for (String principal : principals)
- {
- result.add(principal);
- }
- }
- // Also add the role name itself
- result.add(roleName);
- }
- }
- }
- }
- }
-
- if (jbossMetaData.isExcludeMissingMethods() == false && result == null)
- {
- result = new HashSet<String>();
- result.add(SecurityRoleNames.ANYBODY_PRINCIPAL);
- }
-
- if (result == null)
- result = Collections.emptySet();
- return result;
- }
-
- /**
- * Check to see if there was a method-permission or exclude-list statement
- * for the given method.
- *
- * @param methodName - the method name
- * @param params - the method parameter signature
- * @param interfaceType - the method interface type
- * @return true if a matching method permission exists, false if no match
- */
- public boolean hasMethodPermissions(String methodName, Class<?>[] params, MethodInterfaceType interfaceType)
- {
- // First check the excluded method list as this takes priority over
- // all other assignments
- ExcludeListMetaData excluded = getExcludeList();
- if (excluded != null && excluded.matches(methodName, params, interfaceType))
- return true;
-
- // Check the permissioned methods list
- MethodPermissionsMetaData permissions = getMethodPermissions();
- if (permissions != null)
- {
- for (MethodPermissionMetaData permission : permissions)
- {
- if (permission.matches(methodName, params, interfaceType))
- return true;
- }
- }
-
- // No match
- return false;
- }
-
- /**
- * Get the iorSecurityConfig.
- *
- * @return the iorSecurityConfig.
- */
- public IORSecurityConfigMetaData getIorSecurityConfig()
- {
- return iorSecurityConfig;
- }
-
- /**
- * Set the iorSecurityConfig.
- *
- * @param iorSecurityConfig the iorSecurityConfig.
- * @throws IllegalArgumentException for a null iorSecurityConfig
- */
- public void setIorSecurityConfig(IORSecurityConfigMetaData iorSecurityConfig)
- {
- if (iorSecurityConfig == null)
- throw new IllegalArgumentException("Null iorSecurityConfig");
- this.iorSecurityConfig = iorSecurityConfig;
- }
-
- /**
- * Get the ignoreDependency.
- *
- * @return the ignoreDependency.
- */
- public IgnoreDependencyMetaData getIgnoreDependency()
- {
- return ignoreDependency;
- }
-
- /**
- * Set the ignoreDependency.
- *
- * @param ignoreDependency the ignoreDependency.
- * @throws IllegalArgumentException for a null ignoreDependency
- */
- public void setIgnoreDependency(IgnoreDependencyMetaData ignoreDependency)
- {
- if (ignoreDependency == null)
- throw new IllegalArgumentException("Null ignoreDependency");
- this.ignoreDependency = ignoreDependency;
- }
-
- /**
- * Get the methodAttributes.
- *
- * @return the methodAttributes.
- */
- public MethodAttributesMetaData getMethodAttributes()
- {
- return methodAttributes;
- }
-
- /**
- * Set the methodAttributes.
- *
- * @param methodAttributes the methodAttributes.
- * @throws IllegalArgumentException for a null methodAttributes
- */
- public void setMethodAttributes(MethodAttributesMetaData methodAttributes)
- {
- if (methodAttributes == null)
- throw new IllegalArgumentException("Null methodAttributes");
- this.methodAttributes = methodAttributes;
- }
-
- /**
- * Is this method a read-only method
- *
- * @param methodName the method name
- * @return true for read only
- */
- public boolean isMethodReadOnly(String methodName)
- {
- if (methodAttributes == null)
- return false;
- return methodAttributes.isMethodReadOnly(methodName);
- }
-
- /**
- * Is this method a read-only method
- *
- * @param method the method
- * @return true for read only
- */
- public boolean isMethodReadOnly(Method method)
- {
- if (method == null)
- return false;
- return isMethodReadOnly(method.getName());
- }
-
- /**
- * Get the transaction timeout for the method
- *
- * @param methodName the method name
- * @return the transaction timeout
- */
- public int getMethodTransactionTimeout(String methodName)
- {
- if (methodAttributes == null)
- return 0;
- return methodAttributes.getMethodTransactionTimeout(methodName);
- }
-
- /**
- * Get the transaction timeout for the method
- *
- * @param method the method
- * @return the transaction timeout
- */
- public int getMethodTransactionTimeout(Method method)
- {
- if (method == null)
- return 0;
- return getMethodTransactionTimeout(method.getName());
- }
-
- /**
- * Get the securityIdentity.
- *
- * @return the securityIdentity.
- */
- public SecurityIdentityMetaData getSecurityIdentity()
- {
- return securityIdentity;
- }
-
- /**
- * Set the securityIdentity.
- *
- * @param securityIdentity the securityIdentity.
- * @throws IllegalArgumentException for a null securityIdentity
- */
- public void setSecurityIdentity(SecurityIdentityMetaData securityIdentity)
- {
- if (securityIdentity == null)
- throw new IllegalArgumentException("Null securityIdentity");
- this.securityIdentity = securityIdentity;
- }
-
- @Override
- public void merge(NamedMetaData override, NamedMetaData original)
- {
- throw new RuntimeException("wrong merge method called");
- }
-
- public void merge(JBossEnterpriseBeanMetaData override, EnterpriseBeanMetaData original)
- {
- this.merge(override, original, "jboss.xml", "ejb-jar.xml", true);
- }
- public void merge(JBossEnterpriseBeanMetaData override, EnterpriseBeanMetaData original,
- String overrideFile, String overridenFile, boolean mustOverride)
- {
- super.merge(override, original);
- if(override != null && override.getEjbClass() != null)
- setEjbClass(override.getEjbClass());
- else if(original != null && original.getEjbClass() != null)
- setEjbClass(original.getEjbClass());
- if(override != null && override.getName() != null)
- setName(override.getName());
- else if(original != null && original.getName() != null)
- setName(original.getName());
- if(override != null && override.getMappedName() != null)
- setMappedName(override.getMappedName());
- else if(original != null && original.getMappedName() != null)
- setMappedName(original.getMappedName());
-
- // transactionType
- if(override != null && override.getTransactionType() != null)
- transactionType = override.getTransactionType();
- else if(original != null && original.getTransactionType() != null)
- transactionType = original.getTransactionType();
-
- if(override != null)
- {
- if(override.getAopDomainName() != null)
- setAopDomainName(override.getAopDomainName());
- if(override.getConfigurationName() != null)
- setConfigurationName(override.getConfigurationName());
- if(override.getAnnotations() != null)
- setAnnotations(override.getAnnotations());
- if(override.getDepends() != null)
- setDepends(override.getDepends());
- setExceptionOnRollback(override.isExceptionOnRollback());
- if(override.getIgnoreDependency() != null)
- setIgnoreDependency(override.getIgnoreDependency());
- if(override.getInvokerBindings() != null)
- setInvokerBindings(override.getInvokerBindings());
- if(override.getIorSecurityConfig() != null)
- setIorSecurityConfig(override.getIorSecurityConfig());
- if(override.getSecurityProxy() != null)
- setSecurityProxy(override.getSecurityProxy());
- }
-
- if(this.jndiEnvironmentRefsGroup == null)
- jndiEnvironmentRefsGroup = new JBossEnvironmentRefsGroupMetaData();
- Environment env = original != null ? original.getJndiEnvironmentRefsGroup() : null;
- JBossEnvironmentRefsGroupMetaData jenv = null;
- ResourceManagersMetaData resourceMgrs = this.getJBossMetaData().getResourceManagers();
- if( override != null )
- {
- ResourceManagersMetaData resourceMgrsOverride = override.getJBossMetaData().getResourceManagers();
- if(resourceMgrsOverride != null)
- resourceMgrs = resourceMgrsOverride;
- jenv = (JBossEnvironmentRefsGroupMetaData) override.getJndiEnvironmentRefsGroup();
- }
- jndiEnvironmentRefsGroup.merge(jenv, env, resourceMgrs, overridenFile, overrideFile, mustOverride);
-
- // Fixup the invoker binding references on ejb refs
- InvokerBindingsMetaData invokerBindings = getInvokerBindings();
- if (invokerBindings != null && invokerBindings.isEmpty() == false)
- {
- for (InvokerBindingMetaData invokerBinding : invokerBindings)
- {
- if(invokerBinding.getEjbRefs() != null)
- {
- for(InvokerBindingMetaData.EjbRef ejbRef : invokerBinding.getEjbRefs())
- {
- EJBReferenceMetaData targetEjbRef = jndiEnvironmentRefsGroup.getEjbReferenceByName(ejbRef.getEjbRefName());
- if (targetEjbRef == null)
- throw new IllegalStateException("ejb-ref " + ejbRef.getEjbRefName() + " found on invoker " + invokerBinding.getName() + " but it does not exist for ejb: " + getName());
- targetEjbRef.addInvokerBinding(invokerBinding.getName(), ejbRef.getJndiName());
- }
- }
- }
- }
-
- // Fixup the security identity
- SecurityIdentityMetaData jbossSecurityIdentity = null;
- if (override != null && override.getSecurityIdentity() != null)
- jbossSecurityIdentity = override.getSecurityIdentity();
- SecurityIdentityMetaData originalSecurityIdentity = null;
- if(original != null)
- originalSecurityIdentity = original.getSecurityIdentity();
- if(jbossSecurityIdentity != null || originalSecurityIdentity != null)
- {
- if(securityIdentity == null)
- securityIdentity = new SecurityIdentityMetaData();
- securityIdentity.merge(jbossSecurityIdentity, originalSecurityIdentity);
- }
- }
-
- public void checkValid()
- {
- }
-
- /**
- * Get the assembly descriptor
- *
- * @return the ejbJarMetaData.
- */
- protected JBossAssemblyDescriptorMetaData getAssemblyDescriptor()
- {
- JBossMetaData ejbJar = getEjbJarMetaData();
- if (ejbJar == null)
- return null;
- return ejbJar.getAssemblyDescriptor();
- }
-
- public String getJndiBindingPolicy()
- {
- return jndiBindingPolicy;
- }
-
- public void setJndiBindingPolicy(String jndiBindingPolicy)
- {
- this.jndiBindingPolicy = jndiBindingPolicy;
- }
-}
Copied: projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossEnterpriseBeanMetaData.java (from rev 73127, projects/metadata/trunk/src/main/java/org/jboss/metadata/ejb/jboss/JBossEnterpriseBeanMetaData.java)
===================================================================
--- projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossEnterpriseBeanMetaData.java (rev 0)
+++ projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossEnterpriseBeanMetaData.java 2008-05-08 00:46:24 UTC (rev 73129)
@@ -0,0 +1,1689 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.metadata.ejb.jboss;
+
+import java.lang.reflect.Method;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+
+import javax.ejb.TransactionAttributeType;
+import javax.ejb.TransactionManagementType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.jboss.metadata.common.ejb.IEnterpriseBeanMetaData;
+import org.jboss.metadata.ejb.jboss.jndipolicy.plugins.BasicJndiBindingPolicy;
+import org.jboss.metadata.ejb.jboss.jndipolicy.spi.DefaultJndiBindingPolicy;
+import org.jboss.metadata.ejb.jboss.jndipolicy.spi.DeploymentSummary;
+import org.jboss.metadata.ejb.jboss.jndipolicy.spi.EjbDeploymentSummary;
+import org.jboss.metadata.ejb.spec.ContainerTransactionMetaData;
+import org.jboss.metadata.ejb.spec.ContainerTransactionsMetaData;
+import org.jboss.metadata.ejb.spec.EnterpriseBeanMetaData;
+import org.jboss.metadata.ejb.spec.EntityBeanMetaData;
+import org.jboss.metadata.ejb.spec.ExcludeListMetaData;
+import org.jboss.metadata.ejb.spec.MessageDrivenBeanMetaData;
+import org.jboss.metadata.ejb.spec.MethodInterfaceType;
+import org.jboss.metadata.ejb.spec.MethodMetaData;
+import org.jboss.metadata.ejb.spec.MethodPermissionMetaData;
+import org.jboss.metadata.ejb.spec.MethodPermissionsMetaData;
+import org.jboss.metadata.ejb.spec.SecurityIdentityMetaData;
+import org.jboss.metadata.ejb.spec.SessionBeanMetaData;
+import org.jboss.metadata.javaee.jboss.AnnotationsMetaData;
+import org.jboss.metadata.javaee.jboss.IgnoreDependencyMetaData;
+import org.jboss.metadata.javaee.jboss.JndiRefsMetaData;
+import org.jboss.metadata.javaee.spec.AnnotatedEJBReferencesMetaData;
+import org.jboss.metadata.javaee.spec.EJBLocalReferenceMetaData;
+import org.jboss.metadata.javaee.spec.EJBLocalReferencesMetaData;
+import org.jboss.metadata.javaee.spec.EJBReferenceMetaData;
+import org.jboss.metadata.javaee.spec.EJBReferencesMetaData;
+import org.jboss.metadata.javaee.spec.Environment;
+import org.jboss.metadata.javaee.spec.EnvironmentEntriesMetaData;
+import org.jboss.metadata.javaee.spec.EnvironmentEntryMetaData;
+import org.jboss.metadata.javaee.spec.LifecycleCallbacksMetaData;
+import org.jboss.metadata.javaee.spec.MessageDestinationReferenceMetaData;
+import org.jboss.metadata.javaee.spec.MessageDestinationReferencesMetaData;
+import org.jboss.metadata.javaee.spec.PersistenceContextReferenceMetaData;
+import org.jboss.metadata.javaee.spec.PersistenceContextReferencesMetaData;
+import org.jboss.metadata.javaee.spec.PersistenceUnitReferenceMetaData;
+import org.jboss.metadata.javaee.spec.PersistenceUnitReferencesMetaData;
+import org.jboss.metadata.javaee.spec.ResourceEnvironmentReferenceMetaData;
+import org.jboss.metadata.javaee.spec.ResourceEnvironmentReferencesMetaData;
+import org.jboss.metadata.javaee.spec.ResourceReferenceMetaData;
+import org.jboss.metadata.javaee.spec.ResourceReferencesMetaData;
+import org.jboss.metadata.javaee.spec.SecurityRoleMetaData;
+import org.jboss.metadata.javaee.spec.SecurityRoleRefsMetaData;
+import org.jboss.metadata.javaee.spec.ServiceReferenceMetaData;
+import org.jboss.metadata.javaee.spec.ServiceReferencesMetaData;
+import org.jboss.metadata.javaee.spec.TransactionManagementTypeAdapter;
+import org.jboss.metadata.javaee.support.AbstractMappedMetaData;
+import org.jboss.metadata.javaee.support.NamedMetaData;
+import org.jboss.metadata.javaee.support.NamedMetaDataWithDescriptionGroup;
+import org.jboss.metadata.javaee.support.NonNullLinkedHashSet;
+import org.jboss.xb.annotations.JBossXmlConstants;
+import org.jboss.xb.annotations.JBossXmlModelGroup;
+
+/**
+ * enterprise-bean/{session,entity,message-driven} metadata
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @author Scott.Stark at jboss.org
+ * @version $Revision: 1.1 $
+ */
+ at JBossXmlModelGroup(
+ kind=JBossXmlConstants.MODEL_GROUP_CHOICE,
+ particles={
+ @JBossXmlModelGroup.Particle(element=@XmlElement(name="session"), type=JBossSessionBeanMetaData.class),
+ @JBossXmlModelGroup.Particle(element=@XmlElement(name="entity"), type=JBossEntityBeanMetaData.class),
+ @JBossXmlModelGroup.Particle(element=@XmlElement(name="message-driven"), type=JBossMessageDrivenBeanMetaData.class),
+ @JBossXmlModelGroup.Particle(element=@XmlElement(name="consumer"), type=JBossConsumerBeanMetaData.class),
+ @JBossXmlModelGroup.Particle(element=@XmlElement(name="ejb"), type=JBossGenericBeanMetaData.class),
+ @JBossXmlModelGroup.Particle(element=@XmlElement(name="service"), type=JBossServiceBeanMetaData.class)})
+public abstract class JBossEnterpriseBeanMetaData extends NamedMetaDataWithDescriptionGroup
+ implements Environment,
+ IEnterpriseBeanMetaData<JBossAssemblyDescriptorMetaData, JBossEnterpriseBeansMetaData, JBossEnterpriseBeanMetaData, JBossMetaData>
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 6909774842926430193L;
+
+ /** The enterprise bean container */
+ private JBossEnterpriseBeansMetaData enterpriseBeansMetaData;
+
+ /** The mapped name */
+ private String mappedName;
+
+ /** The ejb class */
+ private String ejbClass;
+
+ /** The local jndi name */
+ private String localJndiName;
+
+ /** Whether to throw an exception if the transaction is marked for rollback */
+ private boolean exceptionOnRollback;
+
+ /** Whether to persist timers */
+ private boolean timerPersistence = true;
+
+ /** The configuration name */
+ private String configurationName;
+
+ /** The invokers */
+ private InvokerBindingsMetaData invokers;
+
+ /** The determined invokers */
+ private transient InvokerBindingsMetaData determinedInvokers;
+
+ /** The ior security config */
+ private IORSecurityConfigMetaData iorSecurityConfig;
+
+ /** The security proxy */
+ private String securityProxy;
+
+ /** The environment */
+ private JBossEnvironmentRefsGroupMetaData jndiEnvironmentRefsGroup;
+
+ /** The method attributes */
+ private MethodAttributesMetaData methodAttributes;
+
+ /** The security domain */
+ private String securityDomain;
+
+ /** The dependencies */
+ private Set<String> depends;
+
+ /** The annotations */
+ private AnnotationsMetaData annotations;
+
+ /** Ignore dependency */
+ private IgnoreDependencyMetaData ignoreDependency;
+
+ /** The aop domain name */
+ private String aopDomainName;
+
+ /** The pool configuration */
+ private PoolConfigMetaData poolConfig;
+
+ /** The jndi refs */
+ private JndiRefsMetaData jndiRefs;
+
+ /** The security identity */
+ private SecurityIdentityMetaData securityIdentity;
+
+ /** The cached container transactions */
+ private transient ContainerTransactionsMetaData cachedContainerTransactions;
+
+ /** The transaction type cache */
+ private transient ConcurrentHashMap<Method, TransactionAttributeType> methodTx;
+ /** The transaction type */
+ private TransactionManagementType transactionType;
+
+ /** the class name that implements the JNDI binding policy for this ejb */
+ private String jndiBindingPolicy;
+ /** The runtime name of the ejb container as known to the 'kernel', what ever it is */
+ private String containerName;
+ /** A non-managed generated container name as known to the 'kernel', what ever it is */
+ private String generatedContainerName;
+
+ /**
+ * Create the correct JBossEnterpriseBeanMetaData for the input
+ * standard bean metadata.
+ *
+ * @param bean the standard bean metadata
+ * @return the corresponding jboss extenstion metadata
+ */
+ public static JBossEnterpriseBeanMetaData newBean(EnterpriseBeanMetaData bean)
+ {
+ JBossEnterpriseBeanMetaData jbean = null;
+ if(bean instanceof EntityBeanMetaData)
+ jbean = new JBossEntityBeanMetaData();
+ if(bean instanceof MessageDrivenBeanMetaData)
+ jbean = new JBossMessageDrivenBeanMetaData();
+ if(bean instanceof SessionBeanMetaData)
+ jbean = new JBossSessionBeanMetaData();
+ return jbean;
+ }
+
+ /**
+ * Create a new EnterpriseBeanMetaData.
+ */
+ public JBossEnterpriseBeanMetaData()
+ {
+ // For serialization
+ }
+
+ /**
+ * Get the enterpriseBeansMetaData.
+ *
+ * @return the enterpriseBeansMetaData.
+ */
+ public JBossEnterpriseBeansMetaData getEnterpriseBeansMetaData()
+ {
+ return enterpriseBeansMetaData;
+ }
+
+ /**
+ * Set the enterpriseBeansMetaData.
+ *
+ * @param enterpriseBeansMetaData the enterpriseBeansMetaData.
+ */
+ @XmlTransient
+ public void setEnterpriseBeansMetaData(JBossEnterpriseBeansMetaData enterpriseBeansMetaData)
+ {
+ assert enterpriseBeansMetaData != null : "enterpriseBeansMetaData is null";
+
+ this.enterpriseBeansMetaData = enterpriseBeansMetaData;
+ }
+
+ /**
+ * Get the jbossMetaData.
+ *
+ * @return the jbossMetaData.
+ */
+ @XmlTransient
+ public JBossMetaData getJBossMetaData()
+ {
+ if (enterpriseBeansMetaData == null)
+ return null;
+ return enterpriseBeansMetaData.getEjbJarMetaData();
+ }
+
+ /**
+ * Get the jbossMetaData.
+ *
+ * @return the jbossMetaData with check
+ */
+ @XmlTransient
+ public JBossMetaData getJBossMetaDataWithCheck()
+ {
+ JBossMetaData jbossMetaData = getJBossMetaData();
+ if (jbossMetaData == null)
+ throw new IllegalStateException("This bean is not a part of a deployment " + this);
+ return jbossMetaData;
+ }
+
+ /**
+ * Get the jndiEnvironmentRefsGroup.
+ *
+ * @return the jndiEnvironmentRefsGroup.
+ */
+ public Environment getJndiEnvironmentRefsGroup()
+ {
+ return jndiEnvironmentRefsGroup;
+ }
+
+ @XmlElement(type=JBossEnvironmentRefsGroupMetaData.class)
+ public void setJndiEnvironmentRefsGroup(Environment env)
+ {
+ if (env == null)
+ throw new IllegalArgumentException("Null jndiEnvironmentRefsGroup");
+ JBossEnvironmentRefsGroupMetaData jenv = (JBossEnvironmentRefsGroupMetaData) env;
+ if(jndiEnvironmentRefsGroup != null)
+ jndiEnvironmentRefsGroup.merge(jenv, null, null, "jboss.xml", "ejb-jar.xml", false);
+ else
+ jndiEnvironmentRefsGroup = jenv;
+ }
+
+ /**
+ * Get the ejbName.
+ *
+ * @return the ejbName.
+ */
+ public String getEjbName()
+ {
+ return getName();
+ }
+
+ /**
+ * Set the ejbName.
+ *
+ * @param ejbName the ejbName.
+ * @throws IllegalArgumentException for a null ejbName
+ */
+ public void setEjbName(String ejbName)
+ {
+ setName(ejbName);
+ }
+
+ public String getEjbClass()
+ {
+ return ejbClass;
+ }
+
+ @XmlTransient
+ public JBossMetaData getEjbJarMetaData()
+ {
+ return enterpriseBeansMetaData.getEjbJarMetaData();
+ }
+
+ /**
+ * Get the container transactions
+ *
+ * @return the container transactions or null for no result
+ */
+ @XmlTransient
+ public ContainerTransactionsMetaData getContainerTransactions()
+ {
+ if (cachedContainerTransactions != null)
+ return cachedContainerTransactions;
+ JBossAssemblyDescriptorMetaData assemblyDescriptor = getAssemblyDescriptor();
+ if (assemblyDescriptor == null)
+ return null;
+ return assemblyDescriptor.getContainerTransactionsByEjbName(getEjbName());
+ }
+
+ /**
+ * Get the method transaction type
+ *
+ * @param methodName the method name
+ * @param params the parameters
+ * @param iface the interface type
+ * @return the method transaction type
+ */
+ public TransactionAttributeType getMethodTransactionType(String methodName, Class<?>[] params, MethodInterfaceType iface)
+ {
+ // default value
+ TransactionAttributeType result = null;
+
+ ContainerTransactionsMetaData containerTransactions = getContainerTransactions();
+ if (containerTransactions == null || containerTransactions.isEmpty())
+ return result;
+
+ ContainerTransactionMetaData bestMatchTransaction = null;
+ MethodMetaData bestMatch = null;
+ for (ContainerTransactionMetaData transaction : containerTransactions)
+ {
+ MethodMetaData match = transaction.bestMatch(methodName, params, iface, bestMatch);
+ if (match != bestMatch)
+ {
+ bestMatchTransaction = transaction;
+ bestMatch = match;
+ }
+ }
+
+ if (bestMatchTransaction != null)
+ result = bestMatchTransaction.getTransAttribute();
+
+ return result;
+ }
+
+ /**
+ * Get the transaction type
+ *
+ * @param m the method
+ * @param iface the interface type
+ * @return the transaction type
+ */
+ public TransactionAttributeType getMethodTransactionType(Method m, MethodInterfaceType iface)
+ {
+ if (m == null)
+ return TransactionAttributeType.SUPPORTS;
+
+ TransactionAttributeType result = null;
+ if (methodTx != null)
+ {
+ result = methodTx.get(m);
+ if (result != null)
+ return result;
+ }
+
+ result = getMethodTransactionType(m.getName(), m.getParameterTypes(), iface);
+
+ // provide default if method is not found in descriptor
+ if (result == null)
+ result = TransactionAttributeType.REQUIRED;
+
+ if (methodTx == null)
+ methodTx = new ConcurrentHashMap<Method, TransactionAttributeType>();
+ methodTx.put(m, result);
+ return result;
+ }
+
+ /**
+ * Get the exclude list
+ *
+ * @return the exclude list or null for no result
+ */
+ @XmlTransient
+ public ExcludeListMetaData getExcludeList()
+ {
+ JBossAssemblyDescriptorMetaData assemblyDescriptor = getAssemblyDescriptor();
+ if (assemblyDescriptor == null)
+ return null;
+ return assemblyDescriptor.getExcludeListByEjbName(getEjbName());
+ }
+
+ public String getMappedName()
+ {
+ return mappedName;
+ }
+
+ public void setEjbClass(String ejbClass)
+ {
+ this.ejbClass = ejbClass;
+ }
+
+ public void setMappedName(String mappedName)
+ {
+ this.mappedName = mappedName;
+ }
+
+ /**
+ * Whether this is a consumer bean
+ *
+ * @return true when a consumer bean
+ */
+ @XmlTransient
+ public boolean isConsumer()
+ {
+ return false;
+ }
+
+ /**
+ * Whether this is a service bean
+ *
+ * @return true when a service bean
+ */
+ @XmlTransient
+ public boolean isService()
+ {
+ return false;
+ }
+
+ /**
+ * Whether this is a session bean
+ *
+ * @return true when a session bean
+ */
+ @XmlTransient
+ public boolean isSession()
+ {
+ return false;
+ }
+
+ /**
+ * Whether this is a message driven bean
+ *
+ * @return true when a message driven bean
+ */
+ @XmlTransient
+ public boolean isMessageDriven()
+ {
+ return false;
+ }
+
+ /**
+ * Whether this is an entity bean
+ *
+ * @return true when an entity bean
+ */
+ @XmlTransient
+ public boolean isEntity()
+ {
+ return false;
+ }
+
+ /**
+ * Is this container managed transactions
+ *
+ * @return true when CMT
+ */
+ @XmlTransient
+ public boolean isCMT()
+ {
+ TransactionManagementType type = getTransactionType();
+ if (type == null)
+ return true;
+ else
+ return type == TransactionManagementType.CONTAINER;
+ }
+
+ /**
+ * Is this bean managed transactions
+ *
+ * @return true when BMT
+ */
+ @XmlTransient
+ public boolean isBMT()
+ {
+ return isCMT() == false;
+ }
+
+ public TransactionManagementType getTransactionType()
+ {
+ return transactionType;
+ }
+
+ @XmlJavaTypeAdapter(TransactionManagementTypeAdapter.class)
+ public void setTransactionType(TransactionManagementType transactionType)
+ {
+ this.transactionType = transactionType;
+ }
+
+ /**
+ * Get the localJndiName.
+ *
+ * @return the localJndiName.
+ */
+ public String getLocalJndiName()
+ {
+ return localJndiName;
+ }
+
+ /**
+ * Set the localJndiName.
+ *
+ * @param localJndiName the localJndiName.
+ * @throws IllegalArgumentException for a null localJndiName
+ */
+ public void setLocalJndiName(String localJndiName)
+ {
+ if (localJndiName == null)
+ throw new IllegalArgumentException("Null localJndiName");
+ this.localJndiName = localJndiName;
+ }
+
+ /**
+ * Determine the localJndiName.
+ *
+ * @return the localJndiName.
+ */
+ @XmlTransient
+ public String determineLocalJndiName()
+ {
+ if (localJndiName != null)
+ return localJndiName;
+
+ String ejbName = getEjbName();
+ // Generate a unique name based on ejbName + identityHashCode
+ return "local/" + ejbName + '@' + System.identityHashCode(ejbName);
+ }
+
+ /**
+ * Get the base jndi name for the bean if one exists. Not all ejbs have
+ * a jndi name notion.
+ *
+ * @return the base jndi name for the ejb it one exists, null otherwise.
+ */
+ @XmlTransient
+ abstract public String determineJndiName();
+
+ /**
+ * Determine the jndi name for the proxy associated with iface. This uses
+ * the bean DefaultJndiBindingPolicy. This will be one of:
+ * - {@link #getJndiBindingPolicy()} the metadata policy
+ * - the argument defaultPolicy
+ * - BasicJndiBindingPolicy(base-jndi-name)
+ *
+ * @param iface - the fully qualified class name of the interface, or one
+ * of the {@linkplain KnownInterfaces}. May be null in which case the base
+ * name as determined by {@link #getMappedName()} or
+ * {@link #determineJndiName()} is used.
+ * @param defaultPolicy - an optional DefaultJndiBindingPolicy to use if
+ * {@link #getJndiBindingPolicy()} is null.
+ * @return the resolved jndi name
+ */
+ @XmlTransient
+ public String determineResolvedJndiName(String iface, DefaultJndiBindingPolicy defaultPolicy)
+ {
+ String baseJndiName = getMappedName();
+ if(baseJndiName == null)
+ baseJndiName = determineJndiName();
+ String resolvedJndiName = baseJndiName;
+ if(getJBossMetaData().getDeploymentSummary() != null)
+ {
+ // Use
+ DeploymentSummary dsummary = getJBossMetaData().getDeploymentSummary();
+ DefaultJndiBindingPolicy policy = null;
+ try
+ {
+ policy = createPolicy(dsummary.getLoader(), null);
+ }
+ catch(Exception e)
+ {
+ }
+ if(policy == null)
+ policy = defaultPolicy;
+ if(policy == null)
+ policy = new BasicJndiBindingPolicy(baseJndiName);
+ EjbDeploymentSummary ejbSummary = new EjbDeploymentSummary(this, dsummary);
+ resolvedJndiName = policy.getJndiName(ejbSummary, iface);
+ }
+ return resolvedJndiName;
+ }
+
+ /**
+ * Create the DefaultJndiBindingPolicy from the bean metadata.
+ *
+ * @param loader - the class loader used to load the policy class
+ * @param defaultPolicyClass - a fallback implementation to use if the
+ * bean has no policy set.
+ * @return the DefaultJndiBindingPolicy implementation
+ * @throws Exception on failure to load the policy class or instantiate it
+ */
+ @XmlTransient
+ public DefaultJndiBindingPolicy createPolicy(ClassLoader loader,
+ Class<? extends DefaultJndiBindingPolicy> defaultPolicyClass)
+ throws Exception
+ {
+ Class<? extends DefaultJndiBindingPolicy> policyClass = defaultPolicyClass;
+ String policyClassName = getJndiBindingPolicy();
+ if(policyClassName != null && loader != null)
+ {
+ policyClass = (Class<? extends DefaultJndiBindingPolicy>)
+ loader.loadClass(policyClassName);
+ }
+ DefaultJndiBindingPolicy policy = null;
+ if(policyClass != null)
+ policy = policyClass.newInstance();
+ return policy;
+ }
+
+ /**
+ * Determine the container jndi name used in the object name. This is
+ * really obsolete as there is no need for jmx names.
+ *
+ * @return the jndi name suitable for use in the object name
+ */
+ @XmlTransient
+ public String getContainerObjectNameJndiName()
+ {
+ return getLocalJndiName();
+ }
+
+ /**
+ * Get the kernel name for the ejb container. This is the managed property
+ * version admin tools may use to control the name. Generally its not set
+ * and the server will set the name via the generatedContainerName
+ * non-managed property.
+ *
+ * @see #setGeneratedContainerName(String)
+ * @return containerName property value.
+ */
+ public String getContainerName()
+ {
+ return containerName;
+ }
+ public void setContainerName(String containerName)
+ {
+ this.containerName = containerName;
+ }
+
+ /**
+ * Get the generated kernel name for the ejb container. This is the
+ * non-managed property version that the server would use to set the name
+ * it generated when no containerName property existed.
+ *
+ * @see #getContainerName()
+ * @return generatedContainerName property value.
+ */
+ @XmlTransient
+ public String getGeneratedContainerName()
+ {
+ return generatedContainerName;
+ }
+ public void setGeneratedContainerName(String containerName)
+ {
+ this.generatedContainerName = containerName;
+ }
+ /**
+ * Get the kernel name for the ejb container. This is either the
+ * containerName managed property, or a runtime generated name set via
+ * the non-managed generatedContainerName property.
+ * @return the kernel name for the ejb container
+ */
+ public String determineContainerName()
+ {
+ String name = containerName;
+ if(name == null)
+ name = generatedContainerName;
+ return name;
+ }
+
+ /**
+ * Get the exceptionOnRollback.
+ *
+ * @return the exceptionOnRollback.
+ */
+ public boolean isExceptionOnRollback()
+ {
+ return exceptionOnRollback;
+ }
+
+ /**
+ * Set the exceptionOnRollback.
+ *
+ * @param exceptionOnRollback the exceptionOnRollback.
+ */
+ public void setExceptionOnRollback(boolean exceptionOnRollback)
+ {
+ this.exceptionOnRollback = exceptionOnRollback;
+ }
+
+ /**
+ * Get the timerPersistence.
+ *
+ * @return the timerPersistence.
+ */
+ public boolean isTimerPersistence()
+ {
+ return timerPersistence;
+ }
+
+ /**
+ * Set the timerPersistence.
+ *
+ * @param timerPersistence the timerPersistence.
+ */
+ public void setTimerPersistence(boolean timerPersistence)
+ {
+ this.timerPersistence = timerPersistence;
+ }
+
+ /**
+ * Get the configurationName.
+ *
+ * @return the configurationName.
+ */
+ public String getConfigurationName()
+ {
+ return configurationName;
+ }
+
+ /**
+ * Set the configurationName.
+ *
+ * @param configurationName the configurationName.
+ * @throws IllegalArgumentException for a null configurationName
+ */
+ public void setConfigurationName(String configurationName)
+ {
+ if (configurationName == null)
+ throw new IllegalArgumentException("Null configurationName");
+ this.configurationName = configurationName;
+ }
+
+ /**
+ * Determine the configuration name
+ *
+ * @return the configuration name
+ */
+ public String determineConfigurationName()
+ {
+ if (configurationName != null)
+ return configurationName;
+
+ return getDefaultConfigurationName();
+ }
+
+ /**
+ * Get the container configuration
+ *
+ * @return the container configuration
+ */
+ public ContainerConfigurationMetaData determineContainerConfiguration()
+ {
+ String name = determineConfigurationName();
+ ContainerConfigurationMetaData result = getJBossMetaDataWithCheck().getContainerConfiguration(name);
+ if (result == null)
+ throw new IllegalStateException("Container configuration not found: " + name + " available: " + getJBossMetaDataWithCheck().getContainerConfigurations());
+ return result;
+ }
+
+ public void setPoolConfig(PoolConfigMetaData poolConfig)
+ {
+ this.poolConfig = poolConfig;
+ }
+
+ /**
+ * Get the default configuration name
+ *
+ * @return the default name
+ */
+ public abstract String getDefaultConfigurationName();
+
+ /**
+ * Get the securityProxy.
+ *
+ * @return the securityProxy.
+ */
+ public String getSecurityProxy()
+ {
+ return securityProxy;
+ }
+
+ /**
+ * Set the securityProxy.
+ *
+ * @param securityProxy the securityProxy.
+ * @throws IllegalArgumentException for a null securityProxy
+ */
+ public void setSecurityProxy(String securityProxy)
+ {
+ if (securityProxy == null)
+ throw new IllegalArgumentException("Null securityProxy");
+ this.securityProxy = securityProxy;
+ }
+
+ /**
+ * Get the securityDomain.
+ *
+ * @return the securityDomain.
+ */
+ public String getSecurityDomain()
+ {
+ return securityDomain;
+ }
+
+ /**
+ * Set the securityDomain.
+ *
+ * @param securityDomain the securityDomain.
+ * @throws IllegalArgumentException for a null securityDomain
+ */
+ @XmlElement(required=false)
+ public void setSecurityDomain(String securityDomain)
+ {
+ if (securityDomain == null)
+ throw new IllegalArgumentException("Null securityDomain");
+ this.securityDomain = securityDomain;
+ }
+
+ /**
+ * Get the depends.
+ *
+ * @return the depends.
+ */
+ public Set<String> getDepends()
+ {
+ return depends;
+ }
+
+ /**
+ * Set the depends.
+ *
+ * @param depends the depends.
+ * @throws IllegalArgumentException for a null depends
+ */
+ @XmlElement(/*type=NonNullLinkedHashSet.class*/)
+ public void setDepends(Set<String> depends)
+ {
+ if (depends == null)
+ throw new IllegalArgumentException("Null depends");
+ this.depends = depends;
+ }
+
+ /**
+ * Get the depends.
+ *
+ * @return the depends.
+ */
+ public Set<String> determineAllDepends()
+ {
+ NonNullLinkedHashSet<String> result = new NonNullLinkedHashSet<String>();
+
+ Set<String> depends = getDepends();
+ if (depends != null)
+ result.addAll(depends);
+
+ ContainerConfigurationMetaData containerConfigurationMetaData = determineContainerConfiguration();
+ if (containerConfigurationMetaData != null)
+ {
+ depends = containerConfigurationMetaData.getDepends();
+ if (depends != null)
+ result.addAll(depends);
+ }
+
+ return result;
+ }
+
+ /**
+ * Get the invokers.
+ *
+ * @return the invokers.
+ */
+ public InvokerBindingsMetaData getInvokerBindings()
+ {
+ return invokers;
+ }
+
+ /**
+ * Set the invokers.
+ *
+ * @param invokers the invokers.
+ * @throws IllegalArgumentException for a null invokers
+ */
+ public void setInvokerBindings(InvokerBindingsMetaData invokers)
+ {
+ if (invokers == null)
+ throw new IllegalArgumentException("Null invokers");
+ this.invokers = invokers;
+ }
+
+ /**
+ * Determine the invokers
+ *
+ * @return the invokers.
+ */
+ public InvokerBindingsMetaData determineInvokerBindings()
+ {
+ // We already worked it out
+ if (determinedInvokers != null)
+ return determinedInvokers;
+
+ // Use anything configured
+ if (invokers != null)
+ {
+ determinedInvokers = invokers;
+ return determinedInvokers;
+ }
+
+ // Look at the container configuration
+ ContainerConfigurationMetaData containerConfiguration = determineContainerConfiguration();
+ Set<String> invokerProxyBindingNames = containerConfiguration.getInvokerProxyBindingNames();
+ if (invokerProxyBindingNames != null && invokerProxyBindingNames.isEmpty() == false)
+ {
+ determinedInvokers = new InvokerBindingsMetaData();
+
+ // Like the original code, they all get bound with the same name?
+ String jndiName = getDefaultInvokerJndiName();
+ for (String name : invokerProxyBindingNames)
+ {
+ InvokerBindingMetaData invoker = new InvokerBindingMetaData();
+ invoker.setInvokerProxyBindingName(name);
+ if (jndiName != null)
+ invoker.setJndiName(jndiName);
+ determinedInvokers.add(invoker);
+ }
+ }
+ else
+ {
+ determinedInvokers = getDefaultInvokers();
+ }
+ return determinedInvokers;
+ }
+
+ /**
+ * Determine an invoker binding
+ *
+ * @param invokerName the invoker proxy binding name
+ * @return the invoke binding
+ * @throws IllegalStateException if there is no such binding
+ */
+ public InvokerBindingMetaData determineInvokerBinding(String invokerName)
+ {
+ InvokerBindingMetaData binding = determineInvokerBindings().get(invokerName);
+ if (binding == null)
+ throw new IllegalStateException("No such binding: " + invokerName + " available: " + determinedInvokers);
+ return binding;
+ }
+
+ /**
+ * Determine the jndi name for invoker bindings that come from the container configuration
+ *
+ * @return the jndi name suitable for use on the default invoker
+ */
+ protected String getDefaultInvokerJndiName()
+ {
+ return null;
+ }
+
+ /**
+ * Get the default invokers
+ *
+ * @return the default invokers
+ */
+ protected InvokerBindingsMetaData getDefaultInvokers()
+ {
+ InvokerBindingsMetaData bindings = new InvokerBindingsMetaData();
+ InvokerBindingMetaData binding = new InvokerBindingMetaData();
+ binding.setInvokerProxyBindingName(getDefaultInvokerName());
+ String jndiName = getDefaultInvokerJndiName();
+ if (jndiName != null)
+ binding.setJndiName(getDefaultInvokerJndiName());
+ bindings.add(binding);
+ return bindings;
+ }
+
+ /**
+ * Get the default invokers
+ *
+ * @return the default invokers
+ */
+ protected abstract String getDefaultInvokerName();
+
+ public EJBLocalReferenceMetaData getEjbLocalReferenceByName(String name)
+ {
+ return AbstractMappedMetaData.getByName(name, getEjbLocalReferences());
+ }
+
+ @XmlTransient
+ public EJBLocalReferencesMetaData getEjbLocalReferences()
+ {
+ EJBLocalReferencesMetaData refs = null;
+ if(jndiEnvironmentRefsGroup != null)
+ refs = jndiEnvironmentRefsGroup.getEjbLocalReferences();
+ return refs;
+ }
+
+ public EJBReferenceMetaData getEjbReferenceByName(String name)
+ {
+ return AbstractMappedMetaData.getByName(name, getEjbReferences());
+ }
+
+ @XmlTransient
+ public EJBReferencesMetaData getEjbReferences()
+ {
+ EJBReferencesMetaData refs = null;
+ if(jndiEnvironmentRefsGroup != null)
+ refs = jndiEnvironmentRefsGroup.getEjbReferences();
+ return refs;
+ }
+ // TODO?
+ @XmlTransient
+ public AnnotatedEJBReferencesMetaData getAnnotatedEjbReferences()
+ {
+ AnnotatedEJBReferencesMetaData refs = null;
+ if(jndiEnvironmentRefsGroup != null)
+ refs = jndiEnvironmentRefsGroup.getAnnotatedEjbReferences();
+ return refs;
+ }
+
+ @XmlTransient
+ public EnvironmentEntriesMetaData getEnvironmentEntries()
+ {
+ EnvironmentEntriesMetaData env = null;
+ if(jndiEnvironmentRefsGroup != null)
+ env = jndiEnvironmentRefsGroup.getEnvironmentEntries();
+ return env;
+ }
+
+ public EnvironmentEntryMetaData getEnvironmentEntryByName(String name)
+ {
+ return AbstractMappedMetaData.getByName(name, getEnvironmentEntries());
+ }
+
+ public MessageDestinationReferenceMetaData getMessageDestinationReferenceByName(String name)
+ {
+ return AbstractMappedMetaData.getByName(name, getMessageDestinationReferences());
+ }
+
+ @XmlTransient
+ public MessageDestinationReferencesMetaData getMessageDestinationReferences()
+ {
+ MessageDestinationReferencesMetaData refs = null;
+ if(jndiEnvironmentRefsGroup != null)
+ refs = jndiEnvironmentRefsGroup.getMessageDestinationReferences();
+ return refs;
+ }
+
+ public PersistenceContextReferenceMetaData getPersistenceContextReferenceByName(String name)
+ {
+ return AbstractMappedMetaData.getByName(name, getPersistenceContextRefs());
+ }
+
+ @XmlTransient
+ public PersistenceContextReferencesMetaData getPersistenceContextRefs()
+ {
+ PersistenceContextReferencesMetaData refs = null;
+ if(jndiEnvironmentRefsGroup != null)
+ refs = jndiEnvironmentRefsGroup.getPersistenceContextRefs();
+ return refs;
+ }
+
+ public PersistenceUnitReferenceMetaData getPersistenceUnitReferenceByName(String name)
+ {
+ return AbstractMappedMetaData.getByName(name, getPersistenceUnitRefs());
+ }
+
+ @XmlTransient
+ public PersistenceUnitReferencesMetaData getPersistenceUnitRefs()
+ {
+ PersistenceUnitReferencesMetaData refs = null;
+ if(jndiEnvironmentRefsGroup != null)
+ refs = jndiEnvironmentRefsGroup.getPersistenceUnitRefs();
+ return refs;
+ }
+
+ public PoolConfigMetaData getPoolConfig()
+ {
+ return poolConfig;
+ }
+
+ @XmlTransient
+ public LifecycleCallbacksMetaData getPostConstructs()
+ {
+ LifecycleCallbacksMetaData lcs = null;
+ if(jndiEnvironmentRefsGroup != null)
+ lcs = jndiEnvironmentRefsGroup.getPostConstructs();
+ return lcs;
+ }
+
+ @XmlTransient
+ public LifecycleCallbacksMetaData getPreDestroys()
+ {
+ LifecycleCallbacksMetaData lcs = null;
+ if(jndiEnvironmentRefsGroup != null)
+ lcs = jndiEnvironmentRefsGroup.getPreDestroys();
+ return lcs;
+ }
+
+ public ResourceEnvironmentReferenceMetaData getResourceEnvironmentReferenceByName(String name)
+ {
+ return AbstractMappedMetaData.getByName(name, getResourceEnvironmentReferences());
+ }
+
+ @XmlTransient
+ public ResourceEnvironmentReferencesMetaData getResourceEnvironmentReferences()
+ {
+ ResourceEnvironmentReferencesMetaData refs = null;
+ if(jndiEnvironmentRefsGroup != null)
+ refs = jndiEnvironmentRefsGroup.getResourceEnvironmentReferences();
+ return refs;
+ }
+
+ public ResourceReferenceMetaData getResourceReferenceByName(String name)
+ {
+ return AbstractMappedMetaData.getByName(name, getResourceReferences());
+ }
+
+ @XmlTransient
+ public ResourceReferencesMetaData getResourceReferences()
+ {
+ ResourceReferencesMetaData refs = null;
+ if(jndiEnvironmentRefsGroup != null)
+ refs = jndiEnvironmentRefsGroup.getResourceReferences();
+ return refs;
+ }
+
+ public ServiceReferenceMetaData getServiceReferenceByName(String name)
+ {
+ return AbstractMappedMetaData.getByName(name, getServiceReferences());
+ }
+
+ @XmlTransient
+ public ServiceReferencesMetaData getServiceReferences()
+ {
+ ServiceReferencesMetaData refs = null;
+ if(jndiEnvironmentRefsGroup != null)
+ refs = jndiEnvironmentRefsGroup.getServiceReferences();
+ return refs;
+ }
+
+ /**
+ * Provies a common accessor that returns an empty security role refs.
+ * Subclasses that support security-role-refs must override.
+ * @return An empty security role refs.
+ */
+ @XmlTransient
+ public SecurityRoleRefsMetaData getSecurityRoleRefs()
+ {
+ return new SecurityRoleRefsMetaData();
+ }
+
+ /**
+ * Get the annotations.
+ *
+ * @return the annotations.
+ */
+ public AnnotationsMetaData getAnnotations()
+ {
+ return annotations;
+ }
+
+ /**
+ * Set the annotations.
+ *
+ * @param annotations the annotations.
+ * @throws IllegalArgumentException for a null annotations
+ */
+ @XmlElement(name="annotation")
+ public void setAnnotations(AnnotationsMetaData annotations)
+ {
+ if (annotations == null)
+ throw new IllegalArgumentException("Null annotations");
+ this.annotations = annotations;
+ }
+
+ /**
+ * Get the aopDomainName.
+ *
+ * @return the aopDomainName.
+ */
+ public String getAopDomainName()
+ {
+ return aopDomainName;
+ }
+
+ /**
+ * Set the aopDomainName.
+ *
+ * @param aopDomainName the aopDomainName.
+ * @throws IllegalArgumentException for a null aopDomainName
+ */
+ public void setAopDomainName(String aopDomainName)
+ {
+ if (aopDomainName == null)
+ throw new IllegalArgumentException("Null aopDomainName");
+ this.aopDomainName = aopDomainName;
+ }
+
+ /**
+ * Get the jndiRefs.
+ *
+ * @return the jndiRefs.
+ */
+ public JndiRefsMetaData getJndiRefs()
+ {
+ return jndiRefs;
+ }
+
+ /**
+ * Set the jndiRefs.
+ *
+ * @param jndiRefs the jndiRefs.
+ * @throws IllegalArgumentException for a null jndiRefs
+ */
+ @XmlElement(name="jndi-ref")
+ public void setJndiRefs(JndiRefsMetaData jndiRefs)
+ {
+ if (jndiRefs == null)
+ throw new IllegalArgumentException("Null jndiRefs");
+ this.jndiRefs = jndiRefs;
+ }
+
+ /**
+ * Get a security role
+ *
+ * @param roleName the role name
+ * @return the security role or null if not found
+ */
+ @XmlTransient
+ public SecurityRoleMetaData getSecurityRole(String roleName)
+ {
+ JBossAssemblyDescriptorMetaData assemblyDescriptor = getJBossMetaDataWithCheck().getAssemblyDescriptor();
+ if (assemblyDescriptor == null)
+ return null;
+ else
+ return assemblyDescriptor.getSecurityRole(roleName);
+ }
+
+ /**
+ * Get a security role's principals
+ *
+ * @param roleName the role name
+ * @return the principals or null if not found
+ */
+ public Set<String> getSecurityRolePrincipals(String roleName)
+ {
+ JBossAssemblyDescriptorMetaData assemblyDescriptor = getJBossMetaDataWithCheck().getAssemblyDescriptor();
+ if (assemblyDescriptor == null)
+ return null;
+ else
+ return assemblyDescriptor.getSecurityRolePrincipals(roleName);
+ }
+
+ /**
+ * Get the methods permissions
+ *
+ * @return the method permissions or null for no result
+ */
+ @XmlTransient
+ public MethodPermissionsMetaData getMethodPermissions()
+ {
+ JBossAssemblyDescriptorMetaData assemblyDescriptor = getAssemblyDescriptor();
+ if (assemblyDescriptor == null)
+ return null;
+ return assemblyDescriptor.getMethodPermissionsByEjbName(getEjbName());
+ }
+
+ /**
+ * A somewhat tedious method that builds a Set<Principal> of the roles
+ * that have been assigned permission to execute the indicated method. The
+ * work performed is tedious because of the wildcard style of declaring
+ * method permission allowed in the ejb-jar.xml descriptor. This method is
+ * called by the Container.getMethodPermissions() when it fails to find the
+ * prebuilt set of method roles in its cache.
+ *
+ * @param methodName the method name
+ * @param params the parameters
+ * @param interfaceType the interface type
+ * @return The Set<String> for the application domain roles that caller principal's are to be validated against.
+ */
+ public Set<String> getMethodPermissions(String methodName, Class<?>[] params, MethodInterfaceType interfaceType)
+ {
+ Set<String> result = null;
+
+ JBossMetaData jbossMetaData = getJBossMetaDataWithCheck();
+
+ // First check the excluded method list as this takes priority over
+ // all other assignments
+ ExcludeListMetaData excluded = getExcludeList();
+ if (excluded != null && excluded.matches(methodName, params, interfaceType))
+ {
+ // No one is allowed to execute this method so add a role that
+ // fails to equate to any Principal or Principal name and return.
+ // We don't return null to differentiate between an explicit
+ // assignment of no access and no assignment information.
+ if (result == null)
+ result = new HashSet<String>();
+ result.add(SecurityRoleNames.NOBODY_PRINCIPAL);
+ return result;
+ }
+
+ // Check the permissioned methods list
+ MethodPermissionsMetaData permissions = getMethodPermissions();
+ if (permissions != null)
+ {
+ for (MethodPermissionMetaData permission : permissions)
+ {
+ if (permission.isNotChecked(methodName, params, interfaceType))
+ {
+ if (result == null)
+ result = new HashSet<String>();
+ result.clear();
+ result.add(SecurityRoleNames.ANYBODY_PRINCIPAL);
+ break;
+ }
+ else if (permission.matches(methodName, params, interfaceType))
+ {
+ Set<String> roles = permission.getRoles();
+ if (roles != null)
+ {
+ if (result == null)
+ result = new HashSet<String>();
+ for (String roleName : roles)
+ {
+ // Get any extra principal names assigned to the role
+ Set<String> principals = getSecurityRolePrincipals(roleName);
+ if (principals != null)
+ {
+ for (String principal : principals)
+ {
+ result.add(principal);
+ }
+ }
+ // Also add the role name itself
+ result.add(roleName);
+ }
+ }
+ }
+ }
+ }
+
+ if (jbossMetaData.isExcludeMissingMethods() == false && result == null)
+ {
+ result = new HashSet<String>();
+ result.add(SecurityRoleNames.ANYBODY_PRINCIPAL);
+ }
+
+ if (result == null)
+ result = Collections.emptySet();
+ return result;
+ }
+
+ /**
+ * Check to see if there was a method-permission or exclude-list statement
+ * for the given method.
+ *
+ * @param methodName - the method name
+ * @param params - the method parameter signature
+ * @param interfaceType - the method interface type
+ * @return true if a matching method permission exists, false if no match
+ */
+ public boolean hasMethodPermissions(String methodName, Class<?>[] params, MethodInterfaceType interfaceType)
+ {
+ // First check the excluded method list as this takes priority over
+ // all other assignments
+ ExcludeListMetaData excluded = getExcludeList();
+ if (excluded != null && excluded.matches(methodName, params, interfaceType))
+ return true;
+
+ // Check the permissioned methods list
+ MethodPermissionsMetaData permissions = getMethodPermissions();
+ if (permissions != null)
+ {
+ for (MethodPermissionMetaData permission : permissions)
+ {
+ if (permission.matches(methodName, params, interfaceType))
+ return true;
+ }
+ }
+
+ // No match
+ return false;
+ }
+
+ /**
+ * Get the iorSecurityConfig.
+ *
+ * @return the iorSecurityConfig.
+ */
+ public IORSecurityConfigMetaData getIorSecurityConfig()
+ {
+ return iorSecurityConfig;
+ }
+
+ /**
+ * Set the iorSecurityConfig.
+ *
+ * @param iorSecurityConfig the iorSecurityConfig.
+ * @throws IllegalArgumentException for a null iorSecurityConfig
+ */
+ public void setIorSecurityConfig(IORSecurityConfigMetaData iorSecurityConfig)
+ {
+ if (iorSecurityConfig == null)
+ throw new IllegalArgumentException("Null iorSecurityConfig");
+ this.iorSecurityConfig = iorSecurityConfig;
+ }
+
+ /**
+ * Get the ignoreDependency.
+ *
+ * @return the ignoreDependency.
+ */
+ public IgnoreDependencyMetaData getIgnoreDependency()
+ {
+ return ignoreDependency;
+ }
+
+ /**
+ * Set the ignoreDependency.
+ *
+ * @param ignoreDependency the ignoreDependency.
+ * @throws IllegalArgumentException for a null ignoreDependency
+ */
+ public void setIgnoreDependency(IgnoreDependencyMetaData ignoreDependency)
+ {
+ if (ignoreDependency == null)
+ throw new IllegalArgumentException("Null ignoreDependency");
+ this.ignoreDependency = ignoreDependency;
+ }
+
+ /**
+ * Get the methodAttributes.
+ *
+ * @return the methodAttributes.
+ */
+ public MethodAttributesMetaData getMethodAttributes()
+ {
+ return methodAttributes;
+ }
+
+ /**
+ * Set the methodAttributes.
+ *
+ * @param methodAttributes the methodAttributes.
+ * @throws IllegalArgumentException for a null methodAttributes
+ */
+ public void setMethodAttributes(MethodAttributesMetaData methodAttributes)
+ {
+ if (methodAttributes == null)
+ throw new IllegalArgumentException("Null methodAttributes");
+ this.methodAttributes = methodAttributes;
+ }
+
+ /**
+ * Is this method a read-only method
+ *
+ * @param methodName the method name
+ * @return true for read only
+ */
+ public boolean isMethodReadOnly(String methodName)
+ {
+ if (methodAttributes == null)
+ return false;
+ return methodAttributes.isMethodReadOnly(methodName);
+ }
+
+ /**
+ * Is this method a read-only method
+ *
+ * @param method the method
+ * @return true for read only
+ */
+ public boolean isMethodReadOnly(Method method)
+ {
+ if (method == null)
+ return false;
+ return isMethodReadOnly(method.getName());
+ }
+
+ /**
+ * Get the transaction timeout for the method
+ *
+ * @param methodName the method name
+ * @return the transaction timeout
+ */
+ public int getMethodTransactionTimeout(String methodName)
+ {
+ if (methodAttributes == null)
+ return 0;
+ return methodAttributes.getMethodTransactionTimeout(methodName);
+ }
+
+ /**
+ * Get the transaction timeout for the method
+ *
+ * @param method the method
+ * @return the transaction timeout
+ */
+ public int getMethodTransactionTimeout(Method method)
+ {
+ if (method == null)
+ return 0;
+ return getMethodTransactionTimeout(method.getName());
+ }
+
+ /**
+ * Get the securityIdentity.
+ *
+ * @return the securityIdentity.
+ */
+ public SecurityIdentityMetaData getSecurityIdentity()
+ {
+ return securityIdentity;
+ }
+
+ /**
+ * Set the securityIdentity.
+ *
+ * @param securityIdentity the securityIdentity.
+ * @throws IllegalArgumentException for a null securityIdentity
+ */
+ public void setSecurityIdentity(SecurityIdentityMetaData securityIdentity)
+ {
+ if (securityIdentity == null)
+ throw new IllegalArgumentException("Null securityIdentity");
+ this.securityIdentity = securityIdentity;
+ }
+
+ @Override
+ public void merge(NamedMetaData override, NamedMetaData original)
+ {
+ throw new RuntimeException("wrong merge method called");
+ }
+
+ public void merge(JBossEnterpriseBeanMetaData override, EnterpriseBeanMetaData original)
+ {
+ this.merge(override, original, "jboss.xml", "ejb-jar.xml", true);
+ }
+ public void merge(JBossEnterpriseBeanMetaData override, EnterpriseBeanMetaData original,
+ String overrideFile, String overridenFile, boolean mustOverride)
+ {
+ super.merge(override, original);
+ if(override != null && override.getEjbClass() != null)
+ setEjbClass(override.getEjbClass());
+ else if(original != null && original.getEjbClass() != null)
+ setEjbClass(original.getEjbClass());
+ if(override != null && override.getName() != null)
+ setName(override.getName());
+ else if(original != null && original.getName() != null)
+ setName(original.getName());
+ if(override != null && override.getMappedName() != null)
+ setMappedName(override.getMappedName());
+ else if(original != null && original.getMappedName() != null)
+ setMappedName(original.getMappedName());
+
+ // transactionType
+ if(override != null && override.getTransactionType() != null)
+ transactionType = override.getTransactionType();
+ else if(original != null && original.getTransactionType() != null)
+ transactionType = original.getTransactionType();
+
+ if(override != null)
+ {
+ if(override.getAopDomainName() != null)
+ setAopDomainName(override.getAopDomainName());
+ if(override.getConfigurationName() != null)
+ setConfigurationName(override.getConfigurationName());
+ if(override.getAnnotations() != null)
+ setAnnotations(override.getAnnotations());
+ if(override.getDepends() != null)
+ setDepends(override.getDepends());
+ setExceptionOnRollback(override.isExceptionOnRollback());
+ if(override.getIgnoreDependency() != null)
+ setIgnoreDependency(override.getIgnoreDependency());
+ if(override.getInvokerBindings() != null)
+ setInvokerBindings(override.getInvokerBindings());
+ if(override.getIorSecurityConfig() != null)
+ setIorSecurityConfig(override.getIorSecurityConfig());
+ if(override.getSecurityProxy() != null)
+ setSecurityProxy(override.getSecurityProxy());
+ }
+
+ if(this.jndiEnvironmentRefsGroup == null)
+ jndiEnvironmentRefsGroup = new JBossEnvironmentRefsGroupMetaData();
+ Environment env = original != null ? original.getJndiEnvironmentRefsGroup() : null;
+ JBossEnvironmentRefsGroupMetaData jenv = null;
+ ResourceManagersMetaData resourceMgrs = this.getJBossMetaData().getResourceManagers();
+ if( override != null )
+ {
+ ResourceManagersMetaData resourceMgrsOverride = override.getJBossMetaData().getResourceManagers();
+ if(resourceMgrsOverride != null)
+ resourceMgrs = resourceMgrsOverride;
+ jenv = (JBossEnvironmentRefsGroupMetaData) override.getJndiEnvironmentRefsGroup();
+ }
+ jndiEnvironmentRefsGroup.merge(jenv, env, resourceMgrs, overridenFile, overrideFile, mustOverride);
+
+ // Fixup the invoker binding references on ejb refs
+ InvokerBindingsMetaData invokerBindings = getInvokerBindings();
+ if (invokerBindings != null && invokerBindings.isEmpty() == false)
+ {
+ for (InvokerBindingMetaData invokerBinding : invokerBindings)
+ {
+ if(invokerBinding.getEjbRefs() != null)
+ {
+ for(InvokerBindingMetaData.EjbRef ejbRef : invokerBinding.getEjbRefs())
+ {
+ EJBReferenceMetaData targetEjbRef = jndiEnvironmentRefsGroup.getEjbReferenceByName(ejbRef.getEjbRefName());
+ if (targetEjbRef == null)
+ throw new IllegalStateException("ejb-ref " + ejbRef.getEjbRefName() + " found on invoker " + invokerBinding.getName() + " but it does not exist for ejb: " + getName());
+ targetEjbRef.addInvokerBinding(invokerBinding.getName(), ejbRef.getJndiName());
+ }
+ }
+ }
+ }
+
+ // Fixup the security identity
+ SecurityIdentityMetaData jbossSecurityIdentity = null;
+ if (override != null && override.getSecurityIdentity() != null)
+ jbossSecurityIdentity = override.getSecurityIdentity();
+ SecurityIdentityMetaData originalSecurityIdentity = null;
+ if(original != null)
+ originalSecurityIdentity = original.getSecurityIdentity();
+ if(jbossSecurityIdentity != null || originalSecurityIdentity != null)
+ {
+ if(securityIdentity == null)
+ securityIdentity = new SecurityIdentityMetaData();
+ securityIdentity.merge(jbossSecurityIdentity, originalSecurityIdentity);
+ }
+ }
+
+ public void checkValid()
+ {
+ }
+
+ /**
+ * Get the assembly descriptor
+ *
+ * @return the ejbJarMetaData.
+ */
+ protected JBossAssemblyDescriptorMetaData getAssemblyDescriptor()
+ {
+ JBossMetaData ejbJar = getEjbJarMetaData();
+ if (ejbJar == null)
+ return null;
+ return ejbJar.getAssemblyDescriptor();
+ }
+
+ public String getJndiBindingPolicy()
+ {
+ return jndiBindingPolicy;
+ }
+
+ public void setJndiBindingPolicy(String jndiBindingPolicy)
+ {
+ this.jndiBindingPolicy = jndiBindingPolicy;
+ }
+}
Deleted: projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossEntityBeanMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/ejb/jboss/JBossEntityBeanMetaData.java 2008-05-07 21:59:24 UTC (rev 73125)
+++ projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossEntityBeanMetaData.java 2008-05-08 00:46:24 UTC (rev 73129)
@@ -1,843 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.metadata.ejb.jboss;
-
-import org.jboss.metadata.ejb.jboss.jndipolicy.spi.EjbDeploymentSummary;
-import org.jboss.metadata.ejb.spec.CMPFieldsMetaData;
-import org.jboss.metadata.ejb.spec.EnterpriseBeanMetaData;
-import org.jboss.metadata.ejb.spec.EntityBeanMetaData;
-import org.jboss.metadata.ejb.spec.PersistenceType;
-import org.jboss.metadata.ejb.spec.QueriesMetaData;
-import org.jboss.metadata.javaee.spec.SecurityRoleRefsMetaData;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-/**
- * EntityBeanMetaData.
- *
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @author Scott.Stark at jboss.org
- * @version $Revision$
- */
- at XmlType(name="jboss-entity-beanType")
-public class JBossEntityBeanMetaData extends JBossEnterpriseBeanMetaData
-{
- /** The serialVersionUID */
- private static final long serialVersionUID = -6869794514744015588L;
-
- /** The home interface */
- private String home;
-
- /** The remote interface */
- private String remote;
-
- /** The local home */
- private String localHome;
-
- /** The local */
- private String local;
-
- /** The persistence type */
- private PersistenceType persistenceType;
-
- /** The primary key class */
- private String primKeyClass;
-
- /** The reentrant */
- private boolean reentrant;
-
- /** The cmp version */
- private String cmpVersion;
-
- /** The abstract schema name */
- private String abstractSchemaName;
-
- /** The cmp fields */
- private CMPFieldsMetaData cmpFields;
-
- /** The primary key field */
- private String primKeyField;
-
- /** The security role refs */
- private SecurityRoleRefsMetaData securityRoleRefs;
-
- /** The queries */
- private QueriesMetaData queries;
-
- /** The jndi name */
- private String jndiName;
-
- /** Whether to call by value */
- private boolean callByValue;
-
- /** Whether this bean is clustered */
- private boolean clustered;
-
- /** Read only */
- private boolean readOnly;
-
- /** The cluster config */
- private ClusterConfigMetaData clusterConfig;
-
- /** The determined cluster config */
- private transient ClusterConfigMetaData determinedClusterConfig;
-
- /** Cache invalidation */
- private boolean cacheInvalidation;
-
- /** The cache invalidation config */
- private CacheInvalidationConfigMetaData cacheInvalidationConfig;
-
- /** The determined cache invalidation config */
- private transient CacheInvalidationConfigMetaData determinedCacheInvalidationConfig;
-
- // TODO DOM cache-config
-
- /**
- * Create a new EntityBeanMetaData.
- */
- public JBossEntityBeanMetaData()
- {
- // For serialization
- }
-
- @Override
- public boolean isEntity()
- {
- return true;
- }
-
- /**
- * Get the home.
- *
- * @return the home.
- */
- public String getHome()
- {
- return home;
- }
-
- /**
- * Set the home.
- *
- * @param home the home.
- * @throws IllegalArgumentException for a null home
- */
- public void setHome(String home)
- {
- if (home == null)
- throw new IllegalArgumentException("Null home");
- this.home = home;
- }
-
- /**
- * Get the remote.
- *
- * @return the remote.
- */
- public String getRemote()
- {
- return remote;
- }
-
- /**
- * Set the remote.
- *
- * @param remote the remote.
- * @throws IllegalArgumentException for a null remote
- */
- public void setRemote(String remote)
- {
- if (remote == null)
- throw new IllegalArgumentException("Null remote");
- this.remote = remote;
- }
-
- /**
- * Get the localHome.
- *
- * @return the localHome.
- */
- public String getLocalHome()
- {
- return localHome;
- }
-
- /**
- * Set the localHome.
- *
- * @param localHome the localHome.
- * @throws IllegalArgumentException for a null localHome
- */
- public void setLocalHome(String localHome)
- {
- if (localHome == null)
- throw new IllegalArgumentException("Null localHome");
- this.localHome = localHome;
- }
-
- /**
- * Get the local.
- *
- * @return the local.
- */
- public String getLocal()
- {
- return local;
- }
-
- /**
- * Set the local.
- *
- * @param local the local.
- * @throws IllegalArgumentException for a null local
- */
- public void setLocal(String local)
- {
- if (local == null)
- throw new IllegalArgumentException("Null local");
- this.local = local;
- }
-
- /**
- * Is this container managed persistence
- *
- * @return true for cmp
- */
- public boolean isCMP()
- {
- if (persistenceType == null)
- return true;
- return persistenceType == PersistenceType.Container;
- }
-
- /**
- * Is this bean managed persistence
- *
- * @return true for bmp
- */
- public boolean isBMP()
- {
- return isCMP() == false;
- }
-
- /**
- * Get the persistenceType.
- *
- * @return the persistenceType.
- */
- public PersistenceType getPersistenceType()
- {
- return persistenceType;
- }
-
- /**
- * Set the persistenceType.
- *
- * @param persistenceType the persistenceType.
- * @throws IllegalArgumentException for a null persistenceType
- */
- public void setPersistenceType(PersistenceType persistenceType)
- {
- if (persistenceType == null)
- throw new IllegalArgumentException("Null persistenceType");
- this.persistenceType = persistenceType;
- }
-
- /**
- * Get the primKeyClass.
- *
- * @return the primKeyClass.
- */
- public String getPrimKeyClass()
- {
- return primKeyClass;
- }
-
- /**
- * Set the primKeyClass.
- *
- * @param primKeyClass the primKeyClass.
- * @throws IllegalArgumentException for a null primKeyClass
- */
- public void setPrimKeyClass(String primKeyClass)
- {
- if (primKeyClass == null)
- throw new IllegalArgumentException("Null primKeyClass");
- this.primKeyClass = primKeyClass;
- }
-
- /**
- * Get the reentrant.
- *
- * @return the reentrant.
- */
- public boolean isReentrant()
- {
- return reentrant;
- }
-
- /**
- * Set the reentrant.
- *
- * @param reentrant the reentrant.
- */
- public void setReentrant(boolean reentrant)
- {
- this.reentrant = reentrant;
- }
-
- /**
- * Whether it is CMP1x
- *
- * @return true for cmp1x
- */
- public boolean isCMP1x()
- {
- if(cmpVersion == null)
- {
- if(getEjbJarMetaData().isEJB2x() || getEjbJarMetaData().isEJB3x())
- return false;
- else
- return true;
- }
- return "1.x".equals(cmpVersion);
- }
-
- /**
- * Get the cmpVersion.
- *
- * @return the cmpVersion.
- */
- public String getCmpVersion()
- {
- return cmpVersion;
- }
-
- /**
- * Set the cmpVersion.
- *
- * @param cmpVersion the cmpVersion.
- * @throws IllegalArgumentException for a null cmpVersion
- */
- public void setCmpVersion(String cmpVersion)
- {
- if (cmpVersion == null)
- throw new IllegalArgumentException("Null cmpVersion");
- this.cmpVersion = cmpVersion;
- }
-
- /**
- * Get the abstractSchemaName.
- *
- * @return the abstractSchemaName.
- */
- public String getAbstractSchemaName()
- {
- return abstractSchemaName;
- }
-
- /**
- * Set the abstractSchemaName.
- *
- * @param abstractSchemaName the abstractSchemaName.
- * @throws IllegalArgumentException for a null abstractSchemaName
- */
- public void setAbstractSchemaName(String abstractSchemaName)
- {
- if (abstractSchemaName == null)
- throw new IllegalArgumentException("Null abstractSchemaName");
- this.abstractSchemaName = abstractSchemaName;
- }
-
- /**
- * Get the primKeyField.
- *
- * @return the primKeyField.
- */
- public String getPrimKeyField()
- {
- return primKeyField;
- }
-
- /**
- * Set the primKeyField.
- *
- * @param primKeyField the primKeyField.
- * @throws IllegalArgumentException for a null primKeyField
- */
- @XmlElement(name="primkey-field")
- public void setPrimKeyField(String primKeyField)
- {
- if (primKeyField == null)
- throw new IllegalArgumentException("Null primKeyField");
- this.primKeyField = primKeyField;
- }
-
- /**
- * Get the cmpFields.
- *
- * @return the cmpFields.
- */
- public CMPFieldsMetaData getCmpFields()
- {
- return cmpFields;
- }
-
- /**
- * Set the cmpFields.
- *
- * @param cmpFields the cmpFields.
- * @throws IllegalArgumentException for a null cmpFields
- */
- @XmlElement(name="cmp-field")
- public void setCmpFields(CMPFieldsMetaData cmpFields)
- {
- if (cmpFields == null)
- throw new IllegalArgumentException("Null cmpFields");
- this.cmpFields = cmpFields;
- }
-
- /**
- * Get the securityRoleRefs.
- *
- * @return the securityRoleRefs.
- */
- public SecurityRoleRefsMetaData getSecurityRoleRefs()
- {
- return securityRoleRefs;
- }
-
- /**
- * Set the securityRoleRefs.
- *
- * @param securityRoleRefs the securityRoleRefs.
- * @throws IllegalArgumentException for a null securityRoleRefs
- */
- @XmlElement(name="security-role-ref")
- public void setSecurityRoleRefs(SecurityRoleRefsMetaData securityRoleRefs)
- {
- if (securityRoleRefs == null)
- throw new IllegalArgumentException("Null securityRoleRefs");
- this.securityRoleRefs = securityRoleRefs;
- }
-
- /**
- * Get the queries.
- *
- * @return the queries.
- */
- public QueriesMetaData getQueries()
- {
- return queries;
- }
-
- /**
- * Set the queries.
- *
- * @param queries the queries.
- * @throws IllegalArgumentException for a null queries
- */
- @XmlElement(name="query")
- public void setQueries(QueriesMetaData queries)
- {
- if (queries == null)
- throw new IllegalArgumentException("Null queries");
- this.queries = queries;
- }
-
- @Override
- public String getDefaultConfigurationName()
- {
- boolean isCMP = isCMP();
- boolean isCMP1x = isCMP1x();
-
- if (isCMP)
- {
- if (isCMP1x)
- {
- if (isClustered())
- return ContainerConfigurationMetaData.CLUSTERED_CMP_1x;
- else
- return ContainerConfigurationMetaData.CMP_1x;
- }
- else
- {
- if (isClustered())
- return ContainerConfigurationMetaData.CLUSTERED_CMP_2x;
- else
- return ContainerConfigurationMetaData.CMP_2x;
- }
- }
- else
- {
- if (isClustered())
- return ContainerConfigurationMetaData.CLUSTERED_BMP;
- else
- return ContainerConfigurationMetaData.BMP;
- }
- }
-
- @Override
- public String getDefaultInvokerName()
- {
- boolean isCMP = isCMP();
- boolean isCMP1x = isCMP1x();
- if (isCMP)
- {
- if (isCMP1x)
- {
- if (isClustered())
- return InvokerBindingMetaData.CLUSTERED_CMP_1x;
- else
- return InvokerBindingMetaData.CMP_1x;
- }
- else
- {
- if (isClustered())
- return InvokerBindingMetaData.CLUSTERED_CMP_2x;
- else
- return InvokerBindingMetaData.CMP_2x;
- }
- }
- else
- {
- if (isClustered())
- return InvokerBindingMetaData.CLUSTERED_BMP;
- else
- return InvokerBindingMetaData.BMP;
- }
- }
-
- /**
- * Get the jndiName.
- *
- * @return the jndiName.
- */
- public String getJndiName()
- {
- return jndiName;
- }
-
- /**
- * Set the jndiName.
- *
- * @param jndiName the jndiName.
- * @throws IllegalArgumentException for a null jndiName
- */
- public void setJndiName(String jndiName)
- {
- if (jndiName == null)
- throw new IllegalArgumentException("Null jndiName");
- this.jndiName = jndiName;
- }
-
- /**
- * Determine the jndi name
- *
- * @return the jndi name
- */
- public String determineJndiName()
- {
- if (jndiName != null)
- return jndiName;
-
- String mapped = getMappedName();
- if (mapped != null)
- return mapped;
- return getEjbName();
- }
-
- @Override
- public String getContainerObjectNameJndiName()
- {
- boolean remote = false;
- if (getHome() != null)
- remote = true;
- return remote ? determineJndiName() : getLocalJndiName();
- }
-
- @Override
- protected String getDefaultInvokerJndiName()
- {
- return determineJndiName();
- }
-
- /**
- * Get the callByValue.
- *
- * @return the callByValue.
- */
- public boolean isCallByValue()
- {
- return callByValue;
- }
-
- /**
- * Set the callByValue.
- *
- * @param callByValue the callByValue.
- */
- public void setCallByValue(boolean callByValue)
- {
- this.callByValue = callByValue;
- }
-
- /**
- * Get the clustered.
- *
- * @return the clustered.
- */
- public boolean isClustered()
- {
- return clustered;
- }
-
- /**
- * Set the clustered.
- *
- * @param clustered the clustered.
- */
- public void setClustered(boolean clustered)
- {
- this.clustered = clustered;
- }
-
- /**
- * Get the readOnly.
- *
- * @return the readOnly.
- */
- public boolean isReadOnly()
- {
- return readOnly;
- }
-
- /**
- * Set the readOnly.
- *
- * @param readOnly the readOnly.
- */
- public void setReadOnly(boolean readOnly)
- {
- this.readOnly = readOnly;
- }
-
- /**
- * Get the clusterConfig.
- *
- * @return the clusterConfig.
- */
- public ClusterConfigMetaData getClusterConfig()
- {
- return clusterConfig;
- }
-
- /**
- * Determine the clusterConfig.
- *
- * @return the clusterConfig.
- */
- public ClusterConfigMetaData determineClusterConfig()
- {
- if (determinedClusterConfig == null)
- {
- ClusterConfigMetaData containerDefaults = null;
- ContainerConfigurationMetaData container = determineContainerConfiguration();
- if (container != null)
- containerDefaults = container.getClusterConfig();
- determinedClusterConfig = new ClusterConfigMetaData();
- determinedClusterConfig.merge(clusterConfig, containerDefaults);
- }
- return determinedClusterConfig;
- }
-
- /**
- * Set the clusterConfig.
- *
- * @param clusterConfig the clusterConfig.
- * @throws IllegalArgumentException for a null clusterConfig
- */
- public void setClusterConfig(ClusterConfigMetaData clusterConfig)
- {
- if (clusterConfig == null)
- throw new IllegalArgumentException("Null clusterConfig");
- this.clusterConfig = clusterConfig;
- }
-
- /**
- * Get the cacheInvalidation.
- *
- * @return the cacheInvalidation.
- */
- public boolean isCacheInvalidation()
- {
- return cacheInvalidation;
- }
-
- /**
- * Set the cacheInvalidation.
- *
- * @param cacheInvalidation the cacheInvalidation.
- */
- public void setCacheInvalidation(boolean cacheInvalidation)
- {
- this.cacheInvalidation = cacheInvalidation;
- }
-
- /**
- * Get the cacheInvalidationConfig.
- *
- * @return the cacheInvalidationConfig.
- */
- public CacheInvalidationConfigMetaData getCacheInvalidationConfig()
- {
- return cacheInvalidationConfig;
- }
-
- /**
- * Get the cacheInvalidationConfig.
- *
- * @return the cacheInvalidationConfig.
- */
- public CacheInvalidationConfigMetaData determineCacheInvalidationConfig()
- {
- // JBAS-5201 Don't return null
- if (cacheInvalidationConfig == null)
- {
- if (determinedCacheInvalidationConfig == null)
- {
- CacheInvalidationConfigMetaData md = new CacheInvalidationConfigMetaData();
- md.setEntityBean(this);
- determinedCacheInvalidationConfig = md;
- }
- return determinedCacheInvalidationConfig;
- }
- return cacheInvalidationConfig;
- }
-
- /**
- * Set the cacheInvalidationConfig.
- *
- * @param cacheInvalidationConfig the cacheInvalidationConfig.
- * @throws IllegalArgumentException for a null cacheInvalidationConfig
- */
- public void setCacheInvalidationConfig(CacheInvalidationConfigMetaData cacheInvalidationConfig)
- {
- if (cacheInvalidationConfig == null)
- throw new IllegalArgumentException("Null cacheInvalidationConfig");
- cacheInvalidationConfig.setEntityBean(this);
- this.cacheInvalidationConfig = cacheInvalidationConfig;
- }
-
- @Override
- public void merge(JBossEnterpriseBeanMetaData override, EnterpriseBeanMetaData original, String overridenFile, String overrideFile, boolean mustOverride)
- {
- super.merge(override, original, overridenFile, overrideFile, mustOverride);
- JBossEntityBeanMetaData joverride = (JBossEntityBeanMetaData) override;
- EntityBeanMetaData soriginal = (EntityBeanMetaData) original;
-
- // home
- if(joverride != null && joverride.home != null)
- home = joverride.home;
- else if(soriginal != null && soriginal.getHome() != null)
- home = soriginal.getHome();
- // remote
- if(joverride != null && joverride.remote != null)
- remote = joverride.remote;
- else if(soriginal != null && soriginal.getRemote() != null)
- remote = soriginal.getRemote();
- // localHome
- if(joverride != null && joverride.localHome != null)
- localHome = joverride.localHome;
- else if(soriginal != null && soriginal.getLocalHome() != null)
- localHome = soriginal.getLocalHome();
- // local
- if(joverride != null && joverride.local != null)
- local = joverride.local;
- else if(soriginal != null && soriginal.getLocal() != null)
- local = soriginal.getLocal();
- // persistenceType
- if(joverride != null && joverride.persistenceType != null)
- persistenceType = joverride.persistenceType;
- else if(soriginal != null && soriginal.getPersistenceType() != null)
- persistenceType = soriginal.getPersistenceType();
- // primKeyClass
- if(joverride != null && joverride.primKeyClass != null)
- primKeyClass = joverride.primKeyClass;
- else if(soriginal != null && soriginal.getPrimKeyClass() != null)
- primKeyClass = soriginal.getPrimKeyClass();
- // reentrant
- if(soriginal != null)
- reentrant = soriginal.isReentrant();
- // cmpVersion
- if(joverride != null && joverride.cmpVersion != null)
- cmpVersion = joverride.cmpVersion;
- else if(soriginal != null && soriginal.getCmpVersion() != null)
- cmpVersion = soriginal.getCmpVersion();
- // abstractSchemaName
- if(joverride != null && joverride.abstractSchemaName != null)
- abstractSchemaName = joverride.abstractSchemaName;
- else if(soriginal != null && soriginal.getAbstractSchemaName() != null)
- abstractSchemaName = soriginal.getAbstractSchemaName();
- // cmpFields
- if(joverride != null && joverride.cmpFields != null)
- cmpFields = joverride.cmpFields;
- else if(soriginal != null && soriginal.getCmpFields() != null)
- cmpFields = soriginal.getCmpFields();
- // primKeyField
- if(joverride != null && joverride.primKeyField != null)
- primKeyField = joverride.primKeyField;
- else if(soriginal != null && soriginal.getPrimKeyField() != null)
- primKeyField = soriginal.getPrimKeyField();
- // securityRoleRefs
- if(joverride != null && joverride.securityRoleRefs != null)
- securityRoleRefs = joverride.securityRoleRefs;
- else if(soriginal != null && soriginal.getSecurityRoleRefs() != null)
- securityRoleRefs = soriginal.getSecurityRoleRefs();
- // queries
- if(joverride != null && joverride.queries != null)
- queries = joverride.queries;
- else if(soriginal != null && soriginal.getQueries() != null)
- queries = soriginal.getQueries();
-
- // jndiName
- if(joverride != null && joverride.jndiName != null)
- jndiName = joverride.jndiName;
- else if(soriginal != null && soriginal.getMappedName() != null)
- jndiName = soriginal.getMappedName();
- // callByValue
- if(joverride != null)
- callByValue = joverride.callByValue;
- // clustered
- if(joverride != null)
- clustered = joverride.clustered;
- // readOnly
- if(joverride != null)
- readOnly = joverride.readOnly;
- // clusterConfig
- if(joverride != null && joverride.clusterConfig != null)
- clusterConfig = joverride.clusterConfig;
- }
-
-}
Copied: projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossEntityBeanMetaData.java (from rev 73126, projects/metadata/trunk/src/main/java/org/jboss/metadata/ejb/jboss/JBossEntityBeanMetaData.java)
===================================================================
--- projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossEntityBeanMetaData.java (rev 0)
+++ projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossEntityBeanMetaData.java 2008-05-08 00:46:24 UTC (rev 73129)
@@ -0,0 +1,842 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.metadata.ejb.jboss;
+
+import org.jboss.metadata.ejb.spec.CMPFieldsMetaData;
+import org.jboss.metadata.ejb.spec.EnterpriseBeanMetaData;
+import org.jboss.metadata.ejb.spec.EntityBeanMetaData;
+import org.jboss.metadata.ejb.spec.PersistenceType;
+import org.jboss.metadata.ejb.spec.QueriesMetaData;
+import org.jboss.metadata.javaee.spec.SecurityRoleRefsMetaData;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * EntityBeanMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+ at XmlType(name="jboss-entity-beanType")
+public class JBossEntityBeanMetaData extends JBossEnterpriseBeanMetaData
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -6869794514744015588L;
+
+ /** The home interface */
+ private String home;
+
+ /** The remote interface */
+ private String remote;
+
+ /** The local home */
+ private String localHome;
+
+ /** The local */
+ private String local;
+
+ /** The persistence type */
+ private PersistenceType persistenceType;
+
+ /** The primary key class */
+ private String primKeyClass;
+
+ /** The reentrant */
+ private boolean reentrant;
+
+ /** The cmp version */
+ private String cmpVersion;
+
+ /** The abstract schema name */
+ private String abstractSchemaName;
+
+ /** The cmp fields */
+ private CMPFieldsMetaData cmpFields;
+
+ /** The primary key field */
+ private String primKeyField;
+
+ /** The security role refs */
+ private SecurityRoleRefsMetaData securityRoleRefs;
+
+ /** The queries */
+ private QueriesMetaData queries;
+
+ /** The jndi name */
+ private String jndiName;
+
+ /** Whether to call by value */
+ private boolean callByValue;
+
+ /** Whether this bean is clustered */
+ private boolean clustered;
+
+ /** Read only */
+ private boolean readOnly;
+
+ /** The cluster config */
+ private ClusterConfigMetaData clusterConfig;
+
+ /** The determined cluster config */
+ private transient ClusterConfigMetaData determinedClusterConfig;
+
+ /** Cache invalidation */
+ private boolean cacheInvalidation;
+
+ /** The cache invalidation config */
+ private CacheInvalidationConfigMetaData cacheInvalidationConfig;
+
+ /** The determined cache invalidation config */
+ private transient CacheInvalidationConfigMetaData determinedCacheInvalidationConfig;
+
+ // TODO DOM cache-config
+
+ /**
+ * Create a new EntityBeanMetaData.
+ */
+ public JBossEntityBeanMetaData()
+ {
+ // For serialization
+ }
+
+ @Override
+ public boolean isEntity()
+ {
+ return true;
+ }
+
+ /**
+ * Get the home.
+ *
+ * @return the home.
+ */
+ public String getHome()
+ {
+ return home;
+ }
+
+ /**
+ * Set the home.
+ *
+ * @param home the home.
+ * @throws IllegalArgumentException for a null home
+ */
+ public void setHome(String home)
+ {
+ if (home == null)
+ throw new IllegalArgumentException("Null home");
+ this.home = home;
+ }
+
+ /**
+ * Get the remote.
+ *
+ * @return the remote.
+ */
+ public String getRemote()
+ {
+ return remote;
+ }
+
+ /**
+ * Set the remote.
+ *
+ * @param remote the remote.
+ * @throws IllegalArgumentException for a null remote
+ */
+ public void setRemote(String remote)
+ {
+ if (remote == null)
+ throw new IllegalArgumentException("Null remote");
+ this.remote = remote;
+ }
+
+ /**
+ * Get the localHome.
+ *
+ * @return the localHome.
+ */
+ public String getLocalHome()
+ {
+ return localHome;
+ }
+
+ /**
+ * Set the localHome.
+ *
+ * @param localHome the localHome.
+ * @throws IllegalArgumentException for a null localHome
+ */
+ public void setLocalHome(String localHome)
+ {
+ if (localHome == null)
+ throw new IllegalArgumentException("Null localHome");
+ this.localHome = localHome;
+ }
+
+ /**
+ * Get the local.
+ *
+ * @return the local.
+ */
+ public String getLocal()
+ {
+ return local;
+ }
+
+ /**
+ * Set the local.
+ *
+ * @param local the local.
+ * @throws IllegalArgumentException for a null local
+ */
+ public void setLocal(String local)
+ {
+ if (local == null)
+ throw new IllegalArgumentException("Null local");
+ this.local = local;
+ }
+
+ /**
+ * Is this container managed persistence
+ *
+ * @return true for cmp
+ */
+ public boolean isCMP()
+ {
+ if (persistenceType == null)
+ return true;
+ return persistenceType == PersistenceType.Container;
+ }
+
+ /**
+ * Is this bean managed persistence
+ *
+ * @return true for bmp
+ */
+ public boolean isBMP()
+ {
+ return isCMP() == false;
+ }
+
+ /**
+ * Get the persistenceType.
+ *
+ * @return the persistenceType.
+ */
+ public PersistenceType getPersistenceType()
+ {
+ return persistenceType;
+ }
+
+ /**
+ * Set the persistenceType.
+ *
+ * @param persistenceType the persistenceType.
+ * @throws IllegalArgumentException for a null persistenceType
+ */
+ public void setPersistenceType(PersistenceType persistenceType)
+ {
+ if (persistenceType == null)
+ throw new IllegalArgumentException("Null persistenceType");
+ this.persistenceType = persistenceType;
+ }
+
+ /**
+ * Get the primKeyClass.
+ *
+ * @return the primKeyClass.
+ */
+ public String getPrimKeyClass()
+ {
+ return primKeyClass;
+ }
+
+ /**
+ * Set the primKeyClass.
+ *
+ * @param primKeyClass the primKeyClass.
+ * @throws IllegalArgumentException for a null primKeyClass
+ */
+ public void setPrimKeyClass(String primKeyClass)
+ {
+ if (primKeyClass == null)
+ throw new IllegalArgumentException("Null primKeyClass");
+ this.primKeyClass = primKeyClass;
+ }
+
+ /**
+ * Get the reentrant.
+ *
+ * @return the reentrant.
+ */
+ public boolean isReentrant()
+ {
+ return reentrant;
+ }
+
+ /**
+ * Set the reentrant.
+ *
+ * @param reentrant the reentrant.
+ */
+ public void setReentrant(boolean reentrant)
+ {
+ this.reentrant = reentrant;
+ }
+
+ /**
+ * Whether it is CMP1x
+ *
+ * @return true for cmp1x
+ */
+ public boolean isCMP1x()
+ {
+ if(cmpVersion == null)
+ {
+ if(getEjbJarMetaData().isEJB2x() || getEjbJarMetaData().isEJB3x())
+ return false;
+ else
+ return true;
+ }
+ return "1.x".equals(cmpVersion);
+ }
+
+ /**
+ * Get the cmpVersion.
+ *
+ * @return the cmpVersion.
+ */
+ public String getCmpVersion()
+ {
+ return cmpVersion;
+ }
+
+ /**
+ * Set the cmpVersion.
+ *
+ * @param cmpVersion the cmpVersion.
+ * @throws IllegalArgumentException for a null cmpVersion
+ */
+ public void setCmpVersion(String cmpVersion)
+ {
+ if (cmpVersion == null)
+ throw new IllegalArgumentException("Null cmpVersion");
+ this.cmpVersion = cmpVersion;
+ }
+
+ /**
+ * Get the abstractSchemaName.
+ *
+ * @return the abstractSchemaName.
+ */
+ public String getAbstractSchemaName()
+ {
+ return abstractSchemaName;
+ }
+
+ /**
+ * Set the abstractSchemaName.
+ *
+ * @param abstractSchemaName the abstractSchemaName.
+ * @throws IllegalArgumentException for a null abstractSchemaName
+ */
+ public void setAbstractSchemaName(String abstractSchemaName)
+ {
+ if (abstractSchemaName == null)
+ throw new IllegalArgumentException("Null abstractSchemaName");
+ this.abstractSchemaName = abstractSchemaName;
+ }
+
+ /**
+ * Get the primKeyField.
+ *
+ * @return the primKeyField.
+ */
+ public String getPrimKeyField()
+ {
+ return primKeyField;
+ }
+
+ /**
+ * Set the primKeyField.
+ *
+ * @param primKeyField the primKeyField.
+ * @throws IllegalArgumentException for a null primKeyField
+ */
+ @XmlElement(name="primkey-field")
+ public void setPrimKeyField(String primKeyField)
+ {
+ if (primKeyField == null)
+ throw new IllegalArgumentException("Null primKeyField");
+ this.primKeyField = primKeyField;
+ }
+
+ /**
+ * Get the cmpFields.
+ *
+ * @return the cmpFields.
+ */
+ public CMPFieldsMetaData getCmpFields()
+ {
+ return cmpFields;
+ }
+
+ /**
+ * Set the cmpFields.
+ *
+ * @param cmpFields the cmpFields.
+ * @throws IllegalArgumentException for a null cmpFields
+ */
+ @XmlElement(name="cmp-field")
+ public void setCmpFields(CMPFieldsMetaData cmpFields)
+ {
+ if (cmpFields == null)
+ throw new IllegalArgumentException("Null cmpFields");
+ this.cmpFields = cmpFields;
+ }
+
+ /**
+ * Get the securityRoleRefs.
+ *
+ * @return the securityRoleRefs.
+ */
+ public SecurityRoleRefsMetaData getSecurityRoleRefs()
+ {
+ return securityRoleRefs;
+ }
+
+ /**
+ * Set the securityRoleRefs.
+ *
+ * @param securityRoleRefs the securityRoleRefs.
+ * @throws IllegalArgumentException for a null securityRoleRefs
+ */
+ @XmlElement(name="security-role-ref")
+ public void setSecurityRoleRefs(SecurityRoleRefsMetaData securityRoleRefs)
+ {
+ if (securityRoleRefs == null)
+ throw new IllegalArgumentException("Null securityRoleRefs");
+ this.securityRoleRefs = securityRoleRefs;
+ }
+
+ /**
+ * Get the queries.
+ *
+ * @return the queries.
+ */
+ public QueriesMetaData getQueries()
+ {
+ return queries;
+ }
+
+ /**
+ * Set the queries.
+ *
+ * @param queries the queries.
+ * @throws IllegalArgumentException for a null queries
+ */
+ @XmlElement(name="query")
+ public void setQueries(QueriesMetaData queries)
+ {
+ if (queries == null)
+ throw new IllegalArgumentException("Null queries");
+ this.queries = queries;
+ }
+
+ @Override
+ public String getDefaultConfigurationName()
+ {
+ boolean isCMP = isCMP();
+ boolean isCMP1x = isCMP1x();
+
+ if (isCMP)
+ {
+ if (isCMP1x)
+ {
+ if (isClustered())
+ return ContainerConfigurationMetaData.CLUSTERED_CMP_1x;
+ else
+ return ContainerConfigurationMetaData.CMP_1x;
+ }
+ else
+ {
+ if (isClustered())
+ return ContainerConfigurationMetaData.CLUSTERED_CMP_2x;
+ else
+ return ContainerConfigurationMetaData.CMP_2x;
+ }
+ }
+ else
+ {
+ if (isClustered())
+ return ContainerConfigurationMetaData.CLUSTERED_BMP;
+ else
+ return ContainerConfigurationMetaData.BMP;
+ }
+ }
+
+ @Override
+ public String getDefaultInvokerName()
+ {
+ boolean isCMP = isCMP();
+ boolean isCMP1x = isCMP1x();
+ if (isCMP)
+ {
+ if (isCMP1x)
+ {
+ if (isClustered())
+ return InvokerBindingMetaData.CLUSTERED_CMP_1x;
+ else
+ return InvokerBindingMetaData.CMP_1x;
+ }
+ else
+ {
+ if (isClustered())
+ return InvokerBindingMetaData.CLUSTERED_CMP_2x;
+ else
+ return InvokerBindingMetaData.CMP_2x;
+ }
+ }
+ else
+ {
+ if (isClustered())
+ return InvokerBindingMetaData.CLUSTERED_BMP;
+ else
+ return InvokerBindingMetaData.BMP;
+ }
+ }
+
+ /**
+ * Get the jndiName.
+ *
+ * @return the jndiName.
+ */
+ public String getJndiName()
+ {
+ return jndiName;
+ }
+
+ /**
+ * Set the jndiName.
+ *
+ * @param jndiName the jndiName.
+ * @throws IllegalArgumentException for a null jndiName
+ */
+ public void setJndiName(String jndiName)
+ {
+ if (jndiName == null)
+ throw new IllegalArgumentException("Null jndiName");
+ this.jndiName = jndiName;
+ }
+
+ /**
+ * Determine the jndi name
+ *
+ * @return the jndi name
+ */
+ public String determineJndiName()
+ {
+ if (jndiName != null)
+ return jndiName;
+
+ String mapped = getMappedName();
+ if (mapped != null)
+ return mapped;
+ return getEjbName();
+ }
+
+ @Override
+ public String getContainerObjectNameJndiName()
+ {
+ boolean remote = false;
+ if (getHome() != null)
+ remote = true;
+ return remote ? determineJndiName() : getLocalJndiName();
+ }
+
+ @Override
+ protected String getDefaultInvokerJndiName()
+ {
+ return determineJndiName();
+ }
+
+ /**
+ * Get the callByValue.
+ *
+ * @return the callByValue.
+ */
+ public boolean isCallByValue()
+ {
+ return callByValue;
+ }
+
+ /**
+ * Set the callByValue.
+ *
+ * @param callByValue the callByValue.
+ */
+ public void setCallByValue(boolean callByValue)
+ {
+ this.callByValue = callByValue;
+ }
+
+ /**
+ * Get the clustered.
+ *
+ * @return the clustered.
+ */
+ public boolean isClustered()
+ {
+ return clustered;
+ }
+
+ /**
+ * Set the clustered.
+ *
+ * @param clustered the clustered.
+ */
+ public void setClustered(boolean clustered)
+ {
+ this.clustered = clustered;
+ }
+
+ /**
+ * Get the readOnly.
+ *
+ * @return the readOnly.
+ */
+ public boolean isReadOnly()
+ {
+ return readOnly;
+ }
+
+ /**
+ * Set the readOnly.
+ *
+ * @param readOnly the readOnly.
+ */
+ public void setReadOnly(boolean readOnly)
+ {
+ this.readOnly = readOnly;
+ }
+
+ /**
+ * Get the clusterConfig.
+ *
+ * @return the clusterConfig.
+ */
+ public ClusterConfigMetaData getClusterConfig()
+ {
+ return clusterConfig;
+ }
+
+ /**
+ * Determine the clusterConfig.
+ *
+ * @return the clusterConfig.
+ */
+ public ClusterConfigMetaData determineClusterConfig()
+ {
+ if (determinedClusterConfig == null)
+ {
+ ClusterConfigMetaData containerDefaults = null;
+ ContainerConfigurationMetaData container = determineContainerConfiguration();
+ if (container != null)
+ containerDefaults = container.getClusterConfig();
+ determinedClusterConfig = new ClusterConfigMetaData();
+ determinedClusterConfig.merge(clusterConfig, containerDefaults);
+ }
+ return determinedClusterConfig;
+ }
+
+ /**
+ * Set the clusterConfig.
+ *
+ * @param clusterConfig the clusterConfig.
+ * @throws IllegalArgumentException for a null clusterConfig
+ */
+ public void setClusterConfig(ClusterConfigMetaData clusterConfig)
+ {
+ if (clusterConfig == null)
+ throw new IllegalArgumentException("Null clusterConfig");
+ this.clusterConfig = clusterConfig;
+ }
+
+ /**
+ * Get the cacheInvalidation.
+ *
+ * @return the cacheInvalidation.
+ */
+ public boolean isCacheInvalidation()
+ {
+ return cacheInvalidation;
+ }
+
+ /**
+ * Set the cacheInvalidation.
+ *
+ * @param cacheInvalidation the cacheInvalidation.
+ */
+ public void setCacheInvalidation(boolean cacheInvalidation)
+ {
+ this.cacheInvalidation = cacheInvalidation;
+ }
+
+ /**
+ * Get the cacheInvalidationConfig.
+ *
+ * @return the cacheInvalidationConfig.
+ */
+ public CacheInvalidationConfigMetaData getCacheInvalidationConfig()
+ {
+ return cacheInvalidationConfig;
+ }
+
+ /**
+ * Get the cacheInvalidationConfig.
+ *
+ * @return the cacheInvalidationConfig.
+ */
+ public CacheInvalidationConfigMetaData determineCacheInvalidationConfig()
+ {
+ // JBAS-5201 Don't return null
+ if (cacheInvalidationConfig == null)
+ {
+ if (determinedCacheInvalidationConfig == null)
+ {
+ CacheInvalidationConfigMetaData md = new CacheInvalidationConfigMetaData();
+ md.setEntityBean(this);
+ determinedCacheInvalidationConfig = md;
+ }
+ return determinedCacheInvalidationConfig;
+ }
+ return cacheInvalidationConfig;
+ }
+
+ /**
+ * Set the cacheInvalidationConfig.
+ *
+ * @param cacheInvalidationConfig the cacheInvalidationConfig.
+ * @throws IllegalArgumentException for a null cacheInvalidationConfig
+ */
+ public void setCacheInvalidationConfig(CacheInvalidationConfigMetaData cacheInvalidationConfig)
+ {
+ if (cacheInvalidationConfig == null)
+ throw new IllegalArgumentException("Null cacheInvalidationConfig");
+ cacheInvalidationConfig.setEntityBean(this);
+ this.cacheInvalidationConfig = cacheInvalidationConfig;
+ }
+
+ @Override
+ public void merge(JBossEnterpriseBeanMetaData override, EnterpriseBeanMetaData original, String overridenFile, String overrideFile, boolean mustOverride)
+ {
+ super.merge(override, original, overridenFile, overrideFile, mustOverride);
+ JBossEntityBeanMetaData joverride = (JBossEntityBeanMetaData) override;
+ EntityBeanMetaData soriginal = (EntityBeanMetaData) original;
+
+ // home
+ if(joverride != null && joverride.home != null)
+ home = joverride.home;
+ else if(soriginal != null && soriginal.getHome() != null)
+ home = soriginal.getHome();
+ // remote
+ if(joverride != null && joverride.remote != null)
+ remote = joverride.remote;
+ else if(soriginal != null && soriginal.getRemote() != null)
+ remote = soriginal.getRemote();
+ // localHome
+ if(joverride != null && joverride.localHome != null)
+ localHome = joverride.localHome;
+ else if(soriginal != null && soriginal.getLocalHome() != null)
+ localHome = soriginal.getLocalHome();
+ // local
+ if(joverride != null && joverride.local != null)
+ local = joverride.local;
+ else if(soriginal != null && soriginal.getLocal() != null)
+ local = soriginal.getLocal();
+ // persistenceType
+ if(joverride != null && joverride.persistenceType != null)
+ persistenceType = joverride.persistenceType;
+ else if(soriginal != null && soriginal.getPersistenceType() != null)
+ persistenceType = soriginal.getPersistenceType();
+ // primKeyClass
+ if(joverride != null && joverride.primKeyClass != null)
+ primKeyClass = joverride.primKeyClass;
+ else if(soriginal != null && soriginal.getPrimKeyClass() != null)
+ primKeyClass = soriginal.getPrimKeyClass();
+ // reentrant
+ if(soriginal != null)
+ reentrant = soriginal.isReentrant();
+ // cmpVersion
+ if(joverride != null && joverride.cmpVersion != null)
+ cmpVersion = joverride.cmpVersion;
+ else if(soriginal != null && soriginal.getCmpVersion() != null)
+ cmpVersion = soriginal.getCmpVersion();
+ // abstractSchemaName
+ if(joverride != null && joverride.abstractSchemaName != null)
+ abstractSchemaName = joverride.abstractSchemaName;
+ else if(soriginal != null && soriginal.getAbstractSchemaName() != null)
+ abstractSchemaName = soriginal.getAbstractSchemaName();
+ // cmpFields
+ if(joverride != null && joverride.cmpFields != null)
+ cmpFields = joverride.cmpFields;
+ else if(soriginal != null && soriginal.getCmpFields() != null)
+ cmpFields = soriginal.getCmpFields();
+ // primKeyField
+ if(joverride != null && joverride.primKeyField != null)
+ primKeyField = joverride.primKeyField;
+ else if(soriginal != null && soriginal.getPrimKeyField() != null)
+ primKeyField = soriginal.getPrimKeyField();
+ // securityRoleRefs
+ if(joverride != null && joverride.securityRoleRefs != null)
+ securityRoleRefs = joverride.securityRoleRefs;
+ else if(soriginal != null && soriginal.getSecurityRoleRefs() != null)
+ securityRoleRefs = soriginal.getSecurityRoleRefs();
+ // queries
+ if(joverride != null && joverride.queries != null)
+ queries = joverride.queries;
+ else if(soriginal != null && soriginal.getQueries() != null)
+ queries = soriginal.getQueries();
+
+ // jndiName
+ if(joverride != null && joverride.jndiName != null)
+ jndiName = joverride.jndiName;
+ else if(soriginal != null && soriginal.getMappedName() != null)
+ jndiName = soriginal.getMappedName();
+ // callByValue
+ if(joverride != null)
+ callByValue = joverride.callByValue;
+ // clustered
+ if(joverride != null)
+ clustered = joverride.clustered;
+ // readOnly
+ if(joverride != null)
+ readOnly = joverride.readOnly;
+ // clusterConfig
+ if(joverride != null && joverride.clusterConfig != null)
+ clusterConfig = joverride.clusterConfig;
+ }
+
+}
Deleted: projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossGenericBeanMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/ejb/jboss/JBossGenericBeanMetaData.java 2008-05-07 21:59:24 UTC (rev 73125)
+++ projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossGenericBeanMetaData.java 2008-05-08 00:46:24 UTC (rev 73129)
@@ -1,94 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2007, Red Hat Middleware LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.metadata.ejb.jboss;
-
-import javax.xml.bind.annotation.XmlType;
-
-import org.jboss.metadata.common.ejb.IEnterpriseBeanMetaData;
-import org.jboss.metadata.javaee.spec.PortComponent;
-
-/**
- * Allow for the specification of an unknown bean type in the deployment
- * descriptor (EJBTHREE-936).
- *
- * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
- * @version $Revision$
- */
- at XmlType(name="jboss-generic-beanType")
-public class JBossGenericBeanMetaData extends JBossEnterpriseBeanMetaData
-{
- private static final long serialVersionUID = 1L;
-
- /** The webservices port-component */
- private PortComponent portComponent;
-
- /* (non-Javadoc)
- * @see org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData#getDefaultConfigurationName()
- */
- @Override
- public String getDefaultConfigurationName()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData#getDefaultInvokerName()
- */
- @Override
- protected String getDefaultInvokerName()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- /**
- * Get the jndiName.
- *
- * @return the jndiName.
- */
- public String getJndiName()
- {
- return super.getMappedName();
- }
-
- /**
- * Set the jndiName.
- *
- * @param jndiName the jndiName.
- * @throws IllegalArgumentException for a null jndiName
- */
- public void setJndiName(String jndiName)
- {
- super.setMappedName(jndiName);
- }
-
- public PortComponent getPortComponent()
- {
- return portComponent;
- }
-
- public void setPortComponent(PortComponent portComponent)
- {
- this.portComponent = portComponent;
- }
-}
Copied: projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossGenericBeanMetaData.java (from rev 73126, projects/metadata/trunk/src/main/java/org/jboss/metadata/ejb/jboss/JBossGenericBeanMetaData.java)
===================================================================
--- projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossGenericBeanMetaData.java (rev 0)
+++ projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossGenericBeanMetaData.java 2008-05-08 00:46:24 UTC (rev 73129)
@@ -0,0 +1,100 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.metadata.ejb.jboss;
+
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.metadata.common.ejb.IEnterpriseBeanMetaData;
+import org.jboss.metadata.javaee.spec.PortComponent;
+
+/**
+ * Allow for the specification of an unknown bean type in the deployment
+ * descriptor (EJBTHREE-936).
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision$
+ */
+ at XmlType(name="jboss-generic-beanType")
+public class JBossGenericBeanMetaData extends JBossEnterpriseBeanMetaData
+{
+ private static final long serialVersionUID = 1L;
+
+ /** The webservices port-component */
+ private PortComponent portComponent;
+
+ /* (non-Javadoc)
+ * @see org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData#getDefaultConfigurationName()
+ */
+ @Override
+ public String getDefaultConfigurationName()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData#getDefaultInvokerName()
+ */
+ @Override
+ protected String getDefaultInvokerName()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String determineJndiName()
+ {
+ return getJndiName();
+ }
+
+ /**
+ * Get the jndiName.
+ *
+ * @return the jndiName.
+ */
+ public String getJndiName()
+ {
+ return super.getMappedName();
+ }
+
+ /**
+ * Set the jndiName.
+ *
+ * @param jndiName the jndiName.
+ * @throws IllegalArgumentException for a null jndiName
+ */
+ public void setJndiName(String jndiName)
+ {
+ super.setMappedName(jndiName);
+ }
+
+ public PortComponent getPortComponent()
+ {
+ return portComponent;
+ }
+
+ public void setPortComponent(PortComponent portComponent)
+ {
+ this.portComponent = portComponent;
+ }
+}
Deleted: projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossMessageDrivenBeanMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/ejb/jboss/JBossMessageDrivenBeanMetaData.java 2008-05-07 21:59:24 UTC (rev 73125)
+++ projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossMessageDrivenBeanMetaData.java 2008-05-08 00:46:24 UTC (rev 73129)
@@ -1,653 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.metadata.ejb.jboss;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-import org.jboss.metadata.ejb.spec.ActivationConfigMetaData;
-import org.jboss.metadata.ejb.spec.AroundInvokesMetaData;
-import org.jboss.metadata.ejb.spec.EnterpriseBeanMetaData;
-import org.jboss.metadata.ejb.spec.MessageDrivenBeanMetaData;
-import org.jboss.metadata.ejb.spec.MessageDrivenDestinationMetaData;
-import org.jboss.metadata.ejb.spec.NamedMethodMetaData;
-import org.jboss.metadata.ejb.spec.SecurityIdentityMetaData;
-import org.jboss.metadata.ejb.spec.SubscriptionDurability;
-
-/**
- * MessageDrivenBeanMetaData.
- *
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @version $Revision: 1.1 $
- */
- at XmlType(name="jboss-message-driven-beanType")
-public class JBossMessageDrivenBeanMetaData extends JBossEnterpriseBeanMetaData
-{
- /** The serialVersionUID */
- private static final long serialVersionUID = -4006016148034278681L;
-
- /** The messaging type */
- private String messagingType;
-
- /** The timeout method */
- private NamedMethodMetaData timeoutMethod;
-
- /** The message destination type */
- private String messageDestinationType;
-
- /** The message destination link */
- private String messageDestinationLink;
-
- /** The activation config */
- private ActivationConfigMetaData activationConfig;
-
- /** The around invokes */
- private AroundInvokesMetaData aroundInvokes;
-
- /** The message selector */
- private String messageSelector;
-
- /** The acknowledge mode */
- private String acknowledgeMode;
-
- /** The subscription durability */
- private SubscriptionDurability subscriptionDurability = SubscriptionDurability.NonDurable;
-
- /** The destination jndi name */
- private String destinationJndiName;
-
- /** The mdb user id */
- private String mdbUser;
-
- /** The mdb password */
- private String mdbPassword;
-
- /** The mdb client id */
- private String mdbClientId;
-
- /** The mdb subscription id */
- private String mdbSubscriptionId;
-
- /** The resource adapter name */
- private String resourceAdapterName;
-
- /** The ejb timeout identity */
- private SecurityIdentityMetaData ejbTimeoutIdentity;
-
- /** The default activation config */
- private ActivationConfigMetaData defaultActivationConfig;
-
- /**
- * Create a new MessageDrivenBeanMetaData.
- */
- public JBossMessageDrivenBeanMetaData()
- {
- // For serialization
- }
-
- @Override
- public boolean isMessageDriven()
- {
- return true;
- }
-
-
- /**
- * Get the messagingType.
- *
- * @return the messagingType.
- */
- public String getMessagingType()
- {
- return messagingType;
- }
-
- /**
- * Is this JMS
- *
- * @return true for jms
- */
- public boolean isJMS()
- {
- String messagingType = getMessagingType();
- return messagingType == null || "javax.jms.MessageListener".equals(messagingType);
- }
-
-
- /**
- * Set the messagingType.
- *
- * @param messagingType the messagingType.
- * @throws IllegalArgumentException for a null messagingType
- */
- public void setMessagingType(String messagingType)
- {
- if (messagingType == null)
- throw new IllegalArgumentException("Null messagingType");
- this.messagingType = messagingType;
- }
-
-
- /**
- * Get the timeoutMethod.
- *
- * @return the timeoutMethod.
- */
- public NamedMethodMetaData getTimeoutMethod()
- {
- return timeoutMethod;
- }
-
-
- /**
- * Set the timeoutMethod.
- *
- * @param timeoutMethod the timeoutMethod.
- * @throws IllegalArgumentException for a null timeoutMethod
- */
- @XmlElement(required=false)
- public void setTimeoutMethod(NamedMethodMetaData timeoutMethod)
- {
- if (timeoutMethod == null)
- throw new IllegalArgumentException("Null timeoutMethod");
- this.timeoutMethod = timeoutMethod;
- }
-
- /**
- * Get the messageDestinationType.
- *
- * @return the messageDestinationType.
- */
- public String getMessageDestinationType()
- {
- return messageDestinationType;
- }
-
-
- /**
- * Set the messageDestinationType.
- *
- * @param messageDestinationType the messageDestinationType.
- * @throws IllegalArgumentException for a null messageDestinationType
- */
- public void setMessageDestinationType(String messageDestinationType)
- {
- if (messageDestinationType == null)
- throw new IllegalArgumentException("Null messageDestinationType");
- this.messageDestinationType = messageDestinationType;
- }
-
-
- /**
- * Get the aroundInvokes.
- *
- * @return the aroundInvokes.
- */
- public AroundInvokesMetaData getAroundInvokes()
- {
- return aroundInvokes;
- }
-
-
- /**
- * Set the aroundInvokes.
- *
- * @param aroundInvokes the aroundInvokes.
- * @throws IllegalArgumentException for a null aroundInvokes
- */
- @XmlElement(name="around-invoke", required=false)
- public void setAroundInvokes(AroundInvokesMetaData aroundInvokes)
- {
- if (aroundInvokes == null)
- throw new IllegalArgumentException("Null aroundInvokes");
- this.aroundInvokes = aroundInvokes;
- }
-
-
- /**
- * Get the messageDestinationLink.
- *
- * @return the messageDestinationLink.
- */
- public String getMessageDestinationLink()
- {
- return messageDestinationLink;
- }
-
-
- /**
- * Set the messageDestinationLink.
- *
- * @param messageDestinationLink the messageDestinationLink.
- * @throws IllegalArgumentException for a null messageDestinationLink
- */
- public void setMessageDestinationLink(String messageDestinationLink)
- {
- if (messageDestinationLink == null)
- throw new IllegalArgumentException("Null messageDestinationLink");
- this.messageDestinationLink = messageDestinationLink;
- }
-
-
- /**
- * Get the activationConfig.
- *
- * @return the activationConfig.
- */
- public ActivationConfigMetaData getActivationConfig()
- {
- return activationConfig;
- }
-
-
- /**
- * Set the activationConfig.
- *
- * @param activationConfig the activationConfig.
- * @throws IllegalArgumentException for a null activationConfig
- */
- public void setActivationConfig(ActivationConfigMetaData activationConfig)
- {
- if (activationConfig == null)
- throw new IllegalArgumentException("Null activationConfig");
- this.activationConfig = activationConfig;
- }
-
- /**
- * Get the messageSelector.
- *
- * @return the messageSelector.
- */
- public String getMessageSelector()
- {
- return messageSelector;
- }
-
- /**
- * Set the messageSelector.
- *
- * @param messageSelector the messageSelector.
- * @throws IllegalArgumentException for a null messageSelector
- */
- @XmlElement(required=false)
- public void setMessageSelector(String messageSelector)
- {
- if (messageSelector == null)
- throw new IllegalArgumentException("Null messageSelector");
- this.messageSelector = messageSelector;
- }
-
- /**
- * Get the acknowledgeMode.
- *
- * @return the acknowledgeMode.
- */
- public String getAcknowledgeMode()
- {
- return acknowledgeMode;
- }
-
- /**
- * Set the acknowledgeMode.
- *
- * @param acknowledgeMode the acknowledgeMode.
- * @throws IllegalArgumentException for a null acknowledgeMode
- */
- @XmlElement(required=false)
- public void setAcknowledgeMode(String acknowledgeMode)
- {
- if (acknowledgeMode == null)
- throw new IllegalArgumentException("Null acknowledgeMode");
- this.acknowledgeMode = acknowledgeMode;
- }
-
- /**
- * Get the subscriptionDurability.
- *
- * @return the subscriptionDurability.
- */
- public SubscriptionDurability getSubscriptionDurability()
- {
- return subscriptionDurability;
- }
-
- /**
- * Set the subscriptionDurability.
- *
- * @param subscriptionDurability the subscriptionDurability.
- * @throws IllegalArgumentException for a null subscriptionDurability
- */
- @XmlElement(required=false)
- public void setSubscriptionDurability(SubscriptionDurability subscriptionDurability)
- {
- if (subscriptionDurability == null)
- throw new IllegalArgumentException("Null subscriptionDurability");
- this.subscriptionDurability = subscriptionDurability;
- }
-
- @XmlElement(name="message-driven-destination", required=false)
- public void setMessageDrivenDestination(MessageDrivenDestinationMetaData mdd)
- {
- // Translate this into destinationType, subscriptionDurability
- this.setMessageDestinationType(mdd.getDestinationType());
- String durability = mdd.getSubscriptionDurability();
- SubscriptionDurability sd = SubscriptionDurability.NonDurable;
- if (durability != null && durability.equalsIgnoreCase("Durable"))
- sd = SubscriptionDurability.Durable;
- this.setSubscriptionDurability(sd);
- }
-
- @Override
- public String getDefaultConfigurationName()
- {
- boolean isJMS = isJMS();
- if (isJMS == false)
- return ContainerConfigurationMetaData.MESSAGE_INFLOW_DRIVEN;
- else
- return ContainerConfigurationMetaData.MESSAGE_DRIVEN;
- }
-
- @Override
- protected String getDefaultInvokerName()
- {
- return InvokerBindingMetaData.MESSAGE_DRIVEN;
- }
-
- @Override
- protected String getDefaultInvokerJndiName()
- {
- return getEjbName();
- }
-
- /**
- * Get the destinationJndiName.
- *
- * @return the destinationJndiName.
- */
- public String getDestinationJndiName()
- {
- return destinationJndiName;
- }
-
- /**
- * Set the destinationJndiName.
- *
- * @param destinationJndiName the destinationJndiName.
- * @throws IllegalArgumentException for a null destinationJndiName
- */
- public void setDestinationJndiName(String destinationJndiName)
- {
- if (destinationJndiName == null)
- throw new IllegalArgumentException("Null destinationJndiName");
- this.destinationJndiName = destinationJndiName;
- }
-
- /**
- * Get the mdbUser.
- *
- * @return the mdbUser.
- */
- public String getMdbUser()
- {
- return mdbUser;
- }
-
- /**
- * Set the mdbUser.
- *
- * @param mdbUser the mdbUser.
- * @throws IllegalArgumentException for a null mdbUser
- */
- public void setMdbUser(String mdbUser)
- {
- if (mdbUser == null)
- throw new IllegalArgumentException("Null mdbUser");
- this.mdbUser = mdbUser;
- }
-
- /**
- * Get the mdbPassword.
- *
- * @return the mdbPassword.
- */
- public String getMdbPassword()
- {
- return mdbPassword;
- }
-
- /**
- * Set the mdbPassword.
- *
- * @param mdbPassword the mdbPassword.
- * @throws IllegalArgumentException for a null mdbPassword
- */
- @XmlElement(name="mdb-passwd")
- public void setMdbPassword(String mdbPassword)
- {
- if (mdbPassword == null)
- throw new IllegalArgumentException("Null mdbPassword");
- this.mdbPassword = mdbPassword;
- }
-
- /**
- * Get the mdbClientId.
- *
- * @return the mdbClientId.
- */
- public String getMdbClientId()
- {
- return mdbClientId;
- }
-
- /**
- * Set the mdbClientId.
- *
- * @param mdbClientId the mdbClientId.
- * @throws IllegalArgumentException for a null mdbClientId
- */
- public void setMdbClientId(String mdbClientId)
- {
- if (mdbClientId == null)
- throw new IllegalArgumentException("Null mdbClientId");
- this.mdbClientId = mdbClientId;
- }
-
- /**
- * Get the resourceAdapterName.
- *
- * @return the resourceAdapterName.
- */
- public String getResourceAdapterName()
- {
- return resourceAdapterName;
- }
-
- /**
- * Set the resourceAdapterName.
- *
- * @param resourceAdapterName the resourceAdapterName.
- * @throws IllegalArgumentException for a null resourceAdapterName
- */
- public void setResourceAdapterName(String resourceAdapterName)
- {
- if (resourceAdapterName == null)
- throw new IllegalArgumentException("Null resourceAdapterName");
- this.resourceAdapterName = resourceAdapterName;
- }
-
- /**
- * Get the mdbSubscriptionId.
- *
- * @return the mdbSubscriptionId.
- */
- public String getMdbSubscriptionId()
- {
- return mdbSubscriptionId;
- }
-
- /**
- * Set the mdbSubscriptionId.
- *
- * @param mdbSubscriptionId the mdbSubscriptionId.
- * @throws IllegalArgumentException for a null mdbSubscriptionId
- */
- public void setMdbSubscriptionId(String mdbSubscriptionId)
- {
- if (mdbSubscriptionId == null)
- throw new IllegalArgumentException("Null mdbSubscriptionId");
- this.mdbSubscriptionId = mdbSubscriptionId;
- }
-
- /**
- * Get the defaultActivationConfig.
- *
- * @return the defaultActivationConfig.
- */
- public ActivationConfigMetaData getDefaultActivationConfig()
- {
- return defaultActivationConfig;
- }
-
- /**
- * Set the defaultActivationConfig.
- *
- * @param defaultActivationConfig the defaultActivationConfig.
- * @throws IllegalArgumentException for a null defaultActivationConfig
- */
- public void setDefaultActivationConfig(ActivationConfigMetaData defaultActivationConfig)
- {
- if (defaultActivationConfig == null)
- throw new IllegalArgumentException("Null defaultActivationConfig");
- this.defaultActivationConfig = defaultActivationConfig;
- }
-
- /**
- * Get the ejbTimeoutIdentity.
- *
- * @return the ejbTimeoutIdentity.
- */
- public SecurityIdentityMetaData getEjbTimeoutIdentity()
- {
- return ejbTimeoutIdentity;
- }
-
- /**
- * Set the ejbTimeoutIdentity.
- *
- * @param ejbTimeoutIdentity the ejbTimeoutIdentity.
- * @throws IllegalArgumentException for a null ejbTimeoutIdentity
- */
- public void setEjbTimeoutIdentity(SecurityIdentityMetaData ejbTimeoutIdentity)
- {
- if (ejbTimeoutIdentity == null)
- throw new IllegalArgumentException("Null ejbTimeoutIdentity");
- this.ejbTimeoutIdentity = ejbTimeoutIdentity;
- }
-
- @Override
- public void merge(JBossEnterpriseBeanMetaData override, EnterpriseBeanMetaData original, String overridenFile, String overrideFile, boolean mustOverride)
- {
- super.merge(override, original, overridenFile, overrideFile, mustOverride);
- JBossMessageDrivenBeanMetaData joverride = (JBossMessageDrivenBeanMetaData) override;
- MessageDrivenBeanMetaData soriginal = (MessageDrivenBeanMetaData) original;
- // messagingType
- if(joverride != null && joverride.messagingType != null)
- messagingType = joverride.messagingType;
- else if(soriginal != null && soriginal.getMessagingType() != null)
- messagingType = soriginal.getMessagingType();
- // timeoutMethod
- if(joverride != null && joverride.timeoutMethod != null)
- timeoutMethod = joverride.timeoutMethod;
- else if(soriginal != null && soriginal.getTimeoutMethod() != null)
- timeoutMethod = soriginal.getTimeoutMethod();
- // messageDestinationType
- if(joverride != null && joverride.messageDestinationType != null)
- messageDestinationType = joverride.messageDestinationType;
- else if(soriginal != null && soriginal.getMessageDestinationType() != null)
- messageDestinationType = soriginal.getMessageDestinationType();
- // messageDestinationLink
- if(joverride != null && joverride.messageDestinationLink != null)
- messageDestinationLink = joverride.messageDestinationLink;
- else if(soriginal != null && soriginal.getMessageDestinationLink() != null)
- messageDestinationLink = soriginal.getMessageDestinationLink();
- // Fixup the activation config
- ActivationConfigMetaData jbossActivationConfig = null;
- if (joverride != null && joverride.getActivationConfig() != null)
- jbossActivationConfig = joverride.getActivationConfig();
- ActivationConfigMetaData originalActivationConfig = null;
- if(soriginal != null)
- originalActivationConfig = soriginal.getActivationConfig();
- if(jbossActivationConfig != null || originalActivationConfig != null)
- {
- if(activationConfig == null)
- activationConfig = new ActivationConfigMetaData();
- activationConfig.merge(jbossActivationConfig, originalActivationConfig);
- }
- // aroundInvokes
- if(joverride != null && joverride.aroundInvokes != null)
- aroundInvokes = joverride.aroundInvokes;
- else if(soriginal != null && soriginal.getAroundInvokes() != null)
- aroundInvokes = soriginal.getAroundInvokes();
- // messageSelector
- if(joverride != null && joverride.messageSelector != null)
- messageSelector = joverride.messageSelector;
- else if(soriginal != null && soriginal.getMessageSelector() != null)
- messageSelector = soriginal.getMessageSelector();
- // messageSelector
- if(joverride != null && joverride.acknowledgeMode != null)
- acknowledgeMode = joverride.acknowledgeMode;
- else if(soriginal != null && soriginal.getAcknowledgeMode() != null)
- acknowledgeMode = soriginal.getAcknowledgeMode();
- // messageSelector
- if(joverride != null && joverride.subscriptionDurability != null)
- subscriptionDurability = joverride.subscriptionDurability;
- else if(soriginal != null && soriginal.getSubscriptionDurability() != null)
- subscriptionDurability = soriginal.getSubscriptionDurability();
- // destinationJndiName
- if(joverride != null && joverride.getDestinationJndiName() != null)
- destinationJndiName = joverride.getDestinationJndiName();
- else if(soriginal != null && soriginal.getMappedName() != null)
- destinationJndiName = soriginal.getMappedName();
- // mdbUser
- if(joverride != null && joverride.mdbUser != null)
- mdbUser = joverride.mdbUser;
- // mdbPassword
- if(joverride != null && joverride.mdbPassword != null)
- mdbPassword = joverride.mdbPassword;
- // mdbClientId
- if(joverride != null && joverride.mdbClientId != null)
- mdbClientId = joverride.mdbClientId;
- // mdbSubscriptionId
- if(joverride != null && joverride.mdbSubscriptionId != null)
- mdbSubscriptionId = joverride.mdbSubscriptionId;
- // resourceAdapterName
- if(joverride != null && joverride.resourceAdapterName != null)
- resourceAdapterName = joverride.resourceAdapterName;
- // ejbTimeoutIdentity
- if(joverride != null && joverride.ejbTimeoutIdentity != null)
- ejbTimeoutIdentity = joverride.ejbTimeoutIdentity;
- // defaultActivationConfig
- if(joverride != null && joverride.defaultActivationConfig != null)
- defaultActivationConfig = joverride.defaultActivationConfig;
- }
-
-}
Copied: projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossMessageDrivenBeanMetaData.java (from rev 73126, projects/metadata/trunk/src/main/java/org/jboss/metadata/ejb/jboss/JBossMessageDrivenBeanMetaData.java)
===================================================================
--- projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossMessageDrivenBeanMetaData.java (rev 0)
+++ projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossMessageDrivenBeanMetaData.java 2008-05-08 00:46:24 UTC (rev 73129)
@@ -0,0 +1,659 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.metadata.ejb.jboss;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.metadata.ejb.spec.ActivationConfigMetaData;
+import org.jboss.metadata.ejb.spec.AroundInvokesMetaData;
+import org.jboss.metadata.ejb.spec.EnterpriseBeanMetaData;
+import org.jboss.metadata.ejb.spec.MessageDrivenBeanMetaData;
+import org.jboss.metadata.ejb.spec.MessageDrivenDestinationMetaData;
+import org.jboss.metadata.ejb.spec.NamedMethodMetaData;
+import org.jboss.metadata.ejb.spec.SecurityIdentityMetaData;
+import org.jboss.metadata.ejb.spec.SubscriptionDurability;
+
+/**
+ * MessageDrivenBeanMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlType(name="jboss-message-driven-beanType")
+public class JBossMessageDrivenBeanMetaData extends JBossEnterpriseBeanMetaData
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -4006016148034278681L;
+
+ /** The messaging type */
+ private String messagingType;
+
+ /** The timeout method */
+ private NamedMethodMetaData timeoutMethod;
+
+ /** The message destination type */
+ private String messageDestinationType;
+
+ /** The message destination link */
+ private String messageDestinationLink;
+
+ /** The activation config */
+ private ActivationConfigMetaData activationConfig;
+
+ /** The around invokes */
+ private AroundInvokesMetaData aroundInvokes;
+
+ /** The message selector */
+ private String messageSelector;
+
+ /** The acknowledge mode */
+ private String acknowledgeMode;
+
+ /** The subscription durability */
+ private SubscriptionDurability subscriptionDurability = SubscriptionDurability.NonDurable;
+
+ /** The destination jndi name */
+ private String destinationJndiName;
+
+ /** The mdb user id */
+ private String mdbUser;
+
+ /** The mdb password */
+ private String mdbPassword;
+
+ /** The mdb client id */
+ private String mdbClientId;
+
+ /** The mdb subscription id */
+ private String mdbSubscriptionId;
+
+ /** The resource adapter name */
+ private String resourceAdapterName;
+
+ /** The ejb timeout identity */
+ private SecurityIdentityMetaData ejbTimeoutIdentity;
+
+ /** The default activation config */
+ private ActivationConfigMetaData defaultActivationConfig;
+
+ /**
+ * Create a new MessageDrivenBeanMetaData.
+ */
+ public JBossMessageDrivenBeanMetaData()
+ {
+ // For serialization
+ }
+
+ @Override
+ public boolean isMessageDriven()
+ {
+ return true;
+ }
+
+
+ /**
+ * Get the messagingType.
+ *
+ * @return the messagingType.
+ */
+ public String getMessagingType()
+ {
+ return messagingType;
+ }
+
+ /**
+ * Is this JMS
+ *
+ * @return true for jms
+ */
+ public boolean isJMS()
+ {
+ String messagingType = getMessagingType();
+ return messagingType == null || "javax.jms.MessageListener".equals(messagingType);
+ }
+
+
+ /**
+ * Set the messagingType.
+ *
+ * @param messagingType the messagingType.
+ * @throws IllegalArgumentException for a null messagingType
+ */
+ public void setMessagingType(String messagingType)
+ {
+ if (messagingType == null)
+ throw new IllegalArgumentException("Null messagingType");
+ this.messagingType = messagingType;
+ }
+
+
+ /**
+ * Get the timeoutMethod.
+ *
+ * @return the timeoutMethod.
+ */
+ public NamedMethodMetaData getTimeoutMethod()
+ {
+ return timeoutMethod;
+ }
+
+
+ /**
+ * Set the timeoutMethod.
+ *
+ * @param timeoutMethod the timeoutMethod.
+ * @throws IllegalArgumentException for a null timeoutMethod
+ */
+ @XmlElement(required=false)
+ public void setTimeoutMethod(NamedMethodMetaData timeoutMethod)
+ {
+ if (timeoutMethod == null)
+ throw new IllegalArgumentException("Null timeoutMethod");
+ this.timeoutMethod = timeoutMethod;
+ }
+
+ /**
+ * Get the messageDestinationType.
+ *
+ * @return the messageDestinationType.
+ */
+ public String getMessageDestinationType()
+ {
+ return messageDestinationType;
+ }
+
+
+ /**
+ * Set the messageDestinationType.
+ *
+ * @param messageDestinationType the messageDestinationType.
+ * @throws IllegalArgumentException for a null messageDestinationType
+ */
+ public void setMessageDestinationType(String messageDestinationType)
+ {
+ if (messageDestinationType == null)
+ throw new IllegalArgumentException("Null messageDestinationType");
+ this.messageDestinationType = messageDestinationType;
+ }
+
+
+ /**
+ * Get the aroundInvokes.
+ *
+ * @return the aroundInvokes.
+ */
+ public AroundInvokesMetaData getAroundInvokes()
+ {
+ return aroundInvokes;
+ }
+
+
+ /**
+ * Set the aroundInvokes.
+ *
+ * @param aroundInvokes the aroundInvokes.
+ * @throws IllegalArgumentException for a null aroundInvokes
+ */
+ @XmlElement(name="around-invoke", required=false)
+ public void setAroundInvokes(AroundInvokesMetaData aroundInvokes)
+ {
+ if (aroundInvokes == null)
+ throw new IllegalArgumentException("Null aroundInvokes");
+ this.aroundInvokes = aroundInvokes;
+ }
+
+
+ /**
+ * Get the messageDestinationLink.
+ *
+ * @return the messageDestinationLink.
+ */
+ public String getMessageDestinationLink()
+ {
+ return messageDestinationLink;
+ }
+
+
+ /**
+ * Set the messageDestinationLink.
+ *
+ * @param messageDestinationLink the messageDestinationLink.
+ * @throws IllegalArgumentException for a null messageDestinationLink
+ */
+ public void setMessageDestinationLink(String messageDestinationLink)
+ {
+ if (messageDestinationLink == null)
+ throw new IllegalArgumentException("Null messageDestinationLink");
+ this.messageDestinationLink = messageDestinationLink;
+ }
+
+
+ /**
+ * Get the activationConfig.
+ *
+ * @return the activationConfig.
+ */
+ public ActivationConfigMetaData getActivationConfig()
+ {
+ return activationConfig;
+ }
+
+
+ /**
+ * Set the activationConfig.
+ *
+ * @param activationConfig the activationConfig.
+ * @throws IllegalArgumentException for a null activationConfig
+ */
+ public void setActivationConfig(ActivationConfigMetaData activationConfig)
+ {
+ if (activationConfig == null)
+ throw new IllegalArgumentException("Null activationConfig");
+ this.activationConfig = activationConfig;
+ }
+
+ /**
+ * Get the messageSelector.
+ *
+ * @return the messageSelector.
+ */
+ public String getMessageSelector()
+ {
+ return messageSelector;
+ }
+
+ /**
+ * Set the messageSelector.
+ *
+ * @param messageSelector the messageSelector.
+ * @throws IllegalArgumentException for a null messageSelector
+ */
+ @XmlElement(required=false)
+ public void setMessageSelector(String messageSelector)
+ {
+ if (messageSelector == null)
+ throw new IllegalArgumentException("Null messageSelector");
+ this.messageSelector = messageSelector;
+ }
+
+ /**
+ * Get the acknowledgeMode.
+ *
+ * @return the acknowledgeMode.
+ */
+ public String getAcknowledgeMode()
+ {
+ return acknowledgeMode;
+ }
+
+ /**
+ * Set the acknowledgeMode.
+ *
+ * @param acknowledgeMode the acknowledgeMode.
+ * @throws IllegalArgumentException for a null acknowledgeMode
+ */
+ @XmlElement(required=false)
+ public void setAcknowledgeMode(String acknowledgeMode)
+ {
+ if (acknowledgeMode == null)
+ throw new IllegalArgumentException("Null acknowledgeMode");
+ this.acknowledgeMode = acknowledgeMode;
+ }
+
+ /**
+ * Get the subscriptionDurability.
+ *
+ * @return the subscriptionDurability.
+ */
+ public SubscriptionDurability getSubscriptionDurability()
+ {
+ return subscriptionDurability;
+ }
+
+ /**
+ * Set the subscriptionDurability.
+ *
+ * @param subscriptionDurability the subscriptionDurability.
+ * @throws IllegalArgumentException for a null subscriptionDurability
+ */
+ @XmlElement(required=false)
+ public void setSubscriptionDurability(SubscriptionDurability subscriptionDurability)
+ {
+ if (subscriptionDurability == null)
+ throw new IllegalArgumentException("Null subscriptionDurability");
+ this.subscriptionDurability = subscriptionDurability;
+ }
+
+ @XmlElement(name="message-driven-destination", required=false)
+ public void setMessageDrivenDestination(MessageDrivenDestinationMetaData mdd)
+ {
+ // Translate this into destinationType, subscriptionDurability
+ this.setMessageDestinationType(mdd.getDestinationType());
+ String durability = mdd.getSubscriptionDurability();
+ SubscriptionDurability sd = SubscriptionDurability.NonDurable;
+ if (durability != null && durability.equalsIgnoreCase("Durable"))
+ sd = SubscriptionDurability.Durable;
+ this.setSubscriptionDurability(sd);
+ }
+
+ @Override
+ public String getDefaultConfigurationName()
+ {
+ boolean isJMS = isJMS();
+ if (isJMS == false)
+ return ContainerConfigurationMetaData.MESSAGE_INFLOW_DRIVEN;
+ else
+ return ContainerConfigurationMetaData.MESSAGE_DRIVEN;
+ }
+
+ @Override
+ protected String getDefaultInvokerName()
+ {
+ return InvokerBindingMetaData.MESSAGE_DRIVEN;
+ }
+
+ @Override
+ protected String getDefaultInvokerJndiName()
+ {
+ return getEjbName();
+ }
+
+ @Override
+ public String determineJndiName()
+ {
+ return null;
+ }
+
+ /**
+ * Get the destinationJndiName.
+ *
+ * @return the destinationJndiName.
+ */
+ public String getDestinationJndiName()
+ {
+ return destinationJndiName;
+ }
+
+ /**
+ * Set the destinationJndiName.
+ *
+ * @param destinationJndiName the destinationJndiName.
+ * @throws IllegalArgumentException for a null destinationJndiName
+ */
+ public void setDestinationJndiName(String destinationJndiName)
+ {
+ if (destinationJndiName == null)
+ throw new IllegalArgumentException("Null destinationJndiName");
+ this.destinationJndiName = destinationJndiName;
+ }
+
+ /**
+ * Get the mdbUser.
+ *
+ * @return the mdbUser.
+ */
+ public String getMdbUser()
+ {
+ return mdbUser;
+ }
+
+ /**
+ * Set the mdbUser.
+ *
+ * @param mdbUser the mdbUser.
+ * @throws IllegalArgumentException for a null mdbUser
+ */
+ public void setMdbUser(String mdbUser)
+ {
+ if (mdbUser == null)
+ throw new IllegalArgumentException("Null mdbUser");
+ this.mdbUser = mdbUser;
+ }
+
+ /**
+ * Get the mdbPassword.
+ *
+ * @return the mdbPassword.
+ */
+ public String getMdbPassword()
+ {
+ return mdbPassword;
+ }
+
+ /**
+ * Set the mdbPassword.
+ *
+ * @param mdbPassword the mdbPassword.
+ * @throws IllegalArgumentException for a null mdbPassword
+ */
+ @XmlElement(name="mdb-passwd")
+ public void setMdbPassword(String mdbPassword)
+ {
+ if (mdbPassword == null)
+ throw new IllegalArgumentException("Null mdbPassword");
+ this.mdbPassword = mdbPassword;
+ }
+
+ /**
+ * Get the mdbClientId.
+ *
+ * @return the mdbClientId.
+ */
+ public String getMdbClientId()
+ {
+ return mdbClientId;
+ }
+
+ /**
+ * Set the mdbClientId.
+ *
+ * @param mdbClientId the mdbClientId.
+ * @throws IllegalArgumentException for a null mdbClientId
+ */
+ public void setMdbClientId(String mdbClientId)
+ {
+ if (mdbClientId == null)
+ throw new IllegalArgumentException("Null mdbClientId");
+ this.mdbClientId = mdbClientId;
+ }
+
+ /**
+ * Get the resourceAdapterName.
+ *
+ * @return the resourceAdapterName.
+ */
+ public String getResourceAdapterName()
+ {
+ return resourceAdapterName;
+ }
+
+ /**
+ * Set the resourceAdapterName.
+ *
+ * @param resourceAdapterName the resourceAdapterName.
+ * @throws IllegalArgumentException for a null resourceAdapterName
+ */
+ public void setResourceAdapterName(String resourceAdapterName)
+ {
+ if (resourceAdapterName == null)
+ throw new IllegalArgumentException("Null resourceAdapterName");
+ this.resourceAdapterName = resourceAdapterName;
+ }
+
+ /**
+ * Get the mdbSubscriptionId.
+ *
+ * @return the mdbSubscriptionId.
+ */
+ public String getMdbSubscriptionId()
+ {
+ return mdbSubscriptionId;
+ }
+
+ /**
+ * Set the mdbSubscriptionId.
+ *
+ * @param mdbSubscriptionId the mdbSubscriptionId.
+ * @throws IllegalArgumentException for a null mdbSubscriptionId
+ */
+ public void setMdbSubscriptionId(String mdbSubscriptionId)
+ {
+ if (mdbSubscriptionId == null)
+ throw new IllegalArgumentException("Null mdbSubscriptionId");
+ this.mdbSubscriptionId = mdbSubscriptionId;
+ }
+
+ /**
+ * Get the defaultActivationConfig.
+ *
+ * @return the defaultActivationConfig.
+ */
+ public ActivationConfigMetaData getDefaultActivationConfig()
+ {
+ return defaultActivationConfig;
+ }
+
+ /**
+ * Set the defaultActivationConfig.
+ *
+ * @param defaultActivationConfig the defaultActivationConfig.
+ * @throws IllegalArgumentException for a null defaultActivationConfig
+ */
+ public void setDefaultActivationConfig(ActivationConfigMetaData defaultActivationConfig)
+ {
+ if (defaultActivationConfig == null)
+ throw new IllegalArgumentException("Null defaultActivationConfig");
+ this.defaultActivationConfig = defaultActivationConfig;
+ }
+
+ /**
+ * Get the ejbTimeoutIdentity.
+ *
+ * @return the ejbTimeoutIdentity.
+ */
+ public SecurityIdentityMetaData getEjbTimeoutIdentity()
+ {
+ return ejbTimeoutIdentity;
+ }
+
+ /**
+ * Set the ejbTimeoutIdentity.
+ *
+ * @param ejbTimeoutIdentity the ejbTimeoutIdentity.
+ * @throws IllegalArgumentException for a null ejbTimeoutIdentity
+ */
+ public void setEjbTimeoutIdentity(SecurityIdentityMetaData ejbTimeoutIdentity)
+ {
+ if (ejbTimeoutIdentity == null)
+ throw new IllegalArgumentException("Null ejbTimeoutIdentity");
+ this.ejbTimeoutIdentity = ejbTimeoutIdentity;
+ }
+
+ @Override
+ public void merge(JBossEnterpriseBeanMetaData override, EnterpriseBeanMetaData original, String overridenFile, String overrideFile, boolean mustOverride)
+ {
+ super.merge(override, original, overridenFile, overrideFile, mustOverride);
+ JBossMessageDrivenBeanMetaData joverride = (JBossMessageDrivenBeanMetaData) override;
+ MessageDrivenBeanMetaData soriginal = (MessageDrivenBeanMetaData) original;
+ // messagingType
+ if(joverride != null && joverride.messagingType != null)
+ messagingType = joverride.messagingType;
+ else if(soriginal != null && soriginal.getMessagingType() != null)
+ messagingType = soriginal.getMessagingType();
+ // timeoutMethod
+ if(joverride != null && joverride.timeoutMethod != null)
+ timeoutMethod = joverride.timeoutMethod;
+ else if(soriginal != null && soriginal.getTimeoutMethod() != null)
+ timeoutMethod = soriginal.getTimeoutMethod();
+ // messageDestinationType
+ if(joverride != null && joverride.messageDestinationType != null)
+ messageDestinationType = joverride.messageDestinationType;
+ else if(soriginal != null && soriginal.getMessageDestinationType() != null)
+ messageDestinationType = soriginal.getMessageDestinationType();
+ // messageDestinationLink
+ if(joverride != null && joverride.messageDestinationLink != null)
+ messageDestinationLink = joverride.messageDestinationLink;
+ else if(soriginal != null && soriginal.getMessageDestinationLink() != null)
+ messageDestinationLink = soriginal.getMessageDestinationLink();
+ // Fixup the activation config
+ ActivationConfigMetaData jbossActivationConfig = null;
+ if (joverride != null && joverride.getActivationConfig() != null)
+ jbossActivationConfig = joverride.getActivationConfig();
+ ActivationConfigMetaData originalActivationConfig = null;
+ if(soriginal != null)
+ originalActivationConfig = soriginal.getActivationConfig();
+ if(jbossActivationConfig != null || originalActivationConfig != null)
+ {
+ if(activationConfig == null)
+ activationConfig = new ActivationConfigMetaData();
+ activationConfig.merge(jbossActivationConfig, originalActivationConfig);
+ }
+ // aroundInvokes
+ if(joverride != null && joverride.aroundInvokes != null)
+ aroundInvokes = joverride.aroundInvokes;
+ else if(soriginal != null && soriginal.getAroundInvokes() != null)
+ aroundInvokes = soriginal.getAroundInvokes();
+ // messageSelector
+ if(joverride != null && joverride.messageSelector != null)
+ messageSelector = joverride.messageSelector;
+ else if(soriginal != null && soriginal.getMessageSelector() != null)
+ messageSelector = soriginal.getMessageSelector();
+ // messageSelector
+ if(joverride != null && joverride.acknowledgeMode != null)
+ acknowledgeMode = joverride.acknowledgeMode;
+ else if(soriginal != null && soriginal.getAcknowledgeMode() != null)
+ acknowledgeMode = soriginal.getAcknowledgeMode();
+ // messageSelector
+ if(joverride != null && joverride.subscriptionDurability != null)
+ subscriptionDurability = joverride.subscriptionDurability;
+ else if(soriginal != null && soriginal.getSubscriptionDurability() != null)
+ subscriptionDurability = soriginal.getSubscriptionDurability();
+ // destinationJndiName
+ if(joverride != null && joverride.getDestinationJndiName() != null)
+ destinationJndiName = joverride.getDestinationJndiName();
+ else if(soriginal != null && soriginal.getMappedName() != null)
+ destinationJndiName = soriginal.getMappedName();
+ // mdbUser
+ if(joverride != null && joverride.mdbUser != null)
+ mdbUser = joverride.mdbUser;
+ // mdbPassword
+ if(joverride != null && joverride.mdbPassword != null)
+ mdbPassword = joverride.mdbPassword;
+ // mdbClientId
+ if(joverride != null && joverride.mdbClientId != null)
+ mdbClientId = joverride.mdbClientId;
+ // mdbSubscriptionId
+ if(joverride != null && joverride.mdbSubscriptionId != null)
+ mdbSubscriptionId = joverride.mdbSubscriptionId;
+ // resourceAdapterName
+ if(joverride != null && joverride.resourceAdapterName != null)
+ resourceAdapterName = joverride.resourceAdapterName;
+ // ejbTimeoutIdentity
+ if(joverride != null && joverride.ejbTimeoutIdentity != null)
+ ejbTimeoutIdentity = joverride.ejbTimeoutIdentity;
+ // defaultActivationConfig
+ if(joverride != null && joverride.defaultActivationConfig != null)
+ defaultActivationConfig = joverride.defaultActivationConfig;
+ }
+
+}
Deleted: projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/ejb/jboss/JBossMetaData.java 2008-05-07 21:59:24 UTC (rev 73125)
+++ projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossMetaData.java 2008-05-08 00:46:24 UTC (rev 73129)
@@ -1,784 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.metadata.ejb.jboss;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlTransient;
-
-import org.jboss.logging.Logger;
-import org.jboss.metadata.common.ejb.IEjbJarMetaData;
-import org.jboss.metadata.common.jboss.LoaderRepositoryMetaData;
-import org.jboss.metadata.ejb.spec.EjbJar3xMetaData;
-import org.jboss.metadata.ejb.spec.EjbJarMetaData;
-import org.jboss.metadata.ejb.spec.EnterpriseBeansMetaData;
-import org.jboss.metadata.ejb.spec.InterceptorsMetaData;
-import org.jboss.metadata.ejb.spec.RelationsMetaData;
-import org.jboss.metadata.ejb.spec.SecurityIdentityMetaData;
-import org.jboss.metadata.javaee.jboss.RunAsIdentityMetaData;
-import org.jboss.metadata.javaee.spec.RunAsMetaData;
-import org.jboss.metadata.javaee.support.IdMetaDataImplWithDescriptionGroup;
-
-/**
- * JBossMetaData.
- *
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @author Scott.Stark at jboss.org
- * @version $Revision: 1.1 $
- */
-public class JBossMetaData extends IdMetaDataImplWithDescriptionGroup
- implements IEjbJarMetaData<JBossAssemblyDescriptorMetaData, JBossEnterpriseBeansMetaData, JBossEnterpriseBeanMetaData, JBossMetaData>
-{
- /** The serialVersionUID */
- private static final long serialVersionUID = 598759931857080298L;
-
- /** The log */
- private static final Logger log = Logger.getLogger(JBossMetaData.class);
-
- /** DTD information */
- private String dtdPublicId;
- private String dtdSystemId;
- /** The version */
- private String version;
- /** The ejb jar version */
- private String ejbVersion;
-
- /** The ejb client jar */
- private String ejbClientJar;
-
- /** The relations */
- private RelationsMetaData relationships;
-
- /** The loader repository */
- private LoaderRepositoryMetaData loaderRepository;
-
- /** The jmx name */
- private String jmxName;
-
- /** The security domain */
- private String securityDomain;
-
- /** The jacc context id */
- private String jaccContextID;
-
- /** Whether to exclude missing methods */
- private boolean excludeMissingMethods = true;
-
- /** The unauthenticated principal */
- private String unauthenticatedPrincipal;
-
- /** Whether to throw an exception when marked rollback */
- private boolean exceptionOnRollback;
-
- /** The webservices */
- private WebservicesMetaData webservices;
-
- /** The enterprise beans */
- private JBossEnterpriseBeansMetaData enterpriseBeans;
-
- /** The assembly descriptor */
- private JBossAssemblyDescriptorMetaData assemblyDescriptor;
-
- /** The resource manager */
- private ResourceManagersMetaData resourceManagers;
-
- /** The invoker-proxy-bindings */
- private InvokerProxyBindingsMetaData invokerProxyBindings;
-
- /** The container configurations */
- private ContainerConfigurationsMetaData containerConfigurations;
-
- /** The interceptors */
- private InterceptorsMetaData interceptors;
- /** */
- private Map<String, RunAsIdentityMetaData> runAsIdentity = new HashMap<String, RunAsIdentityMetaData>();
- /** Is this a complete metadata description */
- private boolean metadataComplete;
-
- /** the class name that implements the default JNDI binding policy for this ejb unit*/
- private String jndiBindingPolicy;
-
- /**
- * Create a new JBossMetaData.
- */
- public JBossMetaData()
- {
- // For serialization
- }
-
- /**
- * Callback for the DTD information
- * @param root
- * @param publicId
- * @param systemId
- */
- @XmlTransient
- public void setDTD(String root, String publicId, String systemId)
- {
- this.dtdPublicId = publicId;
- this.dtdSystemId = systemId;
- // Set the version based on the public id
- if (dtdPublicId != null && dtdPublicId.contains("3.0"))
- setVersion("3.0");
- if (dtdPublicId != null && dtdPublicId.contains("3.2"))
- setVersion("3.2");
- if (dtdPublicId != null && dtdPublicId.contains("4.0"))
- setVersion("4.0");
- if (dtdPublicId != null && dtdPublicId.contains("4.2"))
- setVersion("4.2");
- if (dtdPublicId != null && dtdPublicId.contains("5.0"))
- setVersion("5.0");
- }
- /**
- * Get the DTD public id if one was seen
- * @return the value of the web.xml dtd public id
- */
- @XmlTransient
- public String getDtdPublicId()
- {
- return dtdPublicId;
- }
- /**
- * Get the DTD system id if one was seen
- * @return the value of the web.xml dtd system id
- */
- @XmlTransient
- public String getDtdSystemId()
- {
- return dtdSystemId;
- }
-
- @XmlTransient
- public InterceptorsMetaData getInterceptors()
- {
- return interceptors;
- }
-
- /**
- * Get the jboss.xml version.
- *
- * @return the version.
- */
- public String getVersion()
- {
- return version;
- }
-
- /**
- * Set the version.
- *
- * @param version the version.
- * @throws IllegalArgumentException for a null version
- */
- @XmlAttribute
- public void setVersion(String version)
- {
- if (version == null)
- throw new IllegalArgumentException("Null version");
- this.version = version;
- }
-
- public JBossAssemblyDescriptorMetaData getAssemblyDescriptor()
- {
- return assemblyDescriptor;
- }
-
- public String getEjbClientJar()
- {
- return this.ejbClientJar;
- }
- public void setEjbClientJar(String ejbClientJar)
- {
- this.ejbClientJar = ejbClientJar;
- }
-
- public RelationsMetaData getRelationships()
- {
- return this.relationships;
- }
- public void setRelationships(RelationsMetaData relationships)
- {
- this.relationships = relationships;
- }
-
- public boolean isEJB1x()
- {
- return ejbVersion != null && ejbVersion.contains("1.");
- }
-
- public boolean isEJB21()
- {
- return ejbVersion != null && ejbVersion.contains("2.1");
- }
-
- public boolean isEJB2x()
- {
- return ejbVersion != null && ejbVersion.contains("2.");
- }
-
- public boolean isEJB3x()
- {
- return ejbVersion != null && ejbVersion.contains("3.");
- }
-
- /**
- * Get the loaderRepository.
- *
- * @return the loaderRepository.
- */
- public LoaderRepositoryMetaData getLoaderRepository()
- {
- return loaderRepository;
- }
-
- /**
- * Set the loaderRepository.
- *
- * @param loaderRepository the loaderRepository.
- * @throws IllegalArgumentException for a null loaderRepository
- */
- public void setLoaderRepository(LoaderRepositoryMetaData loaderRepository)
- {
- if (loaderRepository == null)
- throw new IllegalArgumentException("Null loaderRepository");
- this.loaderRepository = loaderRepository;
- }
-
- /**
- * Get the jmxName.
- *
- * @return the jmxName.
- */
- public String getJmxName()
- {
- return jmxName;
- }
-
- public String getJaccContextID()
- {
- return jaccContextID;
- }
-
- /**
- * Set the jmxName.
- *
- * @param jmxName the jmxName.
- * @throws IllegalArgumentException for a null jmxName
- */
- public void setJmxName(String jmxName)
- {
- if (jmxName == null)
- throw new IllegalArgumentException("Null jmxName");
- this.jmxName = jmxName;
- }
-
- /**
- * Set the JACC context id
- * @param jaccContextID the id to use for the bean JACC context
- */
- public void setJaccContextID(String jaccContextID)
- {
- this.jaccContextID = jaccContextID;
- }
-
- /**
- * Get the securityDomain.
- *
- * @return the securityDomain.
- */
- public String getSecurityDomain()
- {
- return securityDomain;
- }
-
- /**
- * Set the securityDomain.
- *
- * @param securityDomain the securityDomain.
- * @throws IllegalArgumentException for a null securityDomain
- */
- public void setSecurityDomain(String securityDomain)
- {
- if (securityDomain == null)
- throw new IllegalArgumentException("Null securityDomain");
- this.securityDomain = securityDomain.trim();
- }
-
- /**
- * Get the excludeMissingMethods.
- *
- * @return the excludeMissingMethods.
- */
- public boolean isExcludeMissingMethods()
- {
- return excludeMissingMethods;
- }
-
- /**
- * Set the excludeMissingMethods.
- *
- * @param excludeMissingMethods the excludeMissingMethods.
- */
- @XmlElement(name="missing-method-permissions-excluded-mode")
- public void setExcludeMissingMethods(boolean excludeMissingMethods)
- {
- this.excludeMissingMethods = excludeMissingMethods;
- }
-
- /**
- * Get the unauthenticatedPrincipal.
- *
- * @return the unauthenticatedPrincipal.
- */
- public String getUnauthenticatedPrincipal()
- {
- return unauthenticatedPrincipal;
- }
-
- /**
- * Set the unauthenticatedPrincipal.
- *
- * @param unauthenticatedPrincipal the unauthenticatedPrincipal.
- * @throws IllegalArgumentException for a null unauthenticatedPrincipal
- */
- public void setUnauthenticatedPrincipal(String unauthenticatedPrincipal)
- {
- if (unauthenticatedPrincipal == null)
- throw new IllegalArgumentException("Null unauthenticatedPrincipal");
- this.unauthenticatedPrincipal = unauthenticatedPrincipal;
- }
-
- /**
- * Get the exceptionOnRollback.
- *
- * @return the exceptionOnRollback.
- */
- public boolean isExceptionOnRollback()
- {
- return exceptionOnRollback;
- }
-
- /**
- * Set the exceptionOnRollback.
- *
- * @param exceptionOnRollback the exceptionOnRollback.
- */
- public void setExceptionOnRollback(boolean exceptionOnRollback)
- {
- this.exceptionOnRollback = exceptionOnRollback;
- }
-
- public boolean isMetadataComplete()
- {
- return metadataComplete;
- }
-
- public void setMetadataComplete(boolean metadataComplete)
- {
- this.metadataComplete = metadataComplete;
- }
-
- /**
- * Get the enterpriseBeans.
- *
- * @return the enterpriseBeans.
- */
- public JBossEnterpriseBeansMetaData getEnterpriseBeans()
- {
- return enterpriseBeans;
- }
-
- /**
- * Set the enterpriseBeans.
- *
- * @param enterpriseBeans the enterpriseBeans.
- * @throws IllegalArgumentException for a null enterpriseBeans
- */
- @XmlElement(name="enterprise-beans")
- public void setEnterpriseBeans(JBossEnterpriseBeansMetaData enterpriseBeans)
- {
- if (enterpriseBeans == null)
- throw new IllegalArgumentException("Null enterpriseBeans");
- this.enterpriseBeans = enterpriseBeans;
- this.enterpriseBeans.setJBossMetaData(this);
- }
-
- /**
- * Get an enterprise bean
- *
- * @param name the name
- * @return the container configuration
- */
- public JBossEnterpriseBeanMetaData getEnterpriseBean(String name)
- {
- if (enterpriseBeans == null)
- return null;
- return enterpriseBeans.get(name);
- }
-
- /**
- * Set the enforceEjbRestrictions.
- *
- * @param enforceEjbRestrictions the enforceEjbRestrictions.
- * @throws IllegalArgumentException for a null enforceEjbRestrictions
- */
- public void setEnforceEjbRestrictions(String enforceEjbRestrictions)
- {
- log.warn("<enforce-ejb-restrictions/> in jboss.xml is no longer used and will be removed in a future version.");
- }
-
- /**
- * Get the webservices.
- *
- * @return the webservices.
- */
- public WebservicesMetaData getWebservices()
- {
- return webservices;
- }
-
- /**
- * Set the webservices.
- *
- * @param webservices the webservices.
- * @throws IllegalArgumentException for a null webservices
- */
- public void setWebservices(WebservicesMetaData webservices)
- {
- if (webservices == null)
- throw new IllegalArgumentException("Null webservices");
- this.webservices = webservices;
- }
-
- /**
- * Get the containerConfigurations.
- *
- * @return the containerConfigurations.
- */
- public ContainerConfigurationsMetaData getContainerConfigurations()
- {
- return containerConfigurations;
- }
-
- /**
- * Set the containerConfigurations.
- *
- * @param containerConfigurations the containerConfigurations.
- * @throws IllegalArgumentException for a null containerConfigurations
- */
- public void setContainerConfigurations(ContainerConfigurationsMetaData containerConfigurations)
- {
- if (containerConfigurations == null)
- throw new IllegalArgumentException("Null containerConfigurations");
- this.containerConfigurations = containerConfigurations;
- }
-
- /**
- * Get a container configuration
- *
- * @param name the name
- * @return the container configuration
- */
- public ContainerConfigurationMetaData getContainerConfiguration(String name)
- {
- if (containerConfigurations == null)
- return null;
- return containerConfigurations.get(name);
- }
-
- /**
- * Get the invokerProxyBindings.
- *
- * @return the invokerProxyBindings.
- */
- public InvokerProxyBindingsMetaData getInvokerProxyBindings()
- {
- return invokerProxyBindings;
- }
-
- /**
- * Set the invokerProxyBindings.
- *
- * @param invokerProxyBindings the invokerProxyBindings.
- * @throws IllegalArgumentException for a null invokerProxyBindings
- */
- public void setInvokerProxyBindings(InvokerProxyBindingsMetaData invokerProxyBindings)
- {
- if (invokerProxyBindings == null)
- throw new IllegalArgumentException("Null invokerProxyBindings");
- this.invokerProxyBindings = invokerProxyBindings;
- }
-
- /**
- * Get an invoker proxy binding
- *
- * @param name the name
- * @return the invoker proxy binding
- */
- public InvokerProxyBindingMetaData getInvokerProxyBinding(String name)
- {
- if (invokerProxyBindings == null)
- return null;
- return invokerProxyBindings.get(name);
- }
-
- /**
- * Get the resourceManagers.
- *
- * @return the resourceManagers.
- */
- public ResourceManagersMetaData getResourceManagers()
- {
- return resourceManagers;
- }
-
- /**
- * Set the resourceManagers.
- *
- * @param resourceManagers the resourceManagers.
- * @throws IllegalArgumentException for a null resourceManagers
- */
- public void setResourceManagers(ResourceManagersMetaData resourceManagers)
- {
- if (resourceManagers == null)
- throw new IllegalArgumentException("Null resourceManagers");
- this.resourceManagers = resourceManagers;
- }
-
- /**
- * Get a resource manager
- *
- * @param name the name
- * @return the resource manager
- */
- public ResourceManagerMetaData getResourceManager(String name)
- {
- if (resourceManagers == null)
- return null;
- return resourceManagers.get(name);
- }
-
- /**
- * Set the assemblyDescriptor.
- *
- * @param assemblyDescriptor the assemblyDescriptor.
- * @throws IllegalArgumentException for a null assemblyDescriptor
- */
- public void setAssemblyDescriptor(JBossAssemblyDescriptorMetaData assemblyDescriptor)
- {
- if (assemblyDescriptor == null)
- throw new IllegalArgumentException("Null assemblyDescriptor");
- this.assemblyDescriptor = assemblyDescriptor;
- }
-
- public String getJndiBindingPolicy()
- {
- return jndiBindingPolicy;
- }
-
- public void setJndiBindingPolicy(String jndiBindingPolicy)
- {
- this.jndiBindingPolicy = jndiBindingPolicy;
- }
-
- /**
- * Access the RunAsIdentity associated with the given servlet
- * @param ejbName - the servlet-name from the web.xml
- * @return RunAsIdentity for the servet if one exists, null otherwise
- */
- @XmlTransient
- public RunAsIdentityMetaData getRunAsIdentity(String ejbName)
- {
- RunAsIdentityMetaData identity = runAsIdentity.get(ejbName);
- if (identity == null)
- {
- JBossEnterpriseBeanMetaData ejb = this.getEnterpriseBean(ejbName);
- if (ejb != null)
- {
- // Check for a ejb-jar.xml run-as only specification
- synchronized (runAsIdentity)
- {
- SecurityIdentityMetaData si = ejb.getSecurityIdentity();
- if(si != null)
- {
- RunAsMetaData runAs = si.getRunAs();
- if (runAs != null)
- {
- String roleName = runAs.getRoleName();
- identity = new RunAsIdentityMetaData(roleName, null);
- runAsIdentity.put(ejbName, identity);
- }
- }
- }
- }
- }
- return identity;
- }
-
- /**
- * Merge the contents of override with original into this.
- *
- * @param override data which overrides original
- * @param original the original data
- */
- public void merge(JBossMetaData override, EjbJarMetaData original)
- {
- super.merge(override, original);
- if(assemblyDescriptor == null)
- assemblyDescriptor = new JBossAssemblyDescriptorMetaData();
- if(resourceManagers == null)
- resourceManagers = new ResourceManagersMetaData();
- if(containerConfigurations == null)
- containerConfigurations = new ContainerConfigurationsMetaData();
- if(override != null && override.containerConfigurations != null)
- containerConfigurations.merge(override.containerConfigurations);
- if(invokerProxyBindings == null)
- invokerProxyBindings = new InvokerProxyBindingsMetaData();
- if(override != null && override.invokerProxyBindings != null)
- invokerProxyBindings.merge(override.invokerProxyBindings);
- if(interceptors == null)
- interceptors = new InterceptorsMetaData();
- if(override != null && override.webservices != null)
- webservices = new WebservicesMetaData();
-
- if(original != null)
- {
- ejbVersion = original.getVersion();
- relationships = original.getRelationships();
- if(original instanceof EjbJar3xMetaData)
- {
- EjbJar3xMetaData original3x = (EjbJar3xMetaData) original;
- metadataComplete = original3x.isMetadataComplete();
- }
- }
-
- if(override != null && override.assemblyDescriptor != null)
- {
- assemblyDescriptor.merge(override.assemblyDescriptor, original.getAssemblyDescriptor());
- }
- else if(original != null && original.getAssemblyDescriptor() != null)
- {
- assemblyDescriptor.merge(null, original.getAssemblyDescriptor());
- }
- //
- if(override != null && override.resourceManagers != null)
- resourceManagers.merge(override.resourceManagers);
-
- if(override != null && override.interceptors != null)
- interceptors.merge(override.interceptors);
- else if(original != null && original.getInterceptors() != null)
- interceptors.merge(original.getInterceptors());
-
- if(override != null)
- {
- if(override.jaccContextID != null)
- jaccContextID = override.jaccContextID;
- if(override.jmxName != null)
- jmxName = override.jmxName;
- if(override.loaderRepository != null)
- loaderRepository = override.loaderRepository;
- if(override.securityDomain != null)
- securityDomain = override.securityDomain;
- if(override.unauthenticatedPrincipal != null)
- unauthenticatedPrincipal = override.unauthenticatedPrincipal;
- if(override.metadataComplete)
- metadataComplete = true;
- }
-
- if (webservices != null && override != null)
- webservices.merge(override.webservices);
-
- if(enterpriseBeans == null)
- {
- enterpriseBeans = new JBossEnterpriseBeansMetaData();
- enterpriseBeans.setJBossMetaData(this);
- }
-
- JBossEnterpriseBeansMetaData jbeans = null;
- if(override != null)
- {
- jbeans = override.enterpriseBeans;
-
- //Ensure that there is no customization of the Unspecified method permissions
- if(override.excludeMissingMethods == false)
- this.excludeMissingMethods = false;
- }
-
- EnterpriseBeansMetaData beans = null;
- if(original != null)
- beans = original.getEnterpriseBeans();
-
- boolean isEJB3x = (original == null || original.isEJB3x());
- enterpriseBeans.merge(jbeans, beans, "ejb-jar.xml", "jboss.xml", !isEJB3x);
-
- // Update run-as indentity for a run-as-principal
- if(enterpriseBeans != null)
- {
- for(JBossEnterpriseBeanMetaData ejb : enterpriseBeans)
- {
- String ejbName = ejb.getEjbName();
- SecurityIdentityMetaData si = ejb.getSecurityIdentity();
- String principalName = si != null ? si.getRunAsPrincipal() : null;
- // Get the run-as primary role
- String ejbXmlRunAs = null;
- if(si != null && si.getRunAs() != null)
- ejbXmlRunAs = si.getRunAs().getRoleName();
- if (principalName != null)
- {
- // Update the run-as indentity to use the principal name
- if (ejbXmlRunAs == null)
- {
- // Can't make this check since the name may come from an annotation
- //throw new IllegalStateException("run-as-principal: " + principalName + " found in jboss.xml but there was no run-as in ejb-jar.xml");
- ejbXmlRunAs = "anonymous";
- }
- // See if there are any additional roles for this principal
- Set<String> extraRoles = null;
- if(getAssemblyDescriptor() != null)
- {
- extraRoles = getAssemblyDescriptor().getSecurityRoleNamesByPrincipal(principalName);
- }
- RunAsIdentityMetaData runAsId = new RunAsIdentityMetaData(ejbXmlRunAs, principalName, extraRoles);
- runAsIdentity.put(ejbName, runAsId);
- }
- else if (ejbXmlRunAs != null)
- {
- RunAsIdentityMetaData runAsId = new RunAsIdentityMetaData(ejbXmlRunAs, null);
- runAsIdentity.put(ejbName, runAsId);
- }
- }
- }
- }
-
- /**
- *
- * @return
- */
- protected JBossEnterpriseBeanMetaData newBean()
- {
- return null;
- }
-}
Copied: projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossMetaData.java (from rev 73126, projects/metadata/trunk/src/main/java/org/jboss/metadata/ejb/jboss/JBossMetaData.java)
===================================================================
--- projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossMetaData.java (rev 0)
+++ projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossMetaData.java 2008-05-08 00:46:24 UTC (rev 73129)
@@ -0,0 +1,802 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.metadata.ejb.jboss;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlTransient;
+
+import org.jboss.logging.Logger;
+import org.jboss.metadata.common.ejb.IEjbJarMetaData;
+import org.jboss.metadata.common.jboss.LoaderRepositoryMetaData;
+import org.jboss.metadata.ejb.jboss.jndipolicy.spi.DeploymentSummary;
+import org.jboss.metadata.ejb.spec.EjbJar3xMetaData;
+import org.jboss.metadata.ejb.spec.EjbJarMetaData;
+import org.jboss.metadata.ejb.spec.EnterpriseBeansMetaData;
+import org.jboss.metadata.ejb.spec.InterceptorsMetaData;
+import org.jboss.metadata.ejb.spec.RelationsMetaData;
+import org.jboss.metadata.ejb.spec.SecurityIdentityMetaData;
+import org.jboss.metadata.javaee.jboss.RunAsIdentityMetaData;
+import org.jboss.metadata.javaee.spec.RunAsMetaData;
+import org.jboss.metadata.javaee.support.IdMetaDataImplWithDescriptionGroup;
+
+/**
+ * JBossMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public class JBossMetaData extends IdMetaDataImplWithDescriptionGroup
+ implements IEjbJarMetaData<JBossAssemblyDescriptorMetaData, JBossEnterpriseBeansMetaData, JBossEnterpriseBeanMetaData, JBossMetaData>
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 598759931857080298L;
+
+ /** The log */
+ private static final Logger log = Logger.getLogger(JBossMetaData.class);
+
+ /** DTD information */
+ private String dtdPublicId;
+ private String dtdSystemId;
+ /** The version */
+ private String version;
+ /** The ejb jar version */
+ private String ejbVersion;
+
+ /** The ejb client jar */
+ private String ejbClientJar;
+
+ /** The relations */
+ private RelationsMetaData relationships;
+
+ /** The loader repository */
+ private LoaderRepositoryMetaData loaderRepository;
+
+ /** The jmx name */
+ private String jmxName;
+
+ /** The security domain */
+ private String securityDomain;
+
+ /** The jacc context id */
+ private String jaccContextID;
+
+ /** Whether to exclude missing methods */
+ private boolean excludeMissingMethods = true;
+
+ /** The unauthenticated principal */
+ private String unauthenticatedPrincipal;
+
+ /** Whether to throw an exception when marked rollback */
+ private boolean exceptionOnRollback;
+
+ /** The webservices */
+ private WebservicesMetaData webservices;
+
+ /** The enterprise beans */
+ private JBossEnterpriseBeansMetaData enterpriseBeans;
+
+ /** The assembly descriptor */
+ private JBossAssemblyDescriptorMetaData assemblyDescriptor;
+
+ /** The resource manager */
+ private ResourceManagersMetaData resourceManagers;
+
+ /** The invoker-proxy-bindings */
+ private InvokerProxyBindingsMetaData invokerProxyBindings;
+
+ /** The container configurations */
+ private ContainerConfigurationsMetaData containerConfigurations;
+
+ /** The interceptors */
+ private InterceptorsMetaData interceptors;
+ /** */
+ private Map<String, RunAsIdentityMetaData> runAsIdentity = new HashMap<String, RunAsIdentityMetaData>();
+ /** Is this a complete metadata description */
+ private boolean metadataComplete;
+
+ /** the class name that implements the default JNDI binding policy for this ejb unit*/
+ private String jndiBindingPolicy;
+ /** The ejb jar deployment summary information */
+ private DeploymentSummary deploymentSummary;
+
+ /**
+ * Create a new JBossMetaData.
+ */
+ public JBossMetaData()
+ {
+ // For serialization
+ }
+
+ /**
+ * Callback for the DTD information
+ * @param root
+ * @param publicId
+ * @param systemId
+ */
+ @XmlTransient
+ public void setDTD(String root, String publicId, String systemId)
+ {
+ this.dtdPublicId = publicId;
+ this.dtdSystemId = systemId;
+ // Set the version based on the public id
+ if (dtdPublicId != null && dtdPublicId.contains("3.0"))
+ setVersion("3.0");
+ if (dtdPublicId != null && dtdPublicId.contains("3.2"))
+ setVersion("3.2");
+ if (dtdPublicId != null && dtdPublicId.contains("4.0"))
+ setVersion("4.0");
+ if (dtdPublicId != null && dtdPublicId.contains("4.2"))
+ setVersion("4.2");
+ if (dtdPublicId != null && dtdPublicId.contains("5.0"))
+ setVersion("5.0");
+ }
+ /**
+ * Get the DTD public id if one was seen
+ * @return the value of the web.xml dtd public id
+ */
+ @XmlTransient
+ public String getDtdPublicId()
+ {
+ return dtdPublicId;
+ }
+ /**
+ * Get the DTD system id if one was seen
+ * @return the value of the web.xml dtd system id
+ */
+ @XmlTransient
+ public String getDtdSystemId()
+ {
+ return dtdSystemId;
+ }
+
+ @XmlTransient
+ public InterceptorsMetaData getInterceptors()
+ {
+ return interceptors;
+ }
+
+ /**
+ * Get the jboss.xml version.
+ *
+ * @return the version.
+ */
+ public String getVersion()
+ {
+ return version;
+ }
+
+ /**
+ * Set the version.
+ *
+ * @param version the version.
+ * @throws IllegalArgumentException for a null version
+ */
+ @XmlAttribute
+ public void setVersion(String version)
+ {
+ if (version == null)
+ throw new IllegalArgumentException("Null version");
+ this.version = version;
+ }
+
+ public JBossAssemblyDescriptorMetaData getAssemblyDescriptor()
+ {
+ return assemblyDescriptor;
+ }
+
+ public String getEjbClientJar()
+ {
+ return this.ejbClientJar;
+ }
+ public void setEjbClientJar(String ejbClientJar)
+ {
+ this.ejbClientJar = ejbClientJar;
+ }
+
+ public RelationsMetaData getRelationships()
+ {
+ return this.relationships;
+ }
+ public void setRelationships(RelationsMetaData relationships)
+ {
+ this.relationships = relationships;
+ }
+
+ public boolean isEJB1x()
+ {
+ return ejbVersion != null && ejbVersion.contains("1.");
+ }
+
+ public boolean isEJB21()
+ {
+ return ejbVersion != null && ejbVersion.contains("2.1");
+ }
+
+ public boolean isEJB2x()
+ {
+ return ejbVersion != null && ejbVersion.contains("2.");
+ }
+
+ public boolean isEJB3x()
+ {
+ return ejbVersion != null && ejbVersion.contains("3.");
+ }
+
+ /**
+ * Get the loaderRepository.
+ *
+ * @return the loaderRepository.
+ */
+ public LoaderRepositoryMetaData getLoaderRepository()
+ {
+ return loaderRepository;
+ }
+
+ /**
+ * Set the loaderRepository.
+ *
+ * @param loaderRepository the loaderRepository.
+ * @throws IllegalArgumentException for a null loaderRepository
+ */
+ public void setLoaderRepository(LoaderRepositoryMetaData loaderRepository)
+ {
+ if (loaderRepository == null)
+ throw new IllegalArgumentException("Null loaderRepository");
+ this.loaderRepository = loaderRepository;
+ }
+
+ /**
+ * Get the jmxName.
+ *
+ * @return the jmxName.
+ */
+ public String getJmxName()
+ {
+ return jmxName;
+ }
+
+ public String getJaccContextID()
+ {
+ return jaccContextID;
+ }
+
+ /**
+ * Set the jmxName.
+ *
+ * @param jmxName the jmxName.
+ * @throws IllegalArgumentException for a null jmxName
+ */
+ public void setJmxName(String jmxName)
+ {
+ if (jmxName == null)
+ throw new IllegalArgumentException("Null jmxName");
+ this.jmxName = jmxName;
+ }
+
+ /**
+ * Set the JACC context id
+ * @param jaccContextID the id to use for the bean JACC context
+ */
+ public void setJaccContextID(String jaccContextID)
+ {
+ this.jaccContextID = jaccContextID;
+ }
+
+ /**
+ * Get the securityDomain.
+ *
+ * @return the securityDomain.
+ */
+ public String getSecurityDomain()
+ {
+ return securityDomain;
+ }
+
+ /**
+ * Set the securityDomain.
+ *
+ * @param securityDomain the securityDomain.
+ * @throws IllegalArgumentException for a null securityDomain
+ */
+ public void setSecurityDomain(String securityDomain)
+ {
+ if (securityDomain == null)
+ throw new IllegalArgumentException("Null securityDomain");
+ this.securityDomain = securityDomain.trim();
+ }
+
+ /**
+ * Get the excludeMissingMethods.
+ *
+ * @return the excludeMissingMethods.
+ */
+ public boolean isExcludeMissingMethods()
+ {
+ return excludeMissingMethods;
+ }
+
+ /**
+ * Set the excludeMissingMethods.
+ *
+ * @param excludeMissingMethods the excludeMissingMethods.
+ */
+ @XmlElement(name="missing-method-permissions-excluded-mode")
+ public void setExcludeMissingMethods(boolean excludeMissingMethods)
+ {
+ this.excludeMissingMethods = excludeMissingMethods;
+ }
+
+ /**
+ * Get the unauthenticatedPrincipal.
+ *
+ * @return the unauthenticatedPrincipal.
+ */
+ public String getUnauthenticatedPrincipal()
+ {
+ return unauthenticatedPrincipal;
+ }
+
+ /**
+ * Set the unauthenticatedPrincipal.
+ *
+ * @param unauthenticatedPrincipal the unauthenticatedPrincipal.
+ * @throws IllegalArgumentException for a null unauthenticatedPrincipal
+ */
+ public void setUnauthenticatedPrincipal(String unauthenticatedPrincipal)
+ {
+ if (unauthenticatedPrincipal == null)
+ throw new IllegalArgumentException("Null unauthenticatedPrincipal");
+ this.unauthenticatedPrincipal = unauthenticatedPrincipal;
+ }
+
+ /**
+ * Get the exceptionOnRollback.
+ *
+ * @return the exceptionOnRollback.
+ */
+ public boolean isExceptionOnRollback()
+ {
+ return exceptionOnRollback;
+ }
+
+ /**
+ * Set the exceptionOnRollback.
+ *
+ * @param exceptionOnRollback the exceptionOnRollback.
+ */
+ public void setExceptionOnRollback(boolean exceptionOnRollback)
+ {
+ this.exceptionOnRollback = exceptionOnRollback;
+ }
+
+ public boolean isMetadataComplete()
+ {
+ return metadataComplete;
+ }
+
+ public void setMetadataComplete(boolean metadataComplete)
+ {
+ this.metadataComplete = metadataComplete;
+ }
+
+ /**
+ * Get the enterpriseBeans.
+ *
+ * @return the enterpriseBeans.
+ */
+ public JBossEnterpriseBeansMetaData getEnterpriseBeans()
+ {
+ return enterpriseBeans;
+ }
+
+ /**
+ * Set the enterpriseBeans.
+ *
+ * @param enterpriseBeans the enterpriseBeans.
+ * @throws IllegalArgumentException for a null enterpriseBeans
+ */
+ @XmlElement(name="enterprise-beans")
+ public void setEnterpriseBeans(JBossEnterpriseBeansMetaData enterpriseBeans)
+ {
+ if (enterpriseBeans == null)
+ throw new IllegalArgumentException("Null enterpriseBeans");
+ this.enterpriseBeans = enterpriseBeans;
+ this.enterpriseBeans.setJBossMetaData(this);
+ }
+
+ /**
+ * Get an enterprise bean
+ *
+ * @param name the name
+ * @return the container configuration
+ */
+ public JBossEnterpriseBeanMetaData getEnterpriseBean(String name)
+ {
+ if (enterpriseBeans == null)
+ return null;
+ return enterpriseBeans.get(name);
+ }
+
+ /**
+ * Set the enforceEjbRestrictions.
+ *
+ * @param enforceEjbRestrictions the enforceEjbRestrictions.
+ * @throws IllegalArgumentException for a null enforceEjbRestrictions
+ */
+ public void setEnforceEjbRestrictions(String enforceEjbRestrictions)
+ {
+ log.warn("<enforce-ejb-restrictions/> in jboss.xml is no longer used and will be removed in a future version.");
+ }
+
+ /**
+ * Get the webservices.
+ *
+ * @return the webservices.
+ */
+ public WebservicesMetaData getWebservices()
+ {
+ return webservices;
+ }
+
+ /**
+ * Set the webservices.
+ *
+ * @param webservices the webservices.
+ * @throws IllegalArgumentException for a null webservices
+ */
+ public void setWebservices(WebservicesMetaData webservices)
+ {
+ if (webservices == null)
+ throw new IllegalArgumentException("Null webservices");
+ this.webservices = webservices;
+ }
+
+ /**
+ * Get the containerConfigurations.
+ *
+ * @return the containerConfigurations.
+ */
+ public ContainerConfigurationsMetaData getContainerConfigurations()
+ {
+ return containerConfigurations;
+ }
+
+ /**
+ * Set the containerConfigurations.
+ *
+ * @param containerConfigurations the containerConfigurations.
+ * @throws IllegalArgumentException for a null containerConfigurations
+ */
+ public void setContainerConfigurations(ContainerConfigurationsMetaData containerConfigurations)
+ {
+ if (containerConfigurations == null)
+ throw new IllegalArgumentException("Null containerConfigurations");
+ this.containerConfigurations = containerConfigurations;
+ }
+
+ /**
+ * Get a container configuration
+ *
+ * @param name the name
+ * @return the container configuration
+ */
+ public ContainerConfigurationMetaData getContainerConfiguration(String name)
+ {
+ if (containerConfigurations == null)
+ return null;
+ return containerConfigurations.get(name);
+ }
+
+ /**
+ * Get the invokerProxyBindings.
+ *
+ * @return the invokerProxyBindings.
+ */
+ public InvokerProxyBindingsMetaData getInvokerProxyBindings()
+ {
+ return invokerProxyBindings;
+ }
+
+ /**
+ * Set the invokerProxyBindings.
+ *
+ * @param invokerProxyBindings the invokerProxyBindings.
+ * @throws IllegalArgumentException for a null invokerProxyBindings
+ */
+ public void setInvokerProxyBindings(InvokerProxyBindingsMetaData invokerProxyBindings)
+ {
+ if (invokerProxyBindings == null)
+ throw new IllegalArgumentException("Null invokerProxyBindings");
+ this.invokerProxyBindings = invokerProxyBindings;
+ }
+
+ /**
+ * Get an invoker proxy binding
+ *
+ * @param name the name
+ * @return the invoker proxy binding
+ */
+ public InvokerProxyBindingMetaData getInvokerProxyBinding(String name)
+ {
+ if (invokerProxyBindings == null)
+ return null;
+ return invokerProxyBindings.get(name);
+ }
+
+ /**
+ * Get the resourceManagers.
+ *
+ * @return the resourceManagers.
+ */
+ public ResourceManagersMetaData getResourceManagers()
+ {
+ return resourceManagers;
+ }
+
+ /**
+ * Set the resourceManagers.
+ *
+ * @param resourceManagers the resourceManagers.
+ * @throws IllegalArgumentException for a null resourceManagers
+ */
+ public void setResourceManagers(ResourceManagersMetaData resourceManagers)
+ {
+ if (resourceManagers == null)
+ throw new IllegalArgumentException("Null resourceManagers");
+ this.resourceManagers = resourceManagers;
+ }
+
+ /**
+ * Get a resource manager
+ *
+ * @param name the name
+ * @return the resource manager
+ */
+ public ResourceManagerMetaData getResourceManager(String name)
+ {
+ if (resourceManagers == null)
+ return null;
+ return resourceManagers.get(name);
+ }
+
+ /**
+ * Set the assemblyDescriptor.
+ *
+ * @param assemblyDescriptor the assemblyDescriptor.
+ * @throws IllegalArgumentException for a null assemblyDescriptor
+ */
+ public void setAssemblyDescriptor(JBossAssemblyDescriptorMetaData assemblyDescriptor)
+ {
+ if (assemblyDescriptor == null)
+ throw new IllegalArgumentException("Null assemblyDescriptor");
+ this.assemblyDescriptor = assemblyDescriptor;
+ }
+
+ public String getJndiBindingPolicy()
+ {
+ return jndiBindingPolicy;
+ }
+
+ public void setJndiBindingPolicy(String jndiBindingPolicy)
+ {
+ this.jndiBindingPolicy = jndiBindingPolicy;
+ }
+
+ /**
+ * Access the RunAsIdentity associated with the given servlet
+ * @param ejbName - the servlet-name from the web.xml
+ * @return RunAsIdentity for the servet if one exists, null otherwise
+ */
+ @XmlTransient
+ public RunAsIdentityMetaData getRunAsIdentity(String ejbName)
+ {
+ RunAsIdentityMetaData identity = runAsIdentity.get(ejbName);
+ if (identity == null)
+ {
+ JBossEnterpriseBeanMetaData ejb = this.getEnterpriseBean(ejbName);
+ if (ejb != null)
+ {
+ // Check for a ejb-jar.xml run-as only specification
+ synchronized (runAsIdentity)
+ {
+ SecurityIdentityMetaData si = ejb.getSecurityIdentity();
+ if(si != null)
+ {
+ RunAsMetaData runAs = si.getRunAs();
+ if (runAs != null)
+ {
+ String roleName = runAs.getRoleName();
+ identity = new RunAsIdentityMetaData(roleName, null);
+ runAsIdentity.put(ejbName, identity);
+ }
+ }
+ }
+ }
+ }
+ return identity;
+ }
+
+ /**
+ * Get the ejb deployment summary information.
+ * @return the associated ejb deployment summary if a deployer has
+ * set it. May be null.
+ */
+ @XmlTransient
+ public DeploymentSummary getDeploymentSummary()
+ {
+ return deploymentSummary;
+ }
+ public void setDeploymentSummary(DeploymentSummary deploymentSummary)
+ {
+ this.deploymentSummary = deploymentSummary;
+ }
+
+ /**
+ * Merge the contents of override with original into this.
+ *
+ * @param override data which overrides original
+ * @param original the original data
+ */
+ public void merge(JBossMetaData override, EjbJarMetaData original)
+ {
+ super.merge(override, original);
+ if(assemblyDescriptor == null)
+ assemblyDescriptor = new JBossAssemblyDescriptorMetaData();
+ if(resourceManagers == null)
+ resourceManagers = new ResourceManagersMetaData();
+ if(containerConfigurations == null)
+ containerConfigurations = new ContainerConfigurationsMetaData();
+ if(override != null && override.containerConfigurations != null)
+ containerConfigurations.merge(override.containerConfigurations);
+ if(invokerProxyBindings == null)
+ invokerProxyBindings = new InvokerProxyBindingsMetaData();
+ if(override != null && override.invokerProxyBindings != null)
+ invokerProxyBindings.merge(override.invokerProxyBindings);
+ if(interceptors == null)
+ interceptors = new InterceptorsMetaData();
+ if(override != null && override.webservices != null)
+ webservices = new WebservicesMetaData();
+
+ if(original != null)
+ {
+ ejbVersion = original.getVersion();
+ relationships = original.getRelationships();
+ if(original instanceof EjbJar3xMetaData)
+ {
+ EjbJar3xMetaData original3x = (EjbJar3xMetaData) original;
+ metadataComplete = original3x.isMetadataComplete();
+ }
+ }
+
+ if(override != null && override.assemblyDescriptor != null)
+ {
+ assemblyDescriptor.merge(override.assemblyDescriptor, original.getAssemblyDescriptor());
+ }
+ else if(original != null && original.getAssemblyDescriptor() != null)
+ {
+ assemblyDescriptor.merge(null, original.getAssemblyDescriptor());
+ }
+ //
+ if(override != null && override.resourceManagers != null)
+ resourceManagers.merge(override.resourceManagers);
+
+ if(override != null && override.interceptors != null)
+ interceptors.merge(override.interceptors);
+ else if(original != null && original.getInterceptors() != null)
+ interceptors.merge(original.getInterceptors());
+
+ if(override != null)
+ {
+ if(override.jaccContextID != null)
+ jaccContextID = override.jaccContextID;
+ if(override.jmxName != null)
+ jmxName = override.jmxName;
+ if(override.loaderRepository != null)
+ loaderRepository = override.loaderRepository;
+ if(override.securityDomain != null)
+ securityDomain = override.securityDomain;
+ if(override.unauthenticatedPrincipal != null)
+ unauthenticatedPrincipal = override.unauthenticatedPrincipal;
+ if(override.metadataComplete)
+ metadataComplete = true;
+ }
+
+ if (webservices != null && override != null)
+ webservices.merge(override.webservices);
+
+ if(enterpriseBeans == null)
+ {
+ enterpriseBeans = new JBossEnterpriseBeansMetaData();
+ enterpriseBeans.setJBossMetaData(this);
+ }
+
+ JBossEnterpriseBeansMetaData jbeans = null;
+ if(override != null)
+ {
+ jbeans = override.enterpriseBeans;
+
+ //Ensure that there is no customization of the Unspecified method permissions
+ if(override.excludeMissingMethods == false)
+ this.excludeMissingMethods = false;
+ }
+
+ EnterpriseBeansMetaData beans = null;
+ if(original != null)
+ beans = original.getEnterpriseBeans();
+
+ boolean isEJB3x = (original == null || original.isEJB3x());
+ enterpriseBeans.merge(jbeans, beans, "ejb-jar.xml", "jboss.xml", !isEJB3x);
+
+ // Update run-as indentity for a run-as-principal
+ if(enterpriseBeans != null)
+ {
+ for(JBossEnterpriseBeanMetaData ejb : enterpriseBeans)
+ {
+ String ejbName = ejb.getEjbName();
+ SecurityIdentityMetaData si = ejb.getSecurityIdentity();
+ String principalName = si != null ? si.getRunAsPrincipal() : null;
+ // Get the run-as primary role
+ String ejbXmlRunAs = null;
+ if(si != null && si.getRunAs() != null)
+ ejbXmlRunAs = si.getRunAs().getRoleName();
+ if (principalName != null)
+ {
+ // Update the run-as indentity to use the principal name
+ if (ejbXmlRunAs == null)
+ {
+ // Can't make this check since the name may come from an annotation
+ //throw new IllegalStateException("run-as-principal: " + principalName + " found in jboss.xml but there was no run-as in ejb-jar.xml");
+ ejbXmlRunAs = "anonymous";
+ }
+ // See if there are any additional roles for this principal
+ Set<String> extraRoles = null;
+ if(getAssemblyDescriptor() != null)
+ {
+ extraRoles = getAssemblyDescriptor().getSecurityRoleNamesByPrincipal(principalName);
+ }
+ RunAsIdentityMetaData runAsId = new RunAsIdentityMetaData(ejbXmlRunAs, principalName, extraRoles);
+ runAsIdentity.put(ejbName, runAsId);
+ }
+ else if (ejbXmlRunAs != null)
+ {
+ RunAsIdentityMetaData runAsId = new RunAsIdentityMetaData(ejbXmlRunAs, null);
+ runAsIdentity.put(ejbName, runAsId);
+ }
+ }
+ }
+ }
+
+ /**
+ *
+ * @return
+ */
+ protected JBossEnterpriseBeanMetaData newBean()
+ {
+ return null;
+ }
+}
Deleted: projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossSessionBeanMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/ejb/jboss/JBossSessionBeanMetaData.java 2008-05-07 21:59:24 UTC (rev 73125)
+++ projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossSessionBeanMetaData.java 2008-05-08 00:46:24 UTC (rev 73129)
@@ -1,954 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.metadata.ejb.jboss;
-
-import java.util.List;
-
-import org.jboss.metadata.ejb.jboss.jndipolicy.spi.EjbDeploymentSummary;
-import org.jboss.metadata.ejb.spec.AroundInvokesMetaData;
-import org.jboss.metadata.ejb.spec.BusinessLocalsMetaData;
-import org.jboss.metadata.ejb.spec.BusinessRemotesMetaData;
-import org.jboss.metadata.ejb.spec.EnterpriseBeanMetaData;
-import org.jboss.metadata.ejb.spec.InitMethodsMetaData;
-import org.jboss.metadata.ejb.spec.NamedMethodMetaData;
-import org.jboss.metadata.ejb.spec.RemoveMethodsMetaData;
-import org.jboss.metadata.ejb.spec.SecurityIdentityMetaData;
-import org.jboss.metadata.ejb.spec.SessionBeanMetaData;
-import org.jboss.metadata.ejb.spec.SessionType;
-import org.jboss.metadata.javaee.spec.LifecycleCallbacksMetaData;
-import org.jboss.metadata.javaee.spec.PortComponent;
-import org.jboss.metadata.javaee.spec.SecurityRoleRefsMetaData;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-/**
- * SessionBeanMetaData.
- *
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @author Scott.Stark at jboss.org
- * @version $Revision$
- */
- at XmlType(name="jboss-session-beanType")
-public class JBossSessionBeanMetaData extends JBossEnterpriseBeanMetaData
-{
- /** The serialVersionUID */
- private static final long serialVersionUID = 720735017632869718L;
-
- /** The home interface */
- private String home;
-
- /** The remote interface */
- private String remote;
-
- /** The local home */
- private String localHome;
-
- /** The local */
- private String local;
-
- /** The business locals */
- private BusinessLocalsMetaData businessLocals;
-
- /** The business remotes */
- private BusinessRemotesMetaData businessRemotes;
-
- /** The service endpoint */
- private String serviceEndpoint;
-
- /** The sesion type */
- private SessionType sessionType;
-
- /** The timeout method */
- private NamedMethodMetaData timeoutMethod;
-
- /** The init methods */
- private InitMethodsMetaData initMethods;
-
- /** The remove methods */
- private RemoveMethodsMetaData removeMethods;
-
- /** The around invoke */
- private AroundInvokesMetaData aroundInvokes;
-
- /** The post activates */
- private LifecycleCallbacksMetaData postActivates;
-
- /** The pre passivates */
- private LifecycleCallbacksMetaData prePassivates;
-
- /** The security role ref */
- private SecurityRoleRefsMetaData securityRoleRefs;
-
- /** The jndi name */
- private String jndiName;
-
- /** The home jndi name*/
- private String homeJndiName;
-
- /** The local home jndi name */
- private String localHomeJndiName;
-
- /** Whether to call by value */
- private boolean callByValue;
-
- /** The remote bindings */
- private List<RemoteBindingMetaData> remoteBindings;
-
- /** Whether this bean is clustered */
- private boolean clustered;
-
- /** The cluster config */
- private ClusterConfigMetaData clusterConfig;
-
- /** The determined cluster config */
- private transient ClusterConfigMetaData determinedClusterConfig;
-
- /** The webservices port-component */
- private PortComponent portComponent;
-
- /** The ejb timeout identity */
- private SecurityIdentityMetaData ejbTimeoutIdentity;
-
- /** The cache configuration */
- private CacheConfigMetaData cacheConfig;
-
- /** Whether the bean is concurrent */
- private Boolean concurrent;
-
- /**
- * Create a new SessionBeanMetaData.
- */
- public JBossSessionBeanMetaData()
- {
- // For serialization
- }
-
- @Override
- public boolean isSession()
- {
- return true;
- }
-
- public CacheConfigMetaData getCacheConfig()
- {
- return this.cacheConfig;
- }
-
- public void setCacheConfig(CacheConfigMetaData cacheConfig)
- {
- this.cacheConfig = cacheConfig;
- }
-
- /**
- * Get the home.
- *
- * @return the home.
- */
- public String getHome()
- {
- return home;
- }
-
- /**
- * Set the home.
- *
- * @param home the home.
- * @throws IllegalArgumentException for a null home
- */
- public void setHome(String home)
- {
- if (home == null)
- throw new IllegalArgumentException("Null home");
- this.home = home;
- }
-
- public String getHomeJndiName()
- {
- return homeJndiName;
- }
-
- public void setHomeJndiName(String homeJndiName)
- {
- assert homeJndiName != null : "homeJndiName is null";
-
- this.homeJndiName = homeJndiName;
- }
-
- /**
- * Get the remote.
- *
- * @return the remote.
- */
- public String getRemote()
- {
- return remote;
- }
-
- /**
- * Set the remote.
- *
- * @param remote the remote.
- * @throws IllegalArgumentException for a null remote
- */
- public void setRemote(String remote)
- {
- if (remote == null)
- throw new IllegalArgumentException("Null remote");
- this.remote = remote;
- }
-
- /**
- * Get the localHome.
- *
- * @return the localHome.
- */
- public String getLocalHome()
- {
- return localHome;
- }
-
- /**
- * Set the localHome.
- *
- * @param localHome the localHome.
- * @throws IllegalArgumentException for a null localHome
- */
- public void setLocalHome(String localHome)
- {
- if (localHome == null)
- throw new IllegalArgumentException("Null localHome");
- this.localHome = localHome;
- }
-
- /**
- * Get the local.
- *
- * @return the local.
- */
- public String getLocal()
- {
- return local;
- }
-
- /**
- * Set the local.
- *
- * @param local the local.
- * @throws IllegalArgumentException for a null local
- */
- public void setLocal(String local)
- {
- if (local == null)
- throw new IllegalArgumentException("Null local");
- this.local = local;
- }
-
- public String getLocalHomeJndiName()
- {
- return localHomeJndiName;
- }
-
- public void setLocalHomeJndiName(String localHomeJndiName)
- {
- assert localHomeJndiName != null : "localHomeJndiName is null";
-
- this.localHomeJndiName = localHomeJndiName;
- }
-
- /**
- * Get the businessLocals.
- *
- * @return the businessLocals.
- */
- public BusinessLocalsMetaData getBusinessLocals()
- {
- return businessLocals;
- }
-
- /**
- * Set the businessLocals.
- *
- * @param businessLocals the businessLocals.
- * @throws IllegalArgumentException for a null businessLocasl
- */
- @XmlElement(name="business-local", required=false)
- public void setBusinessLocals(BusinessLocalsMetaData businessLocals)
- {
- if (businessLocals == null)
- throw new IllegalArgumentException("Null businessLocals");
- this.businessLocals = businessLocals;
- }
-
- /**
- * Get the businessRemotes.
- *
- * @return the businessRemotes.
- */
- public BusinessRemotesMetaData getBusinessRemotes()
- {
- return businessRemotes;
- }
-
- /**
- * Set the businessRemotes.
- *
- * @param businessRemotes the businessRemotes.
- * @throws IllegalArgumentException for a null businessRemotes
- */
- @XmlElement(name="business-remote", required=false)
- public void setBusinessRemotes(BusinessRemotesMetaData businessRemotes)
- {
- if (businessRemotes == null)
- throw new IllegalArgumentException("Null businessRemotes");
- this.businessRemotes = businessRemotes;
- }
-
- /**
- * Get the serviceEndpoint.
- *
- * @return the serviceEndpoint.
- */
- public String getServiceEndpoint()
- {
- return serviceEndpoint;
- }
-
- /**
- * Set the serviceEndpoint.
- *
- * @param serviceEndpoint the serviceEndpoint.
- * @throws IllegalArgumentException for a null serviceEndpoint
- */
- public void setServiceEndpoint(String serviceEndpoint)
- {
- if (serviceEndpoint == null)
- throw new IllegalArgumentException("Null serviceEndpoint");
- this.serviceEndpoint = serviceEndpoint;
- }
-
- /**
- * Get the sessionType.
- *
- * @return the sessionType.
- */
- public SessionType getSessionType()
- {
- return sessionType;
- }
-
- /**
- * Set the sessionType.
- *
- * @param sessionType the sessionType.
- * @throws IllegalArgumentException for a null sessionType
- */
- public void setSessionType(SessionType sessionType)
- {
- if (sessionType == null)
- throw new IllegalArgumentException("Null sessionType");
- this.sessionType = sessionType;
- }
-
- /**
- * Is this stateful
- *
- * @return true for stateful
- */
- public boolean isStateful()
- {
- if (sessionType == null)
- return false;
- return sessionType == SessionType.Stateful;
- }
-
- /**
- * Is this stateless
- *
- * @return true for stateless
- */
- public boolean isStateless()
- {
- return isStateful() == false;
- }
-
- /**
- * Get the timeoutMethod.
- *
- * @return the timeoutMethod.
- */
- public NamedMethodMetaData getTimeoutMethod()
- {
- return timeoutMethod;
- }
-
- /**
- * Set the timeoutMethod.
- *
- * @param timeoutMethod the timeoutMethod.
- * @throws IllegalArgumentException for a null timeoutMethod
- */
- @XmlElement(required=false)
- public void setTimeoutMethod(NamedMethodMetaData timeoutMethod)
- {
- if (timeoutMethod == null)
- throw new IllegalArgumentException("Null timeoutMethod");
- this.timeoutMethod = timeoutMethod;
- }
-
- /**
- * Get the initMethods.
- *
- * @return the initMethods.
- */
- public InitMethodsMetaData getInitMethods()
- {
- return initMethods;
- }
-
- /**
- * Set the initMethods.
- *
- * @param initMethods the initMethods.
- * @throws IllegalArgumentException for a null initMethods
- */
- @XmlElement(name="init-method", required=false)
- public void setInitMethods(InitMethodsMetaData initMethods)
- {
- if (initMethods == null)
- throw new IllegalArgumentException("Null initMethods");
- this.initMethods = initMethods;
- }
-
- /**
- * Get the removeMethods.
- *
- * @return the removeMethods.
- */
- public RemoveMethodsMetaData getRemoveMethods()
- {
- return removeMethods;
- }
-
- /**
- * Set the removeMethods.
- *
- * @param removeMethods the removeMethods.
- * @throws IllegalArgumentException for a null removeMethods
- */
- @XmlElement(name="remove-method", required=false)
- public void setRemoveMethods(RemoveMethodsMetaData removeMethods)
- {
- if (removeMethods == null)
- throw new IllegalArgumentException("Null removeMethods");
- this.removeMethods = removeMethods;
- }
-
- /**
- * Get the aroundInvokes.
- *
- * @return the aroundInvokes.
- */
- public AroundInvokesMetaData getAroundInvokes()
- {
- return aroundInvokes;
- }
-
- /**
- * Set the aroundInvokes.
- *
- * @param aroundInvokes the aroundInvokes.
- * @throws IllegalArgumentException for a null aroundInvokes
- */
- @XmlElement(name="around-invoke", required=false)
- public void setAroundInvokes(AroundInvokesMetaData aroundInvokes)
- {
- if (aroundInvokes == null)
- throw new IllegalArgumentException("Null aroundInvokes");
- this.aroundInvokes = aroundInvokes;
- }
-
- /**
- * Get the postActivates.
- *
- * @return the postActivates.
- */
- public LifecycleCallbacksMetaData getPostActivates()
- {
- return postActivates;
- }
-
- /**
- * Set the postActivates.
- *
- * @param postActivates the postActivates.
- * @throws IllegalArgumentException for a null postActivates
- */
- @XmlElement(name="post-activate", required=false)
- public void setPostActivates(LifecycleCallbacksMetaData postActivates)
- {
- if (postActivates == null)
- throw new IllegalArgumentException("Null postActivates");
- this.postActivates = postActivates;
- }
-
- /**
- * Get the prePassivates.
- *
- * @return the prePassivates.
- */
- public LifecycleCallbacksMetaData getPrePassivates()
- {
- return prePassivates;
- }
-
- /**
- * Set the prePassivates.
- *
- * @param prePassivates the prePassivates.
- * @throws IllegalArgumentException for a null prePassivates
- */
- @XmlElement(name="pre-passivate", required=false)
- public void setPrePassivates(LifecycleCallbacksMetaData prePassivates)
- {
- if (prePassivates == null)
- throw new IllegalArgumentException("Null prePassivates");
- this.prePassivates = prePassivates;
- }
-
- /**
- * Get the securityRoleRefs.
- *
- * @return the securityRoleRefs.
- */
- public SecurityRoleRefsMetaData getSecurityRoleRefs()
- {
- return securityRoleRefs;
- }
-
- /**
- * Set the securityRoleRefs.
- *
- * @param securityRoleRefs the securityRoleRefs.
- * @throws IllegalArgumentException for a null securityRoleRefs
- */
- @XmlElement(name="security-role-ref")
- public void setSecurityRoleRefs(SecurityRoleRefsMetaData securityRoleRefs)
- {
- if (securityRoleRefs == null)
- throw new IllegalArgumentException("Null securityRoleRefs");
- this.securityRoleRefs = securityRoleRefs;
- }
-
- @Override
- public String getDefaultConfigurationName()
- {
- boolean stateful = isStateful();
- if (stateful)
- {
- if (isClustered())
- return ContainerConfigurationMetaData.CLUSTERED_STATEFUL;
- else
- return ContainerConfigurationMetaData.STATEFUL;
- }
- else
- {
- if (isClustered())
- return ContainerConfigurationMetaData.CLUSTERED_STATELESS;
- else
- return ContainerConfigurationMetaData.STATELESS;
- }
- }
-
- @Override
- public String getDefaultInvokerName()
- {
- boolean stateful = isStateful();
- if (stateful)
- {
- if (isClustered())
- return InvokerBindingMetaData.CLUSTERED_STATEFUL;
- else
- return InvokerBindingMetaData.STATEFUL;
- }
- else
- {
- if (isClustered())
- return InvokerBindingMetaData.CLUSTERED_STATELESS;
- else
- return InvokerBindingMetaData.STATELESS;
- }
- }
-
- /**
- * Get the jndiName.
- *
- * @return the jndiName.
- */
- public String getJndiName()
- {
- return jndiName;
- }
-
- /**
- * Set the jndiName.
- *
- * @param jndiName the jndiName.
- * @throws IllegalArgumentException for a null jndiName
- */
- public void setJndiName(String jndiName)
- {
- if (jndiName == null)
- throw new IllegalArgumentException("Null jndiName");
- this.jndiName = jndiName;
- }
-
- /**
- * Determine the jndi name
- *
- * @return the jndi name
- */
- public String determineJndiName()
- {
- String name = getHomeJndiName();
- if (name == null)
- name = jndiName;
- if(name == null)
- name = getMappedName();
- if(name == null && getRemoteBindings() != null && getRemoteBindings().size() > 0)
- name = getRemoteBindings().get(0).getJndiName();
- // TODO: JBMETA-6, this should be the policy with ejb2 metadata defaulting to an ejb-name policy
- if(name == null)
- name = getEjbName();
- return name;
- }
-
- @Override
- public String getContainerObjectNameJndiName()
- {
- boolean remote = false;
- if (getHome() != null)
- remote = true;
- return remote ? determineJndiName() : getLocalJndiName();
- }
-
- @Override
- protected String getDefaultInvokerJndiName()
- {
- return determineJndiName();
- }
-
- /**
- * Get the callByValue.
- *
- * @return the callByValue.
- */
- public boolean isCallByValue()
- {
- return callByValue;
- }
-
- /**
- * Set the callByValue.
- *
- * @param callByValue the callByValue.
- */
- public void setCallByValue(boolean callByValue)
- {
- this.callByValue = callByValue;
- }
-
- /**
- * Get the clustered.
- *
- * @return the clustered.
- */
- public boolean isClustered()
- {
- return clustered;
- }
-
- /**
- * Set the clustered.
- *
- * @param clustered the clustered.
- */
- public void setClustered(boolean clustered)
- {
- this.clustered = clustered;
- }
-
- /**
- * Get the concurrent.
- *
- * @return the concurrent.
- */
- public Boolean isConcurrent()
- {
- return concurrent;
- }
-
- /**
- * Set the concurrent.
- *
- * @param concurrent the concurrent.
- */
- public void setConcurrent(Boolean concurrent)
- {
- this.concurrent = concurrent;
- }
-
- /**
- * Get the ejbTimeoutIdentity.
- *
- * @return the ejbTimeoutIdentity.
- */
- public SecurityIdentityMetaData getEjbTimeoutIdentity()
- {
- return ejbTimeoutIdentity;
- }
-
- /**
- * Set the ejbTimeoutIdentity.
- *
- * @param ejbTimeoutIdentity the ejbTimeoutIdentity.
- * @throws IllegalArgumentException for a null ejbTimeoutIdentity
- */
- public void setEjbTimeoutIdentity(SecurityIdentityMetaData ejbTimeoutIdentity)
- {
- if (ejbTimeoutIdentity == null)
- throw new IllegalArgumentException("Null ejbTimeoutIdentity");
- this.ejbTimeoutIdentity = ejbTimeoutIdentity;
- }
-
- /**
- * Get the clusterConfig.
- *
- * @return the clusterConfig.
- */
- public ClusterConfigMetaData getClusterConfig()
- {
- return clusterConfig;
- }
-
- /**
- * Determine the clusterConfig.
- *
- * @return the clusterConfig.
- */
- public ClusterConfigMetaData determineClusterConfig()
- {
- if (determinedClusterConfig == null)
- {
- ClusterConfigMetaData containerDefaults = null;
- ContainerConfigurationMetaData container = determineContainerConfiguration();
- if (container != null)
- containerDefaults = container.getClusterConfig();
- determinedClusterConfig = new ClusterConfigMetaData();
- determinedClusterConfig.merge(clusterConfig, containerDefaults);
- }
- return determinedClusterConfig;
- }
-
- /**
- * Set the clusterConfig.
- *
- * @param clusterConfig the clusterConfig.
- * @throws IllegalArgumentException for a null clusterConfig
- */
- public void setClusterConfig(ClusterConfigMetaData clusterConfig)
- {
- if (clusterConfig == null)
- throw new IllegalArgumentException("Null clusterConfig");
- this.clusterConfig = clusterConfig;
- }
-
-
- public PortComponent getPortComponent()
- {
- return portComponent;
- }
-
- public void setPortComponent(PortComponent portComponent)
- {
- this.portComponent = portComponent;
- }
-
- /**
- * Get the remoteBinding.
- *
- * @return the remoteBinding.
- */
- public List<RemoteBindingMetaData> getRemoteBindings()
- {
- return remoteBindings;
- }
-
- /**
- * Set the remoteBinding.
- *
- * @param remoteBinding the remoteBinding.
- * @throws IllegalArgumentException for a null remoteBinding
- */
- @XmlElement(name="remote-binding", required=false)
- public void setRemoteBindings(List<RemoteBindingMetaData> remoteBindings)
- {
- if (remoteBindings == null)
- throw new IllegalArgumentException("Null remoteBinding");
- this.remoteBindings = remoteBindings;
- }
-
- @Override
- public void merge(JBossEnterpriseBeanMetaData override, EnterpriseBeanMetaData original, String overridenFile, String overrideFile, boolean mustOverride)
- {
- super.merge(override, original, overridenFile, overrideFile, mustOverride);
- JBossSessionBeanMetaData joverride = (JBossSessionBeanMetaData) override;
- SessionBeanMetaData soriginal = (SessionBeanMetaData) original;
-
- // home
- if(joverride != null && joverride.getHome() != null)
- home = joverride.getHome();
- else if(soriginal != null && soriginal.getHome() != null)
- home = soriginal.getHome();
- // remote
- if(joverride != null && joverride.getRemote() != null)
- remote = joverride.getRemote();
- else if(soriginal != null && soriginal.getRemote() != null)
- remote = soriginal.getRemote();
- // localHome
- if(joverride != null && joverride.getLocalHome() != null)
- localHome = joverride.getLocalHome();
- else if(soriginal != null && soriginal.getLocalHome() != null)
- localHome = soriginal.getLocalHome();
- // local
- if(joverride != null && joverride.getLocal() != null)
- local = joverride.getLocal();
- else if(soriginal != null && soriginal.getLocal() != null)
- local = soriginal.getLocal();
- // businessLocals
- if(joverride != null && joverride.getBusinessLocals() != null)
- businessLocals = joverride.getBusinessLocals();
- else if(soriginal != null && soriginal.getBusinessLocals() != null)
- businessLocals = soriginal.getBusinessLocals();
- // businessRemotes
- if(joverride != null && joverride.getBusinessRemotes() != null)
- businessRemotes = joverride.getBusinessRemotes();
- else if(soriginal != null && soriginal.getBusinessRemotes() != null)
- businessRemotes = soriginal.getBusinessRemotes();
- // serviceEndpoint
- if(joverride != null && joverride.getServiceEndpoint() != null)
- serviceEndpoint = joverride.getServiceEndpoint();
- else if(soriginal != null && soriginal.getServiceEndpoint() != null)
- serviceEndpoint = soriginal.getServiceEndpoint();
- // sessionType
- if(joverride != null && joverride.getSessionType() != null)
- sessionType = joverride.getSessionType();
- else if(soriginal != null && soriginal.getSessionType() != null)
- sessionType = soriginal.getSessionType();
- // timeoutMethod
- if(joverride != null && joverride.getTimeoutMethod() != null)
- timeoutMethod = joverride.getTimeoutMethod();
- else if(soriginal != null && soriginal.getTimeoutMethod() != null)
- timeoutMethod = soriginal.getTimeoutMethod();
- // initMethods
- if(joverride != null && joverride.getInitMethods() != null)
- initMethods = joverride.getInitMethods();
- else if(soriginal != null && soriginal.getInitMethods() != null)
- initMethods = soriginal.getInitMethods();
- // removeMethods
- if(joverride != null && joverride.getRemoveMethods() != null)
- removeMethods = joverride.getRemoveMethods();
- else if(soriginal != null && soriginal.getRemoveMethods() != null)
- removeMethods = soriginal.getRemoveMethods();
- // aroundInvokes
- if(joverride != null && joverride.getAroundInvokes() != null)
- aroundInvokes = joverride.getAroundInvokes();
- else if(soriginal != null && soriginal.getAroundInvokes() != null)
- aroundInvokes = soriginal.getAroundInvokes();
- // postActivates
- if(joverride != null && joverride.getPostActivates() != null)
- postActivates = joverride.getPostActivates();
- else if(soriginal != null && soriginal.getPostActivates() != null)
- postActivates = soriginal.getPostActivates();
- // prePassivates
- if(joverride != null && joverride.getPrePassivates() != null)
- prePassivates = joverride.getPrePassivates();
- else if(soriginal != null && soriginal.getPrePassivates() != null)
- prePassivates = soriginal.getPrePassivates();
- // securityRoleRefs
- if(joverride != null && joverride.getSecurityRoleRefs() != null)
- securityRoleRefs = joverride.getSecurityRoleRefs();
- else if(soriginal != null && soriginal.getSecurityRoleRefs() != null)
- securityRoleRefs = soriginal.getSecurityRoleRefs();
-
- if(joverride != null)
- {
- // jndiName
- if(joverride.getJndiName() != null)
- jndiName = joverride.getJndiName();
- // homeJndiName
- if(joverride.homeJndiName != null)
- homeJndiName = joverride.homeJndiName;
- // localHomeJndiName
- if(joverride.localHomeJndiName != null)
- localHomeJndiName = joverride.localHomeJndiName;
- // callByValue
- callByValue = joverride.isCallByValue();
- // clustered
- clustered = joverride.isClustered();
- // remoteBindings
- if(joverride.getRemoteBindings() != null)
- remoteBindings = joverride.getRemoteBindings();
- // clusterConfig
- if(joverride.getClusterConfig() != null)
- clusterConfig = joverride.getClusterConfig();
- // portComponent
- if(joverride.getPortComponent() != null)
- portComponent = joverride.getPortComponent();
- // ejbTimeoutIdentity
- if(joverride.getEjbTimeoutIdentity() != null)
- ejbTimeoutIdentity = joverride.getEjbTimeoutIdentity();
- }
- }
-
- @Override
- public void checkValid()
- {
- if(getEnterpriseBeansMetaData() != null && getEjbJarMetaData() != null)
- {
- // this is how the ejb3 deployer determines whether it's ejb3 module or not
- if(!(getEjbJarMetaData().isEJB1x() || getEjbJarMetaData().isEJB2x()))
- {
- if(this.home == null && this.homeJndiName != null)
- throw new IllegalStateException(
- "EJB3 bean " + getEjbName() +
- " doesn't define home interface but defines home-jndi-name '" +
- this.homeJndiName + "' in jboss.xml");
- if(this.localHome == null && this.localHomeJndiName != null)
- throw new IllegalStateException(
- "EJB3 bean " + getEjbName() +
- " doesn't define local-home interface but defines local-home-jndi-name '" +
- this.localHomeJndiName + "' in jboss.xml");
- }
- }
- }
-}
Copied: projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossSessionBeanMetaData.java (from rev 73126, projects/metadata/trunk/src/main/java/org/jboss/metadata/ejb/jboss/JBossSessionBeanMetaData.java)
===================================================================
--- projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossSessionBeanMetaData.java (rev 0)
+++ projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/JBossSessionBeanMetaData.java 2008-05-08 00:46:24 UTC (rev 73129)
@@ -0,0 +1,953 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.metadata.ejb.jboss;
+
+import java.util.List;
+
+import org.jboss.metadata.ejb.spec.AroundInvokesMetaData;
+import org.jboss.metadata.ejb.spec.BusinessLocalsMetaData;
+import org.jboss.metadata.ejb.spec.BusinessRemotesMetaData;
+import org.jboss.metadata.ejb.spec.EnterpriseBeanMetaData;
+import org.jboss.metadata.ejb.spec.InitMethodsMetaData;
+import org.jboss.metadata.ejb.spec.NamedMethodMetaData;
+import org.jboss.metadata.ejb.spec.RemoveMethodsMetaData;
+import org.jboss.metadata.ejb.spec.SecurityIdentityMetaData;
+import org.jboss.metadata.ejb.spec.SessionBeanMetaData;
+import org.jboss.metadata.ejb.spec.SessionType;
+import org.jboss.metadata.javaee.spec.LifecycleCallbacksMetaData;
+import org.jboss.metadata.javaee.spec.PortComponent;
+import org.jboss.metadata.javaee.spec.SecurityRoleRefsMetaData;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * SessionBeanMetaData.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+ at XmlType(name="jboss-session-beanType")
+public class JBossSessionBeanMetaData extends JBossEnterpriseBeanMetaData
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 720735017632869718L;
+
+ /** The home interface */
+ private String home;
+
+ /** The remote interface */
+ private String remote;
+
+ /** The local home */
+ private String localHome;
+
+ /** The local */
+ private String local;
+
+ /** The business locals */
+ private BusinessLocalsMetaData businessLocals;
+
+ /** The business remotes */
+ private BusinessRemotesMetaData businessRemotes;
+
+ /** The service endpoint */
+ private String serviceEndpoint;
+
+ /** The sesion type */
+ private SessionType sessionType;
+
+ /** The timeout method */
+ private NamedMethodMetaData timeoutMethod;
+
+ /** The init methods */
+ private InitMethodsMetaData initMethods;
+
+ /** The remove methods */
+ private RemoveMethodsMetaData removeMethods;
+
+ /** The around invoke */
+ private AroundInvokesMetaData aroundInvokes;
+
+ /** The post activates */
+ private LifecycleCallbacksMetaData postActivates;
+
+ /** The pre passivates */
+ private LifecycleCallbacksMetaData prePassivates;
+
+ /** The security role ref */
+ private SecurityRoleRefsMetaData securityRoleRefs;
+
+ /** The jndi name */
+ private String jndiName;
+
+ /** The home jndi name*/
+ private String homeJndiName;
+
+ /** The local home jndi name */
+ private String localHomeJndiName;
+
+ /** Whether to call by value */
+ private boolean callByValue;
+
+ /** The remote bindings */
+ private List<RemoteBindingMetaData> remoteBindings;
+
+ /** Whether this bean is clustered */
+ private boolean clustered;
+
+ /** The cluster config */
+ private ClusterConfigMetaData clusterConfig;
+
+ /** The determined cluster config */
+ private transient ClusterConfigMetaData determinedClusterConfig;
+
+ /** The webservices port-component */
+ private PortComponent portComponent;
+
+ /** The ejb timeout identity */
+ private SecurityIdentityMetaData ejbTimeoutIdentity;
+
+ /** The cache configuration */
+ private CacheConfigMetaData cacheConfig;
+
+ /** Whether the bean is concurrent */
+ private Boolean concurrent;
+
+ /**
+ * Create a new SessionBeanMetaData.
+ */
+ public JBossSessionBeanMetaData()
+ {
+ // For serialization
+ }
+
+ @Override
+ public boolean isSession()
+ {
+ return true;
+ }
+
+ public CacheConfigMetaData getCacheConfig()
+ {
+ return this.cacheConfig;
+ }
+
+ public void setCacheConfig(CacheConfigMetaData cacheConfig)
+ {
+ this.cacheConfig = cacheConfig;
+ }
+
+ /**
+ * Get the home.
+ *
+ * @return the home.
+ */
+ public String getHome()
+ {
+ return home;
+ }
+
+ /**
+ * Set the home.
+ *
+ * @param home the home.
+ * @throws IllegalArgumentException for a null home
+ */
+ public void setHome(String home)
+ {
+ if (home == null)
+ throw new IllegalArgumentException("Null home");
+ this.home = home;
+ }
+
+ public String getHomeJndiName()
+ {
+ return homeJndiName;
+ }
+
+ public void setHomeJndiName(String homeJndiName)
+ {
+ assert homeJndiName != null : "homeJndiName is null";
+
+ this.homeJndiName = homeJndiName;
+ }
+
+ /**
+ * Get the remote.
+ *
+ * @return the remote.
+ */
+ public String getRemote()
+ {
+ return remote;
+ }
+
+ /**
+ * Set the remote.
+ *
+ * @param remote the remote.
+ * @throws IllegalArgumentException for a null remote
+ */
+ public void setRemote(String remote)
+ {
+ if (remote == null)
+ throw new IllegalArgumentException("Null remote");
+ this.remote = remote;
+ }
+
+ /**
+ * Get the localHome.
+ *
+ * @return the localHome.
+ */
+ public String getLocalHome()
+ {
+ return localHome;
+ }
+
+ /**
+ * Set the localHome.
+ *
+ * @param localHome the localHome.
+ * @throws IllegalArgumentException for a null localHome
+ */
+ public void setLocalHome(String localHome)
+ {
+ if (localHome == null)
+ throw new IllegalArgumentException("Null localHome");
+ this.localHome = localHome;
+ }
+
+ /**
+ * Get the local.
+ *
+ * @return the local.
+ */
+ public String getLocal()
+ {
+ return local;
+ }
+
+ /**
+ * Set the local.
+ *
+ * @param local the local.
+ * @throws IllegalArgumentException for a null local
+ */
+ public void setLocal(String local)
+ {
+ if (local == null)
+ throw new IllegalArgumentException("Null local");
+ this.local = local;
+ }
+
+ public String getLocalHomeJndiName()
+ {
+ return localHomeJndiName;
+ }
+
+ public void setLocalHomeJndiName(String localHomeJndiName)
+ {
+ assert localHomeJndiName != null : "localHomeJndiName is null";
+
+ this.localHomeJndiName = localHomeJndiName;
+ }
+
+ /**
+ * Get the businessLocals.
+ *
+ * @return the businessLocals.
+ */
+ public BusinessLocalsMetaData getBusinessLocals()
+ {
+ return businessLocals;
+ }
+
+ /**
+ * Set the businessLocals.
+ *
+ * @param businessLocals the businessLocals.
+ * @throws IllegalArgumentException for a null businessLocasl
+ */
+ @XmlElement(name="business-local", required=false)
+ public void setBusinessLocals(BusinessLocalsMetaData businessLocals)
+ {
+ if (businessLocals == null)
+ throw new IllegalArgumentException("Null businessLocals");
+ this.businessLocals = businessLocals;
+ }
+
+ /**
+ * Get the businessRemotes.
+ *
+ * @return the businessRemotes.
+ */
+ public BusinessRemotesMetaData getBusinessRemotes()
+ {
+ return businessRemotes;
+ }
+
+ /**
+ * Set the businessRemotes.
+ *
+ * @param businessRemotes the businessRemotes.
+ * @throws IllegalArgumentException for a null businessRemotes
+ */
+ @XmlElement(name="business-remote", required=false)
+ public void setBusinessRemotes(BusinessRemotesMetaData businessRemotes)
+ {
+ if (businessRemotes == null)
+ throw new IllegalArgumentException("Null businessRemotes");
+ this.businessRemotes = businessRemotes;
+ }
+
+ /**
+ * Get the serviceEndpoint.
+ *
+ * @return the serviceEndpoint.
+ */
+ public String getServiceEndpoint()
+ {
+ return serviceEndpoint;
+ }
+
+ /**
+ * Set the serviceEndpoint.
+ *
+ * @param serviceEndpoint the serviceEndpoint.
+ * @throws IllegalArgumentException for a null serviceEndpoint
+ */
+ public void setServiceEndpoint(String serviceEndpoint)
+ {
+ if (serviceEndpoint == null)
+ throw new IllegalArgumentException("Null serviceEndpoint");
+ this.serviceEndpoint = serviceEndpoint;
+ }
+
+ /**
+ * Get the sessionType.
+ *
+ * @return the sessionType.
+ */
+ public SessionType getSessionType()
+ {
+ return sessionType;
+ }
+
+ /**
+ * Set the sessionType.
+ *
+ * @param sessionType the sessionType.
+ * @throws IllegalArgumentException for a null sessionType
+ */
+ public void setSessionType(SessionType sessionType)
+ {
+ if (sessionType == null)
+ throw new IllegalArgumentException("Null sessionType");
+ this.sessionType = sessionType;
+ }
+
+ /**
+ * Is this stateful
+ *
+ * @return true for stateful
+ */
+ public boolean isStateful()
+ {
+ if (sessionType == null)
+ return false;
+ return sessionType == SessionType.Stateful;
+ }
+
+ /**
+ * Is this stateless
+ *
+ * @return true for stateless
+ */
+ public boolean isStateless()
+ {
+ return isStateful() == false;
+ }
+
+ /**
+ * Get the timeoutMethod.
+ *
+ * @return the timeoutMethod.
+ */
+ public NamedMethodMetaData getTimeoutMethod()
+ {
+ return timeoutMethod;
+ }
+
+ /**
+ * Set the timeoutMethod.
+ *
+ * @param timeoutMethod the timeoutMethod.
+ * @throws IllegalArgumentException for a null timeoutMethod
+ */
+ @XmlElement(required=false)
+ public void setTimeoutMethod(NamedMethodMetaData timeoutMethod)
+ {
+ if (timeoutMethod == null)
+ throw new IllegalArgumentException("Null timeoutMethod");
+ this.timeoutMethod = timeoutMethod;
+ }
+
+ /**
+ * Get the initMethods.
+ *
+ * @return the initMethods.
+ */
+ public InitMethodsMetaData getInitMethods()
+ {
+ return initMethods;
+ }
+
+ /**
+ * Set the initMethods.
+ *
+ * @param initMethods the initMethods.
+ * @throws IllegalArgumentException for a null initMethods
+ */
+ @XmlElement(name="init-method", required=false)
+ public void setInitMethods(InitMethodsMetaData initMethods)
+ {
+ if (initMethods == null)
+ throw new IllegalArgumentException("Null initMethods");
+ this.initMethods = initMethods;
+ }
+
+ /**
+ * Get the removeMethods.
+ *
+ * @return the removeMethods.
+ */
+ public RemoveMethodsMetaData getRemoveMethods()
+ {
+ return removeMethods;
+ }
+
+ /**
+ * Set the removeMethods.
+ *
+ * @param removeMethods the removeMethods.
+ * @throws IllegalArgumentException for a null removeMethods
+ */
+ @XmlElement(name="remove-method", required=false)
+ public void setRemoveMethods(RemoveMethodsMetaData removeMethods)
+ {
+ if (removeMethods == null)
+ throw new IllegalArgumentException("Null removeMethods");
+ this.removeMethods = removeMethods;
+ }
+
+ /**
+ * Get the aroundInvokes.
+ *
+ * @return the aroundInvokes.
+ */
+ public AroundInvokesMetaData getAroundInvokes()
+ {
+ return aroundInvokes;
+ }
+
+ /**
+ * Set the aroundInvokes.
+ *
+ * @param aroundInvokes the aroundInvokes.
+ * @throws IllegalArgumentException for a null aroundInvokes
+ */
+ @XmlElement(name="around-invoke", required=false)
+ public void setAroundInvokes(AroundInvokesMetaData aroundInvokes)
+ {
+ if (aroundInvokes == null)
+ throw new IllegalArgumentException("Null aroundInvokes");
+ this.aroundInvokes = aroundInvokes;
+ }
+
+ /**
+ * Get the postActivates.
+ *
+ * @return the postActivates.
+ */
+ public LifecycleCallbacksMetaData getPostActivates()
+ {
+ return postActivates;
+ }
+
+ /**
+ * Set the postActivates.
+ *
+ * @param postActivates the postActivates.
+ * @throws IllegalArgumentException for a null postActivates
+ */
+ @XmlElement(name="post-activate", required=false)
+ public void setPostActivates(LifecycleCallbacksMetaData postActivates)
+ {
+ if (postActivates == null)
+ throw new IllegalArgumentException("Null postActivates");
+ this.postActivates = postActivates;
+ }
+
+ /**
+ * Get the prePassivates.
+ *
+ * @return the prePassivates.
+ */
+ public LifecycleCallbacksMetaData getPrePassivates()
+ {
+ return prePassivates;
+ }
+
+ /**
+ * Set the prePassivates.
+ *
+ * @param prePassivates the prePassivates.
+ * @throws IllegalArgumentException for a null prePassivates
+ */
+ @XmlElement(name="pre-passivate", required=false)
+ public void setPrePassivates(LifecycleCallbacksMetaData prePassivates)
+ {
+ if (prePassivates == null)
+ throw new IllegalArgumentException("Null prePassivates");
+ this.prePassivates = prePassivates;
+ }
+
+ /**
+ * Get the securityRoleRefs.
+ *
+ * @return the securityRoleRefs.
+ */
+ public SecurityRoleRefsMetaData getSecurityRoleRefs()
+ {
+ return securityRoleRefs;
+ }
+
+ /**
+ * Set the securityRoleRefs.
+ *
+ * @param securityRoleRefs the securityRoleRefs.
+ * @throws IllegalArgumentException for a null securityRoleRefs
+ */
+ @XmlElement(name="security-role-ref")
+ public void setSecurityRoleRefs(SecurityRoleRefsMetaData securityRoleRefs)
+ {
+ if (securityRoleRefs == null)
+ throw new IllegalArgumentException("Null securityRoleRefs");
+ this.securityRoleRefs = securityRoleRefs;
+ }
+
+ @Override
+ public String getDefaultConfigurationName()
+ {
+ boolean stateful = isStateful();
+ if (stateful)
+ {
+ if (isClustered())
+ return ContainerConfigurationMetaData.CLUSTERED_STATEFUL;
+ else
+ return ContainerConfigurationMetaData.STATEFUL;
+ }
+ else
+ {
+ if (isClustered())
+ return ContainerConfigurationMetaData.CLUSTERED_STATELESS;
+ else
+ return ContainerConfigurationMetaData.STATELESS;
+ }
+ }
+
+ @Override
+ public String getDefaultInvokerName()
+ {
+ boolean stateful = isStateful();
+ if (stateful)
+ {
+ if (isClustered())
+ return InvokerBindingMetaData.CLUSTERED_STATEFUL;
+ else
+ return InvokerBindingMetaData.STATEFUL;
+ }
+ else
+ {
+ if (isClustered())
+ return InvokerBindingMetaData.CLUSTERED_STATELESS;
+ else
+ return InvokerBindingMetaData.STATELESS;
+ }
+ }
+
+ /**
+ * Get the jndiName.
+ *
+ * @return the jndiName.
+ */
+ public String getJndiName()
+ {
+ return jndiName;
+ }
+
+ /**
+ * Set the jndiName.
+ *
+ * @param jndiName the jndiName.
+ * @throws IllegalArgumentException for a null jndiName
+ */
+ public void setJndiName(String jndiName)
+ {
+ if (jndiName == null)
+ throw new IllegalArgumentException("Null jndiName");
+ this.jndiName = jndiName;
+ }
+
+ /**
+ * Determine the jndi name
+ *
+ * @return the jndi name
+ */
+ public String determineJndiName()
+ {
+ String name = getHomeJndiName();
+ if (name == null)
+ name = jndiName;
+ if(name == null)
+ name = getMappedName();
+ if(name == null && getRemoteBindings() != null && getRemoteBindings().size() > 0)
+ name = getRemoteBindings().get(0).getJndiName();
+ // TODO: JBMETA-6, this should be the policy with ejb2 metadata defaulting to an ejb-name policy
+ if(name == null)
+ name = getEjbName();
+ return name;
+ }
+
+ @Override
+ public String getContainerObjectNameJndiName()
+ {
+ boolean remote = false;
+ if (getHome() != null)
+ remote = true;
+ return remote ? determineJndiName() : getLocalJndiName();
+ }
+
+ @Override
+ protected String getDefaultInvokerJndiName()
+ {
+ return determineJndiName();
+ }
+
+ /**
+ * Get the callByValue.
+ *
+ * @return the callByValue.
+ */
+ public boolean isCallByValue()
+ {
+ return callByValue;
+ }
+
+ /**
+ * Set the callByValue.
+ *
+ * @param callByValue the callByValue.
+ */
+ public void setCallByValue(boolean callByValue)
+ {
+ this.callByValue = callByValue;
+ }
+
+ /**
+ * Get the clustered.
+ *
+ * @return the clustered.
+ */
+ public boolean isClustered()
+ {
+ return clustered;
+ }
+
+ /**
+ * Set the clustered.
+ *
+ * @param clustered the clustered.
+ */
+ public void setClustered(boolean clustered)
+ {
+ this.clustered = clustered;
+ }
+
+ /**
+ * Get the concurrent.
+ *
+ * @return the concurrent.
+ */
+ public Boolean isConcurrent()
+ {
+ return concurrent;
+ }
+
+ /**
+ * Set the concurrent.
+ *
+ * @param concurrent the concurrent.
+ */
+ public void setConcurrent(Boolean concurrent)
+ {
+ this.concurrent = concurrent;
+ }
+
+ /**
+ * Get the ejbTimeoutIdentity.
+ *
+ * @return the ejbTimeoutIdentity.
+ */
+ public SecurityIdentityMetaData getEjbTimeoutIdentity()
+ {
+ return ejbTimeoutIdentity;
+ }
+
+ /**
+ * Set the ejbTimeoutIdentity.
+ *
+ * @param ejbTimeoutIdentity the ejbTimeoutIdentity.
+ * @throws IllegalArgumentException for a null ejbTimeoutIdentity
+ */
+ public void setEjbTimeoutIdentity(SecurityIdentityMetaData ejbTimeoutIdentity)
+ {
+ if (ejbTimeoutIdentity == null)
+ throw new IllegalArgumentException("Null ejbTimeoutIdentity");
+ this.ejbTimeoutIdentity = ejbTimeoutIdentity;
+ }
+
+ /**
+ * Get the clusterConfig.
+ *
+ * @return the clusterConfig.
+ */
+ public ClusterConfigMetaData getClusterConfig()
+ {
+ return clusterConfig;
+ }
+
+ /**
+ * Determine the clusterConfig.
+ *
+ * @return the clusterConfig.
+ */
+ public ClusterConfigMetaData determineClusterConfig()
+ {
+ if (determinedClusterConfig == null)
+ {
+ ClusterConfigMetaData containerDefaults = null;
+ ContainerConfigurationMetaData container = determineContainerConfiguration();
+ if (container != null)
+ containerDefaults = container.getClusterConfig();
+ determinedClusterConfig = new ClusterConfigMetaData();
+ determinedClusterConfig.merge(clusterConfig, containerDefaults);
+ }
+ return determinedClusterConfig;
+ }
+
+ /**
+ * Set the clusterConfig.
+ *
+ * @param clusterConfig the clusterConfig.
+ * @throws IllegalArgumentException for a null clusterConfig
+ */
+ public void setClusterConfig(ClusterConfigMetaData clusterConfig)
+ {
+ if (clusterConfig == null)
+ throw new IllegalArgumentException("Null clusterConfig");
+ this.clusterConfig = clusterConfig;
+ }
+
+
+ public PortComponent getPortComponent()
+ {
+ return portComponent;
+ }
+
+ public void setPortComponent(PortComponent portComponent)
+ {
+ this.portComponent = portComponent;
+ }
+
+ /**
+ * Get the remoteBinding.
+ *
+ * @return the remoteBinding.
+ */
+ public List<RemoteBindingMetaData> getRemoteBindings()
+ {
+ return remoteBindings;
+ }
+
+ /**
+ * Set the remoteBinding.
+ *
+ * @param remoteBinding the remoteBinding.
+ * @throws IllegalArgumentException for a null remoteBinding
+ */
+ @XmlElement(name="remote-binding", required=false)
+ public void setRemoteBindings(List<RemoteBindingMetaData> remoteBindings)
+ {
+ if (remoteBindings == null)
+ throw new IllegalArgumentException("Null remoteBinding");
+ this.remoteBindings = remoteBindings;
+ }
+
+ @Override
+ public void merge(JBossEnterpriseBeanMetaData override, EnterpriseBeanMetaData original, String overridenFile, String overrideFile, boolean mustOverride)
+ {
+ super.merge(override, original, overridenFile, overrideFile, mustOverride);
+ JBossSessionBeanMetaData joverride = (JBossSessionBeanMetaData) override;
+ SessionBeanMetaData soriginal = (SessionBeanMetaData) original;
+
+ // home
+ if(joverride != null && joverride.getHome() != null)
+ home = joverride.getHome();
+ else if(soriginal != null && soriginal.getHome() != null)
+ home = soriginal.getHome();
+ // remote
+ if(joverride != null && joverride.getRemote() != null)
+ remote = joverride.getRemote();
+ else if(soriginal != null && soriginal.getRemote() != null)
+ remote = soriginal.getRemote();
+ // localHome
+ if(joverride != null && joverride.getLocalHome() != null)
+ localHome = joverride.getLocalHome();
+ else if(soriginal != null && soriginal.getLocalHome() != null)
+ localHome = soriginal.getLocalHome();
+ // local
+ if(joverride != null && joverride.getLocal() != null)
+ local = joverride.getLocal();
+ else if(soriginal != null && soriginal.getLocal() != null)
+ local = soriginal.getLocal();
+ // businessLocals
+ if(joverride != null && joverride.getBusinessLocals() != null)
+ businessLocals = joverride.getBusinessLocals();
+ else if(soriginal != null && soriginal.getBusinessLocals() != null)
+ businessLocals = soriginal.getBusinessLocals();
+ // businessRemotes
+ if(joverride != null && joverride.getBusinessRemotes() != null)
+ businessRemotes = joverride.getBusinessRemotes();
+ else if(soriginal != null && soriginal.getBusinessRemotes() != null)
+ businessRemotes = soriginal.getBusinessRemotes();
+ // serviceEndpoint
+ if(joverride != null && joverride.getServiceEndpoint() != null)
+ serviceEndpoint = joverride.getServiceEndpoint();
+ else if(soriginal != null && soriginal.getServiceEndpoint() != null)
+ serviceEndpoint = soriginal.getServiceEndpoint();
+ // sessionType
+ if(joverride != null && joverride.getSessionType() != null)
+ sessionType = joverride.getSessionType();
+ else if(soriginal != null && soriginal.getSessionType() != null)
+ sessionType = soriginal.getSessionType();
+ // timeoutMethod
+ if(joverride != null && joverride.getTimeoutMethod() != null)
+ timeoutMethod = joverride.getTimeoutMethod();
+ else if(soriginal != null && soriginal.getTimeoutMethod() != null)
+ timeoutMethod = soriginal.getTimeoutMethod();
+ // initMethods
+ if(joverride != null && joverride.getInitMethods() != null)
+ initMethods = joverride.getInitMethods();
+ else if(soriginal != null && soriginal.getInitMethods() != null)
+ initMethods = soriginal.getInitMethods();
+ // removeMethods
+ if(joverride != null && joverride.getRemoveMethods() != null)
+ removeMethods = joverride.getRemoveMethods();
+ else if(soriginal != null && soriginal.getRemoveMethods() != null)
+ removeMethods = soriginal.getRemoveMethods();
+ // aroundInvokes
+ if(joverride != null && joverride.getAroundInvokes() != null)
+ aroundInvokes = joverride.getAroundInvokes();
+ else if(soriginal != null && soriginal.getAroundInvokes() != null)
+ aroundInvokes = soriginal.getAroundInvokes();
+ // postActivates
+ if(joverride != null && joverride.getPostActivates() != null)
+ postActivates = joverride.getPostActivates();
+ else if(soriginal != null && soriginal.getPostActivates() != null)
+ postActivates = soriginal.getPostActivates();
+ // prePassivates
+ if(joverride != null && joverride.getPrePassivates() != null)
+ prePassivates = joverride.getPrePassivates();
+ else if(soriginal != null && soriginal.getPrePassivates() != null)
+ prePassivates = soriginal.getPrePassivates();
+ // securityRoleRefs
+ if(joverride != null && joverride.getSecurityRoleRefs() != null)
+ securityRoleRefs = joverride.getSecurityRoleRefs();
+ else if(soriginal != null && soriginal.getSecurityRoleRefs() != null)
+ securityRoleRefs = soriginal.getSecurityRoleRefs();
+
+ if(joverride != null)
+ {
+ // jndiName
+ if(joverride.getJndiName() != null)
+ jndiName = joverride.getJndiName();
+ // homeJndiName
+ if(joverride.homeJndiName != null)
+ homeJndiName = joverride.homeJndiName;
+ // localHomeJndiName
+ if(joverride.localHomeJndiName != null)
+ localHomeJndiName = joverride.localHomeJndiName;
+ // callByValue
+ callByValue = joverride.isCallByValue();
+ // clustered
+ clustered = joverride.isClustered();
+ // remoteBindings
+ if(joverride.getRemoteBindings() != null)
+ remoteBindings = joverride.getRemoteBindings();
+ // clusterConfig
+ if(joverride.getClusterConfig() != null)
+ clusterConfig = joverride.getClusterConfig();
+ // portComponent
+ if(joverride.getPortComponent() != null)
+ portComponent = joverride.getPortComponent();
+ // ejbTimeoutIdentity
+ if(joverride.getEjbTimeoutIdentity() != null)
+ ejbTimeoutIdentity = joverride.getEjbTimeoutIdentity();
+ }
+ }
+
+ @Override
+ public void checkValid()
+ {
+ if(getEnterpriseBeansMetaData() != null && getEjbJarMetaData() != null)
+ {
+ // this is how the ejb3 deployer determines whether it's ejb3 module or not
+ if(!(getEjbJarMetaData().isEJB1x() || getEjbJarMetaData().isEJB2x()))
+ {
+ if(this.home == null && this.homeJndiName != null)
+ throw new IllegalStateException(
+ "EJB3 bean " + getEjbName() +
+ " doesn't define home interface but defines home-jndi-name '" +
+ this.homeJndiName + "' in jboss.xml");
+ if(this.localHome == null && this.localHomeJndiName != null)
+ throw new IllegalStateException(
+ "EJB3 bean " + getEjbName() +
+ " doesn't define local-home interface but defines local-home-jndi-name '" +
+ this.localHomeJndiName + "' in jboss.xml");
+ }
+ }
+ }
+}
Copied: projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/plugins/BasicJndiBindingPolicy.java (from rev 73126, projects/metadata/trunk/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/plugins/BasicJndiBindingPolicy.java)
===================================================================
--- projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/plugins/BasicJndiBindingPolicy.java (rev 0)
+++ projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/plugins/BasicJndiBindingPolicy.java 2008-05-08 00:46:24 UTC (rev 73129)
@@ -0,0 +1,106 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.metadata.ejb.jboss.jndipolicy.plugins;
+
+import org.jboss.metadata.ejb.jboss.jndipolicy.spi.DefaultJndiBindingPolicy;
+import org.jboss.metadata.ejb.jboss.jndipolicy.spi.EjbDeploymentSummary;
+import org.jboss.metadata.ejb.jboss.jndipolicy.spi.KnownInterfaces;
+
+/**
+ * A basic implementation of DefaultJndiBindingPolicy that uses a base jndi
+ * name and generates the following from that:
+ * getDefaultLocalHomeJndiName : baseJndiName + "/" + KnownInterfaces.LOCAL_HOME
+ * getDefaultLocalJndiName : baseJndiName + "/" + KnownInterfaces.LOCAL
+ * getDefaultRemoteHomeJndiName : baseJndiName + "/" + KnownInterfaces.HOME
+ * getDefaultRemoteJndiName : baseJndiName + "/" + KnownInterfaces.REMOTE
+ * getJndiName : baseJndiName
+ * getJndiName(String iface) : baseJndiName + "/" + iface (if iface is not in KnownInterfaces)
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public class BasicJndiBindingPolicy implements DefaultJndiBindingPolicy
+{
+ private String baseJndiName;
+
+ public BasicJndiBindingPolicy()
+ {
+
+ }
+ public BasicJndiBindingPolicy(String baseJndiName)
+ {
+ this.baseJndiName = baseJndiName;
+ }
+
+
+ public String getBaseJndiName()
+ {
+ return baseJndiName;
+ }
+ public void setBaseJndiName(String baseJndiName)
+ {
+ this.baseJndiName = baseJndiName;
+ }
+
+ public String getDefaultLocalHomeJndiName(EjbDeploymentSummary summary)
+ {
+ return baseJndiName + "/" + KnownInterfaces.LOCAL_HOME;
+ }
+
+ public String getDefaultLocalJndiName(EjbDeploymentSummary summary)
+ {
+ return baseJndiName + "/" + KnownInterfaces.LOCAL;
+ }
+
+ public String getDefaultRemoteHomeJndiName(EjbDeploymentSummary summary)
+ {
+ return baseJndiName + "/" + KnownInterfaces.HOME;
+ }
+
+ public String getDefaultRemoteJndiName(EjbDeploymentSummary summary)
+ {
+ return baseJndiName + "/" + KnownInterfaces.REMOTE;
+ }
+
+ public String getJndiName(EjbDeploymentSummary summary)
+ {
+ return baseJndiName;
+ }
+
+ public String getJndiName(EjbDeploymentSummary summary, String iface)
+ {
+ String jndiName = null;
+ if(iface == null)
+ jndiName = getJndiName(summary);
+ else if(KnownInterfaces.isKnownInterface(iface))
+ {
+ jndiName = baseJndiName + "/" + iface.toLowerCase();
+ }
+ else
+ {
+ jndiName = baseJndiName + "/" + iface;
+ }
+ return jndiName;
+ }
+
+
+}
Deleted: projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/plugins/EjbNameJndiBindingPolicy.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/plugins/EjbNameJndiBindingPolicy.java 2008-05-07 21:59:24 UTC (rev 73125)
+++ projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/plugins/EjbNameJndiBindingPolicy.java 2008-05-08 00:46:24 UTC (rev 73129)
@@ -1,77 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2007, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.metadata.ejb.jboss.jndipolicy.plugins;
-
-import org.jboss.metadata.ejb.jboss.jndipolicy.spi.DefaultJndiBindingPolicy;
-import org.jboss.metadata.ejb.jboss.jndipolicy.spi.EjbDeploymentSummary;
-
-/**
- * A default jndi policy based on the ejb name.
- *
- * @author Scott.Stark at jboss.org
- * @version $Revision:$
- */
-public class EjbNameJndiBindingPolicy
- implements DefaultJndiBindingPolicy
-{
-
- /* (non-Javadoc)
- * @see org.jboss.metadata.ejb.jboss.jndipolicy.spi.DefaultJndiBindingPolicy#getDefaultLocalHomeJndiName(org.jboss.metadata.ejb.jboss.jndipolicy.spi.EjbDeploymentSummary)
- */
- public String getDefaultLocalHomeJndiName(EjbDeploymentSummary summary)
- {
- return summary.getEjbName() + "LocalHome";
- }
-
- /* (non-Javadoc)
- * @see org.jboss.metadata.ejb.jboss.jndipolicy.spi.DefaultJndiBindingPolicy#getDefaultLocalJndiName(org.jboss.metadata.ejb.jboss.jndipolicy.spi.EjbDeploymentSummary)
- */
- public String getDefaultLocalJndiName(EjbDeploymentSummary summary)
- {
- return summary.getEjbName() + "Local";
- }
-
- /* (non-Javadoc)
- * @see org.jboss.metadata.ejb.jboss.jndipolicy.spi.DefaultJndiBindingPolicy#getDefaultRemoteHomeJndiName(org.jboss.metadata.ejb.jboss.jndipolicy.spi.EjbDeploymentSummary)
- */
- public String getDefaultRemoteHomeJndiName(EjbDeploymentSummary summary)
- {
- return summary.getEjbName() + "Home";
- }
-
- /* (non-Javadoc)
- * @see org.jboss.metadata.ejb.jboss.jndipolicy.spi.DefaultJndiBindingPolicy#getDefaultRemoteJndiName(org.jboss.metadata.ejb.jboss.jndipolicy.spi.EjbDeploymentSummary)
- */
- public String getDefaultRemoteJndiName(EjbDeploymentSummary summary)
- {
- return summary.getEjbName() + "Remote";
- }
-
- /* (non-Javadoc)
- * @see org.jboss.metadata.ejb.jboss.jndipolicy.spi.DefaultJndiBindingPolicy#getJndiName(org.jboss.metadata.ejb.jboss.jndipolicy.spi.EjbDeploymentSummary)
- */
- public String getJndiName(EjbDeploymentSummary summary)
- {
- return summary.getEjbName();
- }
-
-}
Copied: projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/plugins/EjbNameJndiBindingPolicy.java (from rev 73126, projects/metadata/trunk/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/plugins/EjbNameJndiBindingPolicy.java)
===================================================================
--- projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/plugins/EjbNameJndiBindingPolicy.java (rev 0)
+++ projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/plugins/EjbNameJndiBindingPolicy.java 2008-05-08 00:46:24 UTC (rev 73129)
@@ -0,0 +1,101 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.metadata.ejb.jboss.jndipolicy.plugins;
+
+import org.jboss.metadata.ejb.jboss.jndipolicy.spi.DefaultJndiBindingPolicy;
+import org.jboss.metadata.ejb.jboss.jndipolicy.spi.EjbDeploymentSummary;
+import org.jboss.metadata.ejb.jboss.jndipolicy.spi.KnownInterfaces;
+
+/**
+ * A default jndi policy based on the ejb name.
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public class EjbNameJndiBindingPolicy
+ implements DefaultJndiBindingPolicy
+{
+
+ /**
+ * @return ejb-name + "LocalHome";
+ */
+ public String getDefaultLocalHomeJndiName(EjbDeploymentSummary summary)
+ {
+ return summary.getEjbName() + "LocalHome";
+ }
+ /**
+ * @return ejb-name + "Local"
+ */
+ public String getDefaultLocalJndiName(EjbDeploymentSummary summary)
+ {
+ return summary.getEjbName() + "Local";
+ }
+ /**
+ * @return ejb-name + "Home"
+ */
+ public String getDefaultRemoteHomeJndiName(EjbDeploymentSummary summary)
+ {
+ return summary.getEjbName() + "Home";
+ }
+ /**
+ * @return ejb-name + "Remote"
+ */
+ public String getDefaultRemoteJndiName(EjbDeploymentSummary summary)
+ {
+ return summary.getEjbName() + "Remote";
+ }
+ /**
+ * @return ejb-name
+ */
+ public String getJndiName(EjbDeploymentSummary summary)
+ {
+ return summary.getEjbName();
+ }
+ /**
+ * @return ejb-name + "/" + iface
+ */
+ public String getJndiName(EjbDeploymentSummary summary, String iface)
+ {
+ String jndiName = null;
+ if(iface == null)
+ jndiName = getJndiName(summary);
+ else if(KnownInterfaces.isKnownInterface(iface))
+ {
+ if(KnownInterfaces.HOME.equalsIgnoreCase(iface))
+ jndiName = getDefaultRemoteHomeJndiName(summary);
+ else if(KnownInterfaces.LOCAL.equalsIgnoreCase(iface))
+ jndiName = getDefaultLocalJndiName(summary);
+ else if(KnownInterfaces.LOCAL_HOME.equalsIgnoreCase(iface))
+ jndiName = getDefaultLocalHomeJndiName(summary);
+ else if(KnownInterfaces.REMOTE.equalsIgnoreCase(iface))
+ jndiName = getDefaultRemoteJndiName(summary);
+ else
+ throw new IllegalStateException("Unknown iterface type: "+iface);
+ }
+ else
+ {
+ jndiName = summary.getEjbName() + "/" + iface;
+ }
+ return jndiName;
+ }
+
+}
Deleted: projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/plugins/SessionJndiBindingPolicy.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/plugins/SessionJndiBindingPolicy.java 2008-05-07 21:59:24 UTC (rev 73125)
+++ projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/plugins/SessionJndiBindingPolicy.java 2008-05-08 00:46:24 UTC (rev 73129)
@@ -1,135 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.metadata.ejb.jboss.jndipolicy.plugins;
-
-import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData;
-import org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData;
-import org.jboss.metadata.ejb.jboss.jndipolicy.spi.DefaultJndiBindingPolicy;
-import org.jboss.metadata.ejb.jboss.jndipolicy.spi.EjbDeploymentSummary;
-
-/**
- * Default session bean jndi naming policy
- *
- * @author Scott.Stark at jboss.org
- * @version $Revision:$
- */
-public class SessionJndiBindingPolicy
- implements DefaultJndiBindingPolicy
-{
-
- public String getDefaultLocalHomeJndiName(EjbDeploymentSummary summary)
- {
- JBossEnterpriseBeanMetaData beanMD = summary.getBeanMD();
- String name = null;
- if(beanMD instanceof JBossSessionBeanMetaData)
- {
- JBossSessionBeanMetaData sbeanMD = (JBossSessionBeanMetaData) beanMD;
- name = sbeanMD.getLocalHomeJndiName();
- }
- if(name == null)
- {
- name = beanMD.determineLocalJndiName();
- }
- return name;
- }
-
- public String getDefaultLocalJndiName(EjbDeploymentSummary summary)
- {
- JBossEnterpriseBeanMetaData beanMD = summary.getBeanMD();
- String name = null;
- if(beanMD instanceof JBossSessionBeanMetaData)
- {
- JBossSessionBeanMetaData sbeanMD = (JBossSessionBeanMetaData) beanMD;
- name = sbeanMD.getLocalJndiName();
- }
- if(name == null)
- {
- name = beanMD.determineLocalJndiName();
- }
- return name;
- }
-
- public String getDefaultRemoteHomeJndiName(EjbDeploymentSummary summary)
- {
- JBossEnterpriseBeanMetaData beanMD = summary.getBeanMD();
- String name = null;
- if(beanMD instanceof JBossSessionBeanMetaData)
- {
- JBossSessionBeanMetaData sbeanMD = (JBossSessionBeanMetaData) beanMD;
- name = sbeanMD.getHomeJndiName();
- if (name == null)
- name = sbeanMD.getJndiName();
- if(name == null)
- name = sbeanMD.getMappedName();
- if(name == null && sbeanMD.getRemoteBindings() != null && sbeanMD.getRemoteBindings().size() > 0)
- name = sbeanMD.getRemoteBindings().get(0).getJndiName();
- }
- if(name == null)
- {
- name = beanMD.getEjbName() + "Remote";
- }
- return name;
- }
-
- public String getDefaultRemoteJndiName(EjbDeploymentSummary summary)
- {
- JBossEnterpriseBeanMetaData beanMD = summary.getBeanMD();
- String name = null;
- if(beanMD instanceof JBossSessionBeanMetaData)
- {
- JBossSessionBeanMetaData sbeanMD = (JBossSessionBeanMetaData) beanMD;
- name = sbeanMD.getJndiName();
- if(name == null)
- name = sbeanMD.getMappedName();
- if(name == null && sbeanMD.getRemoteBindings() != null && sbeanMD.getRemoteBindings().size() > 0)
- name = sbeanMD.getRemoteBindings().get(0).getJndiName();
- }
- if(name == null)
- {
- name = beanMD.getEjbName() + "Remote";
- }
- return name;
- }
-
- public String getJndiName(EjbDeploymentSummary summary)
- {
- JBossEnterpriseBeanMetaData beanMD = summary.getBeanMD();
- String name = null;
- if(beanMD instanceof JBossSessionBeanMetaData)
- {
- JBossSessionBeanMetaData sbeanMD = (JBossSessionBeanMetaData) beanMD;
- name = sbeanMD.getHomeJndiName();
- if (name == null)
- name = sbeanMD.getJndiName();
- if(name == null)
- name = sbeanMD.getMappedName();
- if(name == null && sbeanMD.getRemoteBindings() != null && sbeanMD.getRemoteBindings().size() > 0)
- name = sbeanMD.getRemoteBindings().get(0).getJndiName();
- }
- if(name == null)
- {
- name = beanMD.getEjbName();
- }
- return name;
- }
-
-}
Copied: projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/plugins/SessionJndiBindingPolicy.java (from rev 73126, projects/metadata/trunk/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/plugins/SessionJndiBindingPolicy.java)
===================================================================
--- projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/plugins/SessionJndiBindingPolicy.java (rev 0)
+++ projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/plugins/SessionJndiBindingPolicy.java 2008-05-08 00:46:24 UTC (rev 73129)
@@ -0,0 +1,142 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.metadata.ejb.jboss.jndipolicy.plugins;
+
+import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData;
+import org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData;
+import org.jboss.metadata.ejb.jboss.jndipolicy.spi.DefaultJndiBindingPolicy;
+import org.jboss.metadata.ejb.jboss.jndipolicy.spi.EjbDeploymentSummary;
+
+/**
+ * Default session bean jndi naming policy
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public class SessionJndiBindingPolicy
+ implements DefaultJndiBindingPolicy
+{
+
+ public String getDefaultLocalHomeJndiName(EjbDeploymentSummary summary)
+ {
+ JBossEnterpriseBeanMetaData beanMD = summary.getBeanMD();
+ String name = null;
+ if(beanMD instanceof JBossSessionBeanMetaData)
+ {
+ JBossSessionBeanMetaData sbeanMD = (JBossSessionBeanMetaData) beanMD;
+ name = sbeanMD.getLocalHomeJndiName();
+ }
+ if(name == null)
+ {
+ name = beanMD.determineLocalJndiName();
+ }
+ return name;
+ }
+
+ public String getDefaultLocalJndiName(EjbDeploymentSummary summary)
+ {
+ JBossEnterpriseBeanMetaData beanMD = summary.getBeanMD();
+ String name = null;
+ if(beanMD instanceof JBossSessionBeanMetaData)
+ {
+ JBossSessionBeanMetaData sbeanMD = (JBossSessionBeanMetaData) beanMD;
+ name = sbeanMD.getLocalJndiName();
+ }
+ if(name == null)
+ {
+ name = beanMD.determineLocalJndiName();
+ }
+ return name;
+ }
+
+ public String getDefaultRemoteHomeJndiName(EjbDeploymentSummary summary)
+ {
+ JBossEnterpriseBeanMetaData beanMD = summary.getBeanMD();
+ String name = null;
+ if(beanMD instanceof JBossSessionBeanMetaData)
+ {
+ JBossSessionBeanMetaData sbeanMD = (JBossSessionBeanMetaData) beanMD;
+ name = sbeanMD.getHomeJndiName();
+ if (name == null)
+ name = sbeanMD.getJndiName();
+ if(name == null)
+ name = sbeanMD.getMappedName();
+ if(name == null && sbeanMD.getRemoteBindings() != null && sbeanMD.getRemoteBindings().size() > 0)
+ name = sbeanMD.getRemoteBindings().get(0).getJndiName();
+ }
+ if(name == null)
+ {
+ name = beanMD.getEjbName() + "Remote";
+ }
+ return name;
+ }
+
+ public String getDefaultRemoteJndiName(EjbDeploymentSummary summary)
+ {
+ JBossEnterpriseBeanMetaData beanMD = summary.getBeanMD();
+ String name = null;
+ if(beanMD instanceof JBossSessionBeanMetaData)
+ {
+ JBossSessionBeanMetaData sbeanMD = (JBossSessionBeanMetaData) beanMD;
+ name = sbeanMD.getJndiName();
+ if(name == null)
+ name = sbeanMD.getMappedName();
+ if(name == null && sbeanMD.getRemoteBindings() != null && sbeanMD.getRemoteBindings().size() > 0)
+ name = sbeanMD.getRemoteBindings().get(0).getJndiName();
+ }
+ if(name == null)
+ {
+ name = beanMD.getEjbName() + "Remote";
+ }
+ return name;
+ }
+
+ public String getJndiName(EjbDeploymentSummary summary)
+ {
+ JBossEnterpriseBeanMetaData beanMD = summary.getBeanMD();
+ String name = null;
+ if(beanMD instanceof JBossSessionBeanMetaData)
+ {
+ JBossSessionBeanMetaData sbeanMD = (JBossSessionBeanMetaData) beanMD;
+ name = sbeanMD.getHomeJndiName();
+ if (name == null)
+ name = sbeanMD.getJndiName();
+ if(name == null)
+ name = sbeanMD.getMappedName();
+ if(name == null && sbeanMD.getRemoteBindings() != null && sbeanMD.getRemoteBindings().size() > 0)
+ name = sbeanMD.getRemoteBindings().get(0).getJndiName();
+ }
+ if(name == null)
+ {
+ name = beanMD.getEjbName();
+ }
+ return name;
+ }
+ /**
+ * @return ejb-name + "/" + iface
+ */
+ public String getJndiName(EjbDeploymentSummary summary, String iface)
+ {
+ return summary.getEjbName() + "/" + iface;
+ }
+
+}
Deleted: projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/spi/DefaultJndiBindingPolicy.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/spi/DefaultJndiBindingPolicy.java 2008-05-07 21:59:24 UTC (rev 73125)
+++ projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/spi/DefaultJndiBindingPolicy.java 2008-05-08 00:46:24 UTC (rev 73129)
@@ -1,49 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2007, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.metadata.ejb.jboss.jndipolicy.spi;
-
-/**
- * A jndi name policy spi for obtaining jndi names not specified in metadata.
- *
- * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
- * @author Scott.Stark at jboss.org
- * @version $Revision:$
- */
-public interface DefaultJndiBindingPolicy
-{
- /**
- * Returns the JNDI name that should be assigned to this deployment
- * based on the information contained in the specified summary
- *
- * @param summary
- * @return
- */
- String getJndiName(EjbDeploymentSummary summary);
-
- String getDefaultRemoteJndiName(EjbDeploymentSummary summary);
-
- String getDefaultRemoteHomeJndiName(EjbDeploymentSummary summary);
-
- String getDefaultLocalHomeJndiName(EjbDeploymentSummary summary);
-
- String getDefaultLocalJndiName(EjbDeploymentSummary summary);
-}
Copied: projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/spi/DefaultJndiBindingPolicy.java (from rev 73126, projects/metadata/trunk/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/spi/DefaultJndiBindingPolicy.java)
===================================================================
--- projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/spi/DefaultJndiBindingPolicy.java (rev 0)
+++ projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/spi/DefaultJndiBindingPolicy.java 2008-05-08 00:46:24 UTC (rev 73129)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.metadata.ejb.jboss.jndipolicy.spi;
+
+/**
+ * A jndi name policy spi for obtaining jndi names not specified in metadata.
+ *
+ * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public interface DefaultJndiBindingPolicy
+{
+ /**
+ * Returns the JNDI name that should be assigned to this deployment
+ * based on the information contained in the specified summary
+ *
+ * @param summary
+ * @return
+ */
+ String getJndiName(EjbDeploymentSummary summary);
+ /**
+ *
+ * @param summary
+ * @param iface
+ * @return
+ */
+ String getJndiName(EjbDeploymentSummary summary, String iface);
+
+ String getDefaultRemoteJndiName(EjbDeploymentSummary summary);
+
+ String getDefaultRemoteHomeJndiName(EjbDeploymentSummary summary);
+
+ String getDefaultLocalHomeJndiName(EjbDeploymentSummary summary);
+
+ String getDefaultLocalJndiName(EjbDeploymentSummary summary);
+
+}
Copied: projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/spi/DeploymentSummary.java (from rev 73126, projects/metadata/trunk/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/spi/DeploymentSummary.java)
===================================================================
--- projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/spi/DeploymentSummary.java (rev 0)
+++ projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/spi/DeploymentSummary.java 2008-05-08 00:46:24 UTC (rev 73129)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.metadata.ejb.jboss.jndipolicy.spi;
+
+/**
+ * A base class for deployment scope information.
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public class DeploymentSummary
+{
+ private String deploymentName;
+
+ private String deploymentScopeBaseName;
+
+ private ClassLoader loader;
+
+ public DeploymentSummary()
+ {
+ }
+ public DeploymentSummary(DeploymentSummary summary)
+ {
+ setDeploymentName(summary.getDeploymentName());
+ setDeploymentScopeBaseName(summary.getDeploymentScopeBaseName());
+ setLoader(summary.getLoader());
+ }
+
+ public String getDeploymentName()
+ {
+ return deploymentName;
+ }
+ public void setDeploymentName(String deploymentName)
+ {
+ this.deploymentName = deploymentName;
+ }
+
+ public String getDeploymentScopeBaseName()
+ {
+ return deploymentScopeBaseName;
+ }
+ public void setDeploymentScopeBaseName(String deploymentScopeBaseName)
+ {
+ this.deploymentScopeBaseName = deploymentScopeBaseName;
+ }
+
+ public ClassLoader getLoader()
+ {
+ return loader;
+ }
+ public void setLoader(ClassLoader loader)
+ {
+ this.loader = loader;
+ }
+}
Deleted: projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/spi/EjbDeploymentSummary.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/spi/EjbDeploymentSummary.java 2008-05-07 21:59:24 UTC (rev 73125)
+++ projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/spi/EjbDeploymentSummary.java 2008-05-08 00:46:24 UTC (rev 73129)
@@ -1,159 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2007, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.metadata.ejb.jboss.jndipolicy.spi;
-
-import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData;
-
-/**
- * Summary of an EJB deployment in flat properties; used in
- * determining default JNDI Bindings by a JNDI Binding Policy
- *
- * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
- * @author Scott.Stark at Jboss.org
- * @version $Revision: $
- */
-public class EjbDeploymentSummary
-{
- // Instance Members
-
- private String deploymentName;
-
- private String deploymentScopeBaseName;
-
- private String ejbName;
-
- private String beanClassName;
-
- private boolean isLocal;
-
- private boolean isStateful;
-
- private boolean isHome;
-
- private boolean isService;
- private JBossEnterpriseBeanMetaData beanMD;
-
- private ClassLoader loader;
-
- // Accessors / Mutators
-
- public String getDeploymentName()
- {
- return deploymentName;
- }
-
- public void setDeploymentName(String deploymentName)
- {
- this.deploymentName = deploymentName;
- }
-
- public String getEjbName()
- {
- return ejbName;
- }
-
- public void setEjbName(String ejbName)
- {
- this.ejbName = ejbName;
- }
-
- public boolean isLocal()
- {
- return isLocal;
- }
-
- public void setLocal(boolean isLocal)
- {
- this.isLocal = isLocal;
- }
-
- public boolean isStateful()
- {
- return isStateful;
- }
-
- public void setStateful(boolean isStateful)
- {
- this.isStateful = isStateful;
- }
-
- public boolean isHome()
- {
- return isHome;
- }
-
- public void setHome(boolean isHome)
- {
- this.isHome = isHome;
- }
-
- public boolean isService()
- {
- return isService;
- }
-
- public void setService(boolean isService)
- {
- this.isService = isService;
- }
-
- public String getDeploymentScopeBaseName()
- {
- return deploymentScopeBaseName;
- }
-
- public void setDeploymentScopeBaseName(String deploymentScopeBaseName)
- {
- this.deploymentScopeBaseName = deploymentScopeBaseName;
- }
-
- public String getBeanClassName()
- {
- return beanClassName;
- }
-
- public void setBeanClassName(String beanClassName)
- {
- this.beanClassName = beanClassName;
- }
-
-
- public JBossEnterpriseBeanMetaData getBeanMD()
- {
- return beanMD;
- }
- public void setBeanMD(JBossEnterpriseBeanMetaData beanMD)
- {
- this.beanMD = beanMD;
- }
-
- public ClassLoader getLoader()
- {
- return loader;
- }
-
- public void setLoader(ClassLoader loader)
- {
- this.loader = loader;
- }
-
-}
Copied: projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/spi/EjbDeploymentSummary.java (from rev 73126, projects/metadata/trunk/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/spi/EjbDeploymentSummary.java)
===================================================================
--- projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/spi/EjbDeploymentSummary.java (rev 0)
+++ projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/spi/EjbDeploymentSummary.java 2008-05-08 00:46:24 UTC (rev 73129)
@@ -0,0 +1,149 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.metadata.ejb.jboss.jndipolicy.spi;
+
+import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData;
+import org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData;
+
+/**
+ * Summary of an EJB deployment in flat properties; used in
+ * determining default JNDI Bindings by a JNDI Binding Policy
+ *
+ * @author <a href="mailto:andrew.rubinger at redhat.com">ALR</a>
+ * @author Scott.Stark at Jboss.org
+ * @version $Revision: $
+ */
+public class EjbDeploymentSummary extends DeploymentSummary
+{
+ // Instance Members
+
+ private String ejbName;
+
+ private String beanClassName;
+
+ private boolean isLocal;
+
+ private boolean isStateful;
+
+ private boolean isHome;
+
+ private boolean isService;
+ private JBossEnterpriseBeanMetaData beanMD;
+
+ public EjbDeploymentSummary()
+ {
+
+ }
+ public EjbDeploymentSummary(JBossEnterpriseBeanMetaData beanMD, DeploymentSummary dsummary)
+ {
+ super(dsummary);
+ //
+ this.setBeanClassName(beanMD.getEjbClass());
+ this.setEjbName(beanMD.getEjbName());
+ this.setService(beanMD.isService());
+
+ if(beanMD instanceof JBossSessionBeanMetaData)
+ {
+ JBossSessionBeanMetaData sbeanMD = (JBossSessionBeanMetaData) beanMD;
+ this.setStateful(sbeanMD.isStateful());
+ if(sbeanMD.getHome() != null && sbeanMD.getHome().length() > 0)
+ this.setHome(true);
+ if(sbeanMD.getLocal() != null && sbeanMD.getLocal().length() > 0)
+ this.setLocal(true);
+ // Is a local-home also a home?
+ }
+ }
+
+ // Accessors / Mutators
+
+ public String getEjbName()
+ {
+ return ejbName;
+ }
+
+ public void setEjbName(String ejbName)
+ {
+ this.ejbName = ejbName;
+ }
+
+ public boolean isLocal()
+ {
+ return isLocal;
+ }
+
+ public void setLocal(boolean isLocal)
+ {
+ this.isLocal = isLocal;
+ }
+
+ public boolean isStateful()
+ {
+ return isStateful;
+ }
+
+ public void setStateful(boolean isStateful)
+ {
+ this.isStateful = isStateful;
+ }
+
+ public boolean isHome()
+ {
+ return isHome;
+ }
+
+ public void setHome(boolean isHome)
+ {
+ this.isHome = isHome;
+ }
+
+ public boolean isService()
+ {
+ return isService;
+ }
+
+ public void setService(boolean isService)
+ {
+ this.isService = isService;
+ }
+
+
+ public String getBeanClassName()
+ {
+ return beanClassName;
+ }
+
+ public void setBeanClassName(String beanClassName)
+ {
+ this.beanClassName = beanClassName;
+ }
+
+
+ public JBossEnterpriseBeanMetaData getBeanMD()
+ {
+ return beanMD;
+ }
+ public void setBeanMD(JBossEnterpriseBeanMetaData beanMD)
+ {
+ this.beanMD = beanMD;
+ }
+
+}
Copied: projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/spi/KnownInterfaces.java (from rev 73126, projects/metadata/trunk/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/spi/KnownInterfaces.java)
===================================================================
--- projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/spi/KnownInterfaces.java (rev 0)
+++ projects/metadata/tags/1.0.0.Beta12/src/main/java/org/jboss/metadata/ejb/jboss/jndipolicy/spi/KnownInterfaces.java 2008-05-08 00:46:24 UTC (rev 73129)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.metadata.ejb.jboss.jndipolicy.spi;
+
+/**
+ * Constants for known interfaces that may be passed to
+ * {@link DefaultJndiBindingPolicy#getJndiName(EjbDeploymentSummary, String)}
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public final class KnownInterfaces
+{
+ public static final String LOCAL = "local";
+ public static final String LOCAL_HOME = "local-home";
+ public static final String REMOTE = "remote";
+ public static final String HOME = "home";
+
+ /**
+ * Is iface one of the KnownInterfaces
+ * @param iface - the interface name to compare in a case insensitive manner.
+ * @return true if iface is one of the KnownInterfaces constants, false otherwise.
+ */
+ public static boolean isKnownInterface(String iface)
+ {
+ boolean isKnownInterface = KnownInterfaces.HOME.equalsIgnoreCase(iface)
+ || KnownInterfaces.LOCAL.equalsIgnoreCase(iface)
+ || KnownInterfaces.LOCAL_HOME.equalsIgnoreCase(iface)
+ || KnownInterfaces.REMOTE.equalsIgnoreCase(iface)
+ ;
+ return isKnownInterface;
+ }
+}
Deleted: projects/metadata/tags/1.0.0.Beta12/src/test/java/org/jboss/test/metadata/ejb/EJBMetaDataTestSuite.java
===================================================================
--- projects/metadata/trunk/src/test/java/org/jboss/test/metadata/ejb/EJBMetaDataTestSuite.java 2008-05-07 21:59:24 UTC (rev 73125)
+++ projects/metadata/tags/1.0.0.Beta12/src/test/java/org/jboss/test/metadata/ejb/EJBMetaDataTestSuite.java 2008-05-08 00:46:24 UTC (rev 73129)
@@ -1,61 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.test.metadata.ejb;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import junit.textui.TestRunner;
-
-/**
- * EJB Metadata Test Suite.
- *
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @version $Revision: 1.8 $
- */
-public class EJBMetaDataTestSuite extends TestSuite
-{
- public static void main(String[] args)
- {
- TestRunner.run(suite());
- }
-
- public static Test suite()
- {
- TestSuite suite = new TestSuite("EJB Metadata Tests");
-
- suite.addTest(EjbJar3xUnitTestCase.suite());
- suite.addTest(EjbJar21UnitTestCase.suite());
- suite.addTest(EjbJar20UnitTestCase.suite());
- suite.addTest(EjbJar3xEverythingUnitTestCase.suite());
- suite.addTest(EjbJar21EverythingUnitTestCase.suite());
- suite.addTest(JBoss50UnitTestCase.suite());
- suite.addTest(JBoss5xEverythingUnitTestCase.suite());
- suite.addTest(EjbJarJBossMergeEverythingUnitTestCase.suite());
- suite.addTest(JBoss42UnitTestCase.suite());
- suite.addTest(EjbJarJBossMergeActivationConfigUnitTestCase.suite());
-
- //suite.addTest(JBossCMPUnitTestCase.suite());
- //suite.addTest(JBossCMPMergeUnitTestCase.suite());
-
- return suite;
- }
-}
Copied: projects/metadata/tags/1.0.0.Beta12/src/test/java/org/jboss/test/metadata/ejb/EJBMetaDataTestSuite.java (from rev 73126, projects/metadata/trunk/src/test/java/org/jboss/test/metadata/ejb/EJBMetaDataTestSuite.java)
===================================================================
--- projects/metadata/tags/1.0.0.Beta12/src/test/java/org/jboss/test/metadata/ejb/EJBMetaDataTestSuite.java (rev 0)
+++ projects/metadata/tags/1.0.0.Beta12/src/test/java/org/jboss/test/metadata/ejb/EJBMetaDataTestSuite.java 2008-05-08 00:46:24 UTC (rev 73129)
@@ -0,0 +1,62 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.metadata.ejb;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+/**
+ * EJB Metadata Test Suite.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.8 $
+ */
+public class EJBMetaDataTestSuite extends TestSuite
+{
+ public static void main(String[] args)
+ {
+ TestRunner.run(suite());
+ }
+
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("EJB Metadata Tests");
+
+ suite.addTest(EjbJar3xUnitTestCase.suite());
+ suite.addTest(EjbJar21UnitTestCase.suite());
+ suite.addTest(EjbJar20UnitTestCase.suite());
+ suite.addTest(EjbJar3xEverythingUnitTestCase.suite());
+ suite.addTest(EjbJar21EverythingUnitTestCase.suite());
+ suite.addTest(JBoss50UnitTestCase.suite());
+ suite.addTest(JBoss5xEverythingUnitTestCase.suite());
+ suite.addTest(EjbJarJBossMergeEverythingUnitTestCase.suite());
+ suite.addTest(JBoss42UnitTestCase.suite());
+ suite.addTest(EjbJarJBossMergeActivationConfigUnitTestCase.suite());
+ suite.addTestSuite(ResolvedJndiNameUnitTestCase.class);
+
+ //suite.addTest(JBossCMPUnitTestCase.suite());
+ //suite.addTest(JBossCMPMergeUnitTestCase.suite());
+
+ return suite;
+ }
+}
Copied: projects/metadata/tags/1.0.0.Beta12/src/test/java/org/jboss/test/metadata/ejb/ResolvedJndiNameUnitTestCase.java (from rev 73126, projects/metadata/trunk/src/test/java/org/jboss/test/metadata/ejb/ResolvedJndiNameUnitTestCase.java)
===================================================================
--- projects/metadata/tags/1.0.0.Beta12/src/test/java/org/jboss/test/metadata/ejb/ResolvedJndiNameUnitTestCase.java (rev 0)
+++ projects/metadata/tags/1.0.0.Beta12/src/test/java/org/jboss/test/metadata/ejb/ResolvedJndiNameUnitTestCase.java 2008-05-08 00:46:24 UTC (rev 73129)
@@ -0,0 +1,142 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.metadata.ejb;
+
+import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData;
+import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeansMetaData;
+import org.jboss.metadata.ejb.jboss.JBossMetaData;
+import org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData;
+import org.jboss.metadata.ejb.jboss.jndipolicy.plugins.EjbNameJndiBindingPolicy;
+import org.jboss.metadata.ejb.jboss.jndipolicy.spi.DeploymentSummary;
+
+import junit.framework.TestCase;
+
+/**
+ * Tests of the JBossEnterpriseBeanMetaData.determineResolvedJndiName behavior
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public class ResolvedJndiNameUnitTestCase
+ extends TestCase
+{
+
+ public void testResolvedJndiName()
+ {
+ JBossEnterpriseBeanMetaData beanMD = getEjbMetaData();
+ String resolvedJndiName = beanMD.determineResolvedJndiName(null, null);
+ assertEquals("testResolvedJndiName-jndi-name", resolvedJndiName);
+ }
+ public void testResolvedJndiNameWithMappedName()
+ {
+ JBossEnterpriseBeanMetaData beanMD = getEjbMetaData();
+ beanMD.setMappedName("testResolvedJndiName-mapped-name");
+ String resolvedJndiName = beanMD.determineResolvedJndiName(null, null);
+ assertEquals("testResolvedJndiName-mapped-name", resolvedJndiName);
+ }
+ public void testResolvedJndiNames()
+ {
+ JBossEnterpriseBeanMetaData beanMD = getEjbMetaData();
+ String resolvedJndiName = beanMD.determineResolvedJndiName(null, null);
+ assertEquals("testResolvedJndiNames-jndi-name", resolvedJndiName);
+ String resolvedJndiNameRemote = beanMD.determineResolvedJndiName("remote", null);
+ assertEquals("testResolvedJndiNames-jndi-name/remote", resolvedJndiNameRemote);
+ String resolvedJndiNameHome = beanMD.determineResolvedJndiName("Home", null);
+ assertEquals("testResolvedJndiNames-jndi-name/home", resolvedJndiNameHome);
+ String resolvedJndiNameLocal = beanMD.determineResolvedJndiName("local", null);
+ assertEquals("testResolvedJndiNames-jndi-name/local", resolvedJndiNameLocal);
+ String resolvedJndiNameLocalHome = beanMD.determineResolvedJndiName("local-home", null);
+ assertEquals("testResolvedJndiNames-jndi-name/local-home", resolvedJndiNameLocalHome);
+ String resolvedJndiNameIface = beanMD.determineResolvedJndiName("org.jboss.test.some.IFace", null);
+ assertEquals("testResolvedJndiNames-jndi-name/org.jboss.test.some.IFace", resolvedJndiNameIface);
+ }
+ /**
+ * Test the determineResolvedJndiName with a jndiBindingPolicy on the
+ * JBossEnterpriseBeanMetaData
+ *
+ */
+ public void testResolvedJndiNamesWithMDPolicy()
+ {
+ JBossEnterpriseBeanMetaData beanMD = getEjbMetaData();
+ beanMD.setJndiBindingPolicy(EjbNameJndiBindingPolicy.class.getName());
+ String resolvedJndiName = beanMD.determineResolvedJndiName(null, null);
+ assertEquals("testResolvedJndiNamesWithMDPolicy-ejb", resolvedJndiName);
+ String resolvedJndiNameRemote = beanMD.determineResolvedJndiName("remote", null);
+ assertEquals("testResolvedJndiNamesWithMDPolicy-ejbRemote", resolvedJndiNameRemote);
+ String resolvedJndiNameHome = beanMD.determineResolvedJndiName("Home", null);
+ assertEquals("testResolvedJndiNamesWithMDPolicy-ejbHome", resolvedJndiNameHome);
+ String resolvedJndiNameLocal = beanMD.determineResolvedJndiName("local", null);
+ assertEquals("testResolvedJndiNamesWithMDPolicy-ejbLocal", resolvedJndiNameLocal);
+ String resolvedJndiNameLocalHome = beanMD.determineResolvedJndiName("local-home", null);
+ assertEquals("testResolvedJndiNamesWithMDPolicy-ejbLocalHome", resolvedJndiNameLocalHome);
+ String resolvedJndiNameIface = beanMD.determineResolvedJndiName("org.jboss.test.some.IFace", null);
+ assertEquals("testResolvedJndiNamesWithMDPolicy-ejb/org.jboss.test.some.IFace", resolvedJndiNameIface);
+ }
+ /**
+ * Test the determineResolvedJndiName with a jndiBindingPolicy passed into
+ * determineResolvedJndiName
+ *
+ */
+ public void testResolvedJndiNamesWithExternalPolicy()
+ {
+ JBossEnterpriseBeanMetaData beanMD = getEjbMetaData();
+ EjbNameJndiBindingPolicy policy = new EjbNameJndiBindingPolicy();
+ String resolvedJndiName = beanMD.determineResolvedJndiName(null, policy);
+ assertEquals("testResolvedJndiNamesWithExternalPolicy-ejb", resolvedJndiName);
+ String resolvedJndiNameRemote = beanMD.determineResolvedJndiName("remote", policy);
+ assertEquals("testResolvedJndiNamesWithExternalPolicy-ejbRemote", resolvedJndiNameRemote);
+ String resolvedJndiNameHome = beanMD.determineResolvedJndiName("Home", policy);
+ assertEquals("testResolvedJndiNamesWithExternalPolicy-ejbHome", resolvedJndiNameHome);
+ String resolvedJndiNameLocal = beanMD.determineResolvedJndiName("local", policy);
+ assertEquals("testResolvedJndiNamesWithExternalPolicy-ejbLocal", resolvedJndiNameLocal);
+ String resolvedJndiNameLocalHome = beanMD.determineResolvedJndiName("local-home", policy);
+ assertEquals("testResolvedJndiNamesWithExternalPolicy-ejbLocalHome", resolvedJndiNameLocalHome);
+ String resolvedJndiNameIface = beanMD.determineResolvedJndiName("org.jboss.test.some.IFace", policy);
+ assertEquals("testResolvedJndiNamesWithExternalPolicy-ejb/org.jboss.test.some.IFace", resolvedJndiNameIface);
+ }
+
+ /**
+ * Creates a JBossSessionBeanMetaData with associated JBossMetaData with:
+ * ejbName = getName() + "-ejb"
+ * ejbClass = "org.jboss.ejb."+ getName()
+ * jndiName = getName() + "-jndi-name"
+ * @return JBossSessionBeanMetaData
+ */
+ protected JBossEnterpriseBeanMetaData getEjbMetaData()
+ {
+ String name = super.getName();
+ JBossMetaData jbossMetaData = new JBossMetaData();
+ DeploymentSummary deploymentSummary = new DeploymentSummary();
+ deploymentSummary.setDeploymentName(name);
+ deploymentSummary.setDeploymentScopeBaseName("base");
+ deploymentSummary.setLoader(getClass().getClassLoader());
+ jbossMetaData.setDeploymentSummary(deploymentSummary);
+ JBossSessionBeanMetaData sbeanMD = new JBossSessionBeanMetaData();
+ sbeanMD.setEjbName(name+"-ejb");
+ sbeanMD.setEjbClass("org.jboss.ejb."+name);
+ sbeanMD.setJndiName(name+"-jndi-name");
+ JBossEnterpriseBeansMetaData beans = new JBossEnterpriseBeansMetaData();
+ beans.add(sbeanMD);
+ jbossMetaData.setEnterpriseBeans(beans);
+ return sbeanMD;
+ }
+}
More information about the jboss-cvs-commits
mailing list