From: Vance K. <va...@us...> - 2006-06-14 04:49:56
|
User: vancek Date: 06/06/13 21:49:55 Modified: andromda-ejb3/src/main/resources/templates/ejb3 ServiceDelegate.vsl WebServiceInterface.vsl SessionLocal.vsl SessionRemote.vsl Log: Fix for JIRA EJB-27 - mixing local and remote interfaces with service delegates. Revision Changes Path 1.5 +29 -24 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.4 retrieving revision 1.5 diff -u -w -r1.4 -r1.5 --- ServiceDelegate.vsl 2 Mar 2006 10:19:45 -0000 1.4 +++ ServiceDelegate.vsl 14 Jun 2006 04:49:55 -0000 1.5 @@ -1,4 +1,8 @@ // license-header java merge-point +// +// Attention: Generated code! Do not modify by hand! +// Generated by: ServiceDelegate.vsl in andromda-ejb3-cartridge. +// #if ($stringUtils.isNotBlank($service.packageName)) package $service.packageName; #end @@ -10,28 +14,24 @@ * @see $service.fullyQualifiedServiceName */ public class $service.serviceDelegateName + extends ${ejb3TypesPackage}.ServiceDelegateBase { /** - * Environment properties - */ - private java.util.Properties env = null; - - /** * Default constructor */ public ${service.serviceDelegateName}() { - // Null implementation + super(); } /** * Constructor setting the envirinment properties. * - * @param env + * @param properties */ - public ${service.serviceDelegateName}(java.util.Properties env) + public ${service.serviceDelegateName}(java.util.Properties properties) { - this.env = env; + super(properties); } #if ($service.viewTypeRemote) @@ -41,7 +41,7 @@ private final ${service.fullyQualifiedServiceRemoteInterfaceName} get${service.name}Remote() throws javax.naming.NamingException { - return ${ejb3TypesPackage}.ServiceLocator.getInstance().get_${transform.toUnderscoreName(${service.fullyQualifiedServiceName})}_Remote(env); + return ${ejb3TypesPackage}.ServiceLocator.getInstance().get_${transform.toUnderscoreName(${service.fullyQualifiedServiceName})}_Remote(getProperties()); } #end @@ -52,7 +52,7 @@ private final ${service.fullyQualifiedServiceLocalInterfaceName} get${service.name}Local() throws javax.naming.NamingException { - return ${ejb3TypesPackage}.ServiceLocator.getInstance().get_${transform.toUnderscoreName(${service.fullyQualifiedServiceName})}_Local(env); + return ${ejb3TypesPackage}.ServiceLocator.getInstance().get_${transform.toUnderscoreName(${service.fullyQualifiedServiceName})}_Local(getProperties()); } #end @@ -60,11 +60,11 @@ ## ## Do not include lifecycle callback methods ## -#**##if (!$operation.lifecycleCallback) +#**##if (!$operation.lifecycleCallback && $operation.visibility == "public") /** * @see ${service.fullyQualifiedServiceName}#${operation.getSignature(false)} * - * Use the remote interface for calling session bean operations. + * Call the session bean operation using appropriate view type */ $operation.visibility $operation.returnType.fullyQualifiedName $operation.signature #* *##if ($operation.exceptionsPresent) @@ -73,10 +73,22 @@ { try { -#* *##if (!$operation.returnTypePresent) - get${service.name}Remote().${operation.name}(${operation.argumentNames}); -#* *##else - return get${service.name}Remote().${operation.name}(${operation.argumentNames}); +#* *##if ($operation.viewTypeAbsoluteBoth) + switch (getViewType()) + { + case LOCAL_VIEW_TYPE: + #if ($operation.returnTypePresent)return #end#**#get${service.name}Local().${operation.name}(${operation.argumentNames}); + break; + + case REMOTE_VIEW_TYPE: + default: + #if ($operation.returnTypePresent)return #end#**#get${service.name}Remote().${operation.name}(${operation.argumentNames}); + break; + } +#* *##elseif ($operation.viewTypeAbsoluteRemote) + #if ($operation.returnTypePresent)return #end#**#get${service.name}Remote().${operation.name}(${operation.argumentNames}); +#* *##elseif ($operation.viewTypeAbsoluteLocal) + #if ($operation.returnTypePresent)return #end#**#get${service.name}Local().${operation.name}(${operation.argumentNames}); #* *##end } #* *##if ($operation.exceptionsPresent) @@ -100,11 +112,4 @@ #**##end #end - /** - * Close down service delegate resources - */ - public void close() - { - ${ejb3TypesPackage}.ServiceLocator.getInstance().shutdown(); - } } \ No newline at end of file 1.3 +1 -1 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/WebServiceInterface.vsl Index: WebServiceInterface.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/WebServiceInterface.vsl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- WebServiceInterface.vsl 17 Apr 2006 01:57:46 -0000 1.2 +++ WebServiceInterface.vsl 14 Jun 2006 04:49:55 -0000 1.3 @@ -26,7 +26,7 @@ ## Operation must be exposed as a web-service operation (<<WebService>> on class or <<WebServiceOperation>> on operation) ## All operations throw java.rmi.RemoteException ## -#* *##if (!$operation.lifecycleCallback && ($operation.visibility == "public") && ($operation.viewTypeRemote || $operation.viewTypeBoth) && ($operation.exposed)) +#* *##if ($operation.viewTypeAbsoluteRemote && $operation.exposed) @javax.jws.WebMethod(operationName = "$operation.methodName") #* *##if ($stringUtils.isNotBlank($operation.resultName)) @javax.jws.WebResult(name = "${operation.resultName}") 1.6 +1 -1 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/SessionLocal.vsl Index: SessionLocal.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/SessionLocal.vsl,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -r1.5 -r1.6 --- SessionLocal.vsl 24 Apr 2006 02:31:32 -0000 1.5 +++ SessionLocal.vsl 14 Jun 2006 04:49:55 -0000 1.6 @@ -69,7 +69,7 @@ ## Only expose methods that are not lifecycle callbacks ## Only expose public methods with local view type accessability ## -#* *##if (!$operation.lifecycleCallback && $operation.visibility == "public" && ($operation.viewTypeLocal || $operation.viewTypeBoth)) +#* *##if ($operation.viewTypeAbsoluteLocal) /** $operation.getDocumentation(" * ") */ 1.6 +5 -2 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/SessionRemote.vsl Index: SessionRemote.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/SessionRemote.vsl,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -r1.5 -r1.6 --- SessionRemote.vsl 5 Mar 2006 05:57:37 -0000 1.5 +++ SessionRemote.vsl 14 Jun 2006 04:49:55 -0000 1.6 @@ -1,5 +1,8 @@ // license-header java merge-point -/* Autogenerated by AndroMDA (SessionRemote.vsl) - do not edit */ +// +// Attention: Generated code! Do not modify by hand! +// Generated by: SessionRemote.vsl in andromda-ejb3-cartridge. +// #if ($stringUtils.isNotBlank($service.packageName)) package $service.packageName; #end @@ -66,7 +69,7 @@ ## Only expose methods that are not lifecycle callbacks ## Only expose public methods with remote view type accessability ## -#* *##if (!$operation.lifecycleCallback && $operation.visibility == "public" && ($operation.viewTypeRemote || $operation.viewTypeBoth)) +#* *##if ($operation.viewTypeAbsoluteRemote) /** $operation.getDocumentation(" * ") */ |