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) |