[jboss-cvs] JBossAS SVN: r65004 - in trunk/ejb3/src: resources/META-INF and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Sat Sep 1 01:14:43 EDT 2007
Author: ALRubinger
Date: 2007-09-01 01:14:43 -0400 (Sat, 01 Sep 2007)
New Revision: 65004
Modified:
trunk/ejb3/src/main/org/jboss/ejb3/EJB3Deployer.java
trunk/ejb3/src/resources/META-INF/jboss-service.xml
Log:
EJBTHREE-1040: Enhancements for legacy EJB3 deployer with intent for backmerging into Branch 4.2; to be discussed w/ DeCoste. Untested.
Modified: trunk/ejb3/src/main/org/jboss/ejb3/EJB3Deployer.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/EJB3Deployer.java 2007-09-01 05:11:21 UTC (rev 65003)
+++ trunk/ejb3/src/main/org/jboss/ejb3/EJB3Deployer.java 2007-09-01 05:14:43 UTC (rev 65004)
@@ -84,6 +84,8 @@
private HashSet ignoredJarsSet;
private HashMap<DeploymentInfo, String> jmxNames = new HashMap();
+ private boolean requireDeploymentDescriptor;
+
/**
* Default CTOR used to set default values to the Suffixes and RelativeOrder
* attributes. Those are read at subdeployer registration time by the MainDeployer
@@ -184,11 +186,16 @@
}
return false;
}
+
+ protected boolean hasJbossXml(DeploymentInfo di)
+ {
+ return hasFile(di, "META-INF/jboss.xml");
+ }
protected boolean hasOnlyJbossXml(DeploymentInfo di)
{
if (!hasFile(di, "META-INF/ejb-jar.xml")
- && hasFile(di, "META-INF/jboss.xml"))
+ && this.hasJbossXml(di))
{
return true;
}
@@ -240,6 +247,17 @@
*/
public boolean accepts(DeploymentInfo di)
{
+
+ // Check for deployment descriptor if the deployer is
+ // configured to require one for deployment
+ // EJBTHREE-1040
+ if (this.getRequireDeploymentDescriptor() && !(EJB3Deployer.has30EjbJarXml(di) || this.hasJbossXml(di)))
+ {
+ log.trace(EJB3Deployer.class.getSimpleName() + " skipping deployment of \"" + di.localUrl
+ + "\"; deployer is configured to require DD and none was found.");
+ return false;
+ }
+
String urlStr = di.url.getFile();
if (urlStr.endsWith(".ejb3") || urlStr.endsWith(".ejb3/") || urlStr.endsWith(".par") || urlStr.endsWith(".par/"))
{
@@ -266,7 +284,6 @@
if (hasEjbAnnotation(di)) return true;
}
-
return false;
}
@@ -289,7 +306,18 @@
{
this.deployEjb3ExtensionOnly = deployEjb3ExtensionOnly;
}
+
+ public boolean getRequireDeploymentDescriptor()
+ {
+ return requireDeploymentDescriptor;
+ }
+
+ public void setRequireDeploymentDescriptor(boolean requireDeploymentDescriptor)
+ {
+ this.requireDeploymentDescriptor = requireDeploymentDescriptor;
+ }
+
/**
* Overriden to set the hibernate.bytecode.provider from the
*
Modified: trunk/ejb3/src/resources/META-INF/jboss-service.xml
===================================================================
--- trunk/ejb3/src/resources/META-INF/jboss-service.xml 2007-09-01 05:11:21 UTC (rev 65003)
+++ trunk/ejb3/src/resources/META-INF/jboss-service.xml 2007-09-01 05:14:43 UTC (rev 65004)
@@ -126,6 +126,19 @@
<attribute name="DeployEjb3ExtensionOnly">false</attribute>
+ <!--
+
+ Configure the deployer to optionally require a deployment
+ descriptor for deployable units. By turning this switch to "true",
+ "META-INF/jboss.xml" or the EJB3 Deployment Descriptor "META-INF/ejb-jar.xml"
+ will be required for deployment, enabling a performance increace in deployment by
+ not scanning for annotations in non-deployable EJB3 JARs.
+
+ Default for this value is "false".
+
+ -->
+ <attribute name="RequireDeploymentDescriptor">false</attribute>
+
<!-- Inline XMBean Descriptor BEGIN -->
<xmbean>
<description>The EJB3Deployer responsible for ejb3 deployment</description>
More information about the jboss-cvs-commits
mailing list