From: Vance K. <va...@us...> - 2006-01-28 02:49:21
|
User: vancek Date: 06/01/27 18:49:15 Modified: andromda-ejb3/src/main/resources/templates/ejb3 SessionBean.vsl Log: added Globals.vm inclusion, session operations are no longer abstract; their implementation checks for null args, perform a preconditial call if required and call handle<operation name>; added an abstract operation handle<operation name> for every operation which is implemented in the subclass. Revision Changes Path 1.11 +69 -19 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/SessionBean.vsl Index: SessionBean.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/SessionBean.vsl,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -r1.10 -r1.11 --- SessionBean.vsl 25 Jan 2006 02:55:17 -0000 1.10 +++ SessionBean.vsl 28 Jan 2006 02:49:15 -0000 1.11 @@ -1,5 +1,6 @@ // license-header java merge-point /* Autogenerated by AndroMDA (SessionBean.vsl) - do not edit */ +#parse("templates/ejb3/Globals.vm") #if ($stringUtils.isNotBlank($service.packageName)) package $service.packageName; #end @@ -278,9 +279,6 @@ // -------- Business Methods -------------- #**##foreach ($operation in $operations) -#* *##set ($visibility = $operation.visibility) -## Only public methods have transactions and are exported to the interfaces -#* *##if ($visibility == "public") /** $operation.getDocumentation(" * ") */ @@ -302,14 +300,66 @@ #* *##if ($operation.timeoutCallback) @javax.ejb.Timeout #* *##end -#* *##set ($returnType = $operation.returnType.fullyQualifiedName) + $operation.visibility $operation.returnType.fullyQualifiedName $operation.signature #* *##if ($operation.exceptionsPresent) - $visibility abstract $returnType $operation.signature $operation.throwsClause; + $operation.throwsClause +#* *##end + { +#* *##if ($requiredCheckEnabled) +#* *##foreach ($argument in $operation.arguments) +#* *##if ($argument.required && !$argument.type.primitive) + if ($argument.name == null) + { + throw new IllegalArgumentException( + "${service.fullyQualifiedServiceName}.${operation.signature} - '${argument.name}' can not be null"); + } +#* *##end +#* *##end +#* *##end +#if ($operation.constraintsPresent) + this.$operation.preconditionCall; +#end + try + { +#* *##set ($call = "this.${operation.implementationCall};") +#* *##if ($operation.returnTypePresent) + return $call #* *##else - $visibility abstract $returnType $operation.signature; + $call +#* *##end + } +#* *##foreach($exception in $operation.exceptions) + catch ($exception.fullyQualifiedName ex) + { + throw ex; + } +#* *##end +#* *##if ($service.allowDefaultServiceException) + catch (Throwable th) + { + throw new ${service.fullyQualifiedDefaultExceptionName}( + "Error performing '${service.fullyQualifiedName}.${operation.signature}' --> " + th, + th); + } #* *##end + } + +#* *##if ($operation.constraintsPresent) + /** + * Performs any precondition checks for {@link #${operation.call}}. + */ + private void $operation.preconditionSignature + { +#renderPreconditions($operation) + } #* *##end + /** + * Performs the core logic for {@link #${operation.getSignature(false)}} + */ + protected abstract $operation.returnType.fullyQualifiedName $operation.implementationSignature + throws java.lang.Exception; + #**##end #end } \ No newline at end of file |