Author: dblevins
Date: Wed Aug 5 05:30:56 2009
New Revision: 801061
URL: http://svn.apache.org/viewvc?rev=801061&view=rev
Log:
More improvements in client module processing. Previous code that checked if a
META-INF/application-client.xml existed and attempted alternate behavior did
not work. Added more reliable way to check if a
META-INF/application-client.xml was specified.
Modified:
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ReportValidationResults.java
Modified:
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java?rev=801061&r1=801060&r2=801061&view=diff
==============================================================================
---
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java
(original)
+++
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java
Wed Aug 5 05:30:56 2009
@@ -284,18 +284,16 @@
public ClientModule deploy(ClientModule clientModule) throws
OpenEJBException {
if (clientModule.getApplicationClient() == null){
- if (clientModule.getRemoteClients().size() > 0 ||
clientModule.getLocalClients().size() > 0) {
- clientModule.setApplicationClient(new ApplicationClient());
- }
+ clientModule.setApplicationClient(new ApplicationClient());
}
// Lots of jars have main classes so this might not even be an app
client.
// We're not going to scrape it for @LocalClient or @RemoteClient
annotations
// unless they flag us specifically by adding a
META-INF/application-client.xml
- // this will have been read in as the JAXB ApplicationClient
object below.
- // This applies only to jars that have just been flagged as
ClientModules,
- // EjbModules are also scraped for @LocalClient and @RemoteClient
annotations
- if (clientModule.getFinder() == null &&
clientModule.getApplicationClient() == null) return clientModule;
+ //
+ // ClientModules that already have a ClassFinder have been
generated automatically
+ // from an EjbModule, so we don't skip those ever.
+ if (clientModule.getFinder() == null &&
clientModule.getAltDDs().containsKey("application-client.xml"))
if (clientModule.getApplicationClient() != null &&
clientModule.getApplicationClient().isMetadataComplete()) return clientModule;
@@ -700,10 +698,10 @@
* has a META-INF/application-client.xml which tells us it
is in fact
* expected to be a ClientModule and not just some random
jar.
*/
- if (clientModule.getApplicationClient() == null) {
- getValidationContext().warn("client.missingMainClass",
className);
+ if
(clientModule.getAltDDs().containsKey("application-client.xml")) {
+ getValidationContext().fail("client",
"client.missingMainClass", className);
} else {
- getValidationContext().fail("client.missingMainClass",
className);
+ getValidationContext().warn("client",
"client.missingMainClass", className);
}
}
}
Modified:
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java?rev=801061&r1=801060&r2=801061&view=diff
==============================================================================
---
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java
(original)
+++
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java
Wed Aug 5 05:30:56 2009
@@ -273,7 +273,7 @@
clientModule.setApplicationClient(applicationClient);
} else {
if (!clientModule.isEjbModuleGenerated()) {
- DeploymentLoader.logger.warning("No application-client.xml
found assuming annotations present: " + appModule.getJarLocation() + ", module:
" + clientModule.getModuleId());
+ DeploymentLoader.logger.debug("No application-client.xml found
assuming annotations present: " + appModule.getJarLocation() + ", module: " +
clientModule.getModuleId());
clientModule.setApplicationClient(new ApplicationClient());
}
}
Modified:
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ReportValidationResults.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ReportValidationResults.java?rev=801061&r1=801060&r2=801061&view=diff
==============================================================================
---
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ReportValidationResults.java
(original)
+++
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/ReportValidationResults.java
Wed Aug 5 05:30:56 2009
@@ -104,6 +104,12 @@
logger.error("Invalid
"+context.getModuleType()+"(path="+context.getJarPath()+")");
// logger.error("Validation: "+errors.length + " errors,
"+failures.length+ " failures, in
"+context.getModuleType()+"(path="+context.getJarPath()+")");
+ } else if (context.hasWarnings()) {
+ if (context.getWarnings().length == 1) {
+ logger.warning(context.getWarnings().length +" warning for
"+context.getModuleType()+"(path="+context.getJarPath()+")");
+ } else {
+ logger.warning(context.getWarnings().length +" warnings for
"+context.getModuleType()+"(path="+context.getJarPath()+")");
+ }
}
}