From: Vance K. <va...@us...> - 2006-03-05 05:54:28
|
User: vancek Date: 06/03/04 21:54:26 Modified: andromda-ejb3/src/main/resources/templates/ejb3 SessionBean.vsl Log: separated lifecycle callback generation from session operations generated an abstract handle operation for every callback Revision Changes Path 1.20 +58 -37 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.19 retrieving revision 1.20 diff -u -w -r1.19 -r1.20 --- SessionBean.vsl 2 Mar 2006 10:24:34 -0000 1.19 +++ SessionBean.vsl 5 Mar 2006 05:54:26 -0000 1.20 @@ -275,27 +275,13 @@ // -------- Business Methods -------------- #**##foreach ($operation in $operations) +## +## Check that operation is NOT a lifecycle callback +## +#* *##if (!$operation.lifecycleCallback) /** $operation.getDocumentation(" * ") */ -## -## If this operation is a lifecycle callback, then exclude all other -## annotations except the callback annotations -## -#* *##if ($operation.lifecycleCallback) -#* *##if ($operation.postConstruct) - @javax.ejb.PostConstruct -#* *##elseif ($operation.preDestroy) - @javax.ejb.PreDestroy -#* *##end -#* *##if ($service.stateful) -#* *##if ($operation.postActivate) - @javax.ejb.PostActivate -#* *##elseif ($operation.prePassivate) - @javax.ejb.PrePassivate -#* *##end -#* *##end -#* *##else #* *##if (!$service.transactionManagementBean) #* *##if ($operation.transactionType) @javax.ejb.TransactionAttribute(javax.ejb.TransactionAttributeType.${operation.transactionType}) @@ -328,7 +314,6 @@ #* *##if ($operation.excludeClassInterceptors) @javax.ejb.ExcludeClassInterceptors #* *##end -#* *##end $operation.visibility $operation.returnType.fullyQualifiedName $operation.signature #* *##if ($operation.exceptionsPresent) $operation.throwsClause @@ -345,9 +330,9 @@ #* *##end #* *##end #* *##end -#if ($operation.constraintsPresent) +#* *##if ($operation.constraintsPresent) this.$operation.preconditionCall; -#end +#* *##end try { #* *##set ($call = "this.${operation.implementationCall};") @@ -390,7 +375,43 @@ throws java.lang.Exception; #**##end +#**##end #end +#if (!$operations.empty) + + // -------- Lifecycle Callbacks -------------- + +#**##foreach ($operation in $operations) +#* *##if ($operation.lifecycleCallback) + /** +$operation.getDocumentation(" * ") + */ +#* *##if ($operation.postConstruct) + @javax.ejb.PostConstruct +#* *##elseif ($operation.preDestroy) + @javax.ejb.PreDestroy +#* *##end +#* *##if ($service.stateful) +#* *##if ($operation.postActivate) + @javax.ejb.PostActivate +#* *##elseif ($operation.prePassivate) + @javax.ejb.PrePassivate +#* *##end +#* *##end + $operation.visibility void ${operation.name}() + { + this.handle${stringUtils.capitalize(${operation.name})}(); + } + + /** + * Performs the core logic for {@link #${operation.name}()} + */ + protected abstract $operation.returnType.fullyQualifiedName handle${stringUtils.capitalize(${operation.name})}(); + +#* *##end +#**##end +#end + // ------------ Generic Methods ------------ /** |