[jboss-cvs] JBossAS SVN: r77149 - trunk/server/src/main/org/jboss/deployment.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Aug 18 05:41:33 EDT 2008
Author: alesj
Date: 2008-08-18 05:41:32 -0400 (Mon, 18 Aug 2008)
New Revision: 77149
Modified:
trunk/server/src/main/org/jboss/deployment/OptAnnotationMetaDataDeployer.java
Log:
Read Manifest/Main class as lazy as possible.
Modified: trunk/server/src/main/org/jboss/deployment/OptAnnotationMetaDataDeployer.java
===================================================================
--- trunk/server/src/main/org/jboss/deployment/OptAnnotationMetaDataDeployer.java 2008-08-18 09:32:49 UTC (rev 77148)
+++ trunk/server/src/main/org/jboss/deployment/OptAnnotationMetaDataDeployer.java 2008-08-18 09:41:32 UTC (rev 77149)
@@ -63,23 +63,24 @@
protected void processMetaData(VFSDeploymentUnit unit, WebMetaData webMetaData, ApplicationClientMetaData clientMetaData, List<VirtualFile> classpath) throws Exception
{
- String mainClassName = getMainClassName(unit);
AnnotationFinder<AnnotatedElement> finder = new DefaultAnnotationFinder<AnnotatedElement>();
if(webMetaData != null)
{
processJBossWebMetaData(unit, finder);
}
- else if (clientMetaData != null || mainClassName != null)
+ else if (clientMetaData != null)
{
- //
- if(mainClassName == null)
- return;
-
- processJBossClientMetaData(unit, finder, mainClassName);
+ String mainClassName = getMainClassName(unit);
+ if(mainClassName != null)
+ processJBossClientMetaData(unit, finder, mainClassName);
}
else
{
- processJBossMetaData(unit, finder);
+ String mainClassName = getMainClassName(unit);
+ if (mainClassName != null)
+ processJBossClientMetaData(unit, finder, mainClassName);
+ else
+ processJBossMetaData(unit, finder);
}
}
@@ -103,11 +104,13 @@
*
* @param unit the deployment unit
* @param finder the finder
+ * @param mainClassName the main class name
+ * @throws ClassNotFoundException for any error
*/
protected void processJBossClientMetaData(VFSDeploymentUnit unit, AnnotationFinder<AnnotatedElement> finder, String mainClassName) throws ClassNotFoundException
{
ApplicationClient5MetaDataCreator creator = new ApplicationClient5MetaDataCreator(finder, mainClassName);
- Collection<Class<?>> classes = new ArrayList<Class<?>>();
+ Collection<Class<?>> classes = new ArrayList<Class<?>>(1);
Class<?> mainClass = unit.getClassLoader().loadClass(mainClassName);
classes.add(mainClass);
ApplicationClientMetaData annotationMetaData = creator.create(classes);
More information about the jboss-cvs-commits
mailing list