From: Vance K. <va...@us...> - 2006-01-31 15:19:33
|
User: vancek Date: 06/01/31 07:19:28 Modified: andromda-ejb3/src/main/resources/templates/ejb3 ServiceDelegate.vsl Log: session method wraps NamingException with default service exception Revision Changes Path 1.2 +13 -12 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/ServiceDelegate.vsl Index: ServiceDelegate.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/ServiceDelegate.vsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- ServiceDelegate.vsl 10 Jan 2006 08:09:58 -0000 1.1 +++ ServiceDelegate.vsl 31 Jan 2006 15:19:28 -0000 1.2 @@ -40,7 +40,7 @@ private final ${service.fullyQualifiedServiceRemoteInterfaceName} get${service.name}() throws javax.naming.NamingException { - return ${ejb3TypesPackage}.ServiceLocator.getInstance().get${service.name}(env); + return ${ejb3TypesPackage}.ServiceLocator.getInstance().get_${transform.toUnderscoreName(${service.fullyQualifiedServiceName})}(env); } #foreach ($operation in $service.businessOperations) @@ -60,20 +60,21 @@ return get${service.name}().${operation.name}(${operation.argumentNames}); #**##end } -#**##if (!$operation.exceptionsPresent) - catch (Exception ex) -#**##else - catch (javax.naming.NamingException ex) -#**##end - { #**##if ($operation.exceptionsPresent) #* *##foreach ($exception in $operation.exceptions) -#* *##if ($velocityCount == 1) - throw new ${exception.fullyQualifiedName}(ex); + catch ($exception.fullyQualifiedName ex) + { + throw ex; + } #* *##end #* *##end + catch (javax.naming.NamingException ex) + { +#**##if ($service.allowDefaultServiceException) + throw new ${service.fullyQualifiedDefaultExceptionName}( + "Error performing '${service.fullyQualifiedName}.${operation.signature}' --> " + ex, ex); #**##else - ex.printStackTrace(); + throw ex; #**##end } } |