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 } } |
From: Vance K. <va...@us...> - 2006-02-09 07:09:51
|
User: vancek Date: 06/02/08 23:09:46 Modified: andromda-ejb3/src/main/resources/templates/ejb3 ServiceDelegate.vsl Log: added helper method to use local interface for jndi lookup. distinguish help methods by adding 'Remote' or 'Local' to end of method name. Revision Changes Path 1.3 +20 -5 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.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- ServiceDelegate.vsl 31 Jan 2006 15:19:28 -0000 1.2 +++ ServiceDelegate.vsl 9 Feb 2006 07:09:45 -0000 1.3 @@ -34,18 +34,33 @@ this.env = env; } +#if ($service.viewTypeRemote) /** * Gets an instance of {@link $service.fullyQualifiedServiceRemoteInterfaceName} */ - private final ${service.fullyQualifiedServiceRemoteInterfaceName} get${service.name}() + private final ${service.fullyQualifiedServiceRemoteInterfaceName} get${service.name}Remote() throws javax.naming.NamingException { - return ${ejb3TypesPackage}.ServiceLocator.getInstance().get_${transform.toUnderscoreName(${service.fullyQualifiedServiceName})}(env); + return ${ejb3TypesPackage}.ServiceLocator.getInstance().get_${transform.toUnderscoreName(${service.fullyQualifiedServiceName})}_Remote(env); } +#end +#if ($service.viewTypeLocal) + /** + * Gets an instance of {@link $service.fullyQualifiedServiceLocalInterfaceName} + */ + private final ${service.fullyQualifiedServiceLocalInterfaceName} get${service.name}Local() + throws javax.naming.NamingException + { + return ${ejb3TypesPackage}.ServiceLocator.getInstance().get_${transform.toUnderscoreName(${service.fullyQualifiedServiceName})}_Local(env); + } + +#end #foreach ($operation in $service.businessOperations) /** * @see ${service.fullyQualifiedServiceName}#${operation.getSignature(false)} + * + * Use the remote interface for calling session bean operations. */ $operation.visibility $operation.returnType.fullyQualifiedName $operation.signature #**##if ($operation.exceptionsPresent) @@ -55,9 +70,9 @@ try { #**##if (!$operation.returnTypePresent) - get${service.name}().${operation.name}(${operation.argumentNames}); + get${service.name}Remote().${operation.name}(${operation.argumentNames}); #**##else - return get${service.name}().${operation.name}(${operation.argumentNames}); + return get${service.name}Remote().${operation.name}(${operation.argumentNames}); #**##end } #**##if ($operation.exceptionsPresent) |
From: Vance K. <va...@us...> - 2006-03-02 10:19:47
|
User: vancek Date: 06/03/02 02:19:45 Modified: andromda-ejb3/src/main/resources/templates/ejb3 ServiceDelegate.vsl Log: do not include operations that are session bean lifecycle callback methods Revision Changes Path 1.4 +16 -11 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.3 retrieving revision 1.4 diff -u -w -r1.3 -r1.4 --- ServiceDelegate.vsl 9 Feb 2006 07:09:45 -0000 1.3 +++ ServiceDelegate.vsl 2 Mar 2006 10:19:45 -0000 1.4 @@ -57,6 +57,10 @@ #end #foreach ($operation in $service.businessOperations) +## +## Do not include lifecycle callback methods +## +#**##if (!$operation.lifecycleCallback) /** * @see ${service.fullyQualifiedServiceName}#${operation.getSignature(false)} * @@ -94,6 +98,7 @@ } } +#**##end #end /** * Close down service delegate resources |