[299086] EJB Timer wizard
diff --git a/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/AddEjbTimerClassOperation.java b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/AddEjbTimerClassOperation.java new file mode 100644 index 0000000..7a4c3d0 --- /dev/null +++ b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/AddEjbTimerClassOperation.java
@@ -0,0 +1,71 @@ +/******************************************************************************* + * Copyright (c) 2011 Oracle and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ludovic Champenois ludo@java.net + *******************************************************************************/ + +package org.eclipse.jst.j2ee.ejb.internal.operations; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.emf.codegen.jet.JETException; +import org.eclipse.jdt.core.IPackageFragment; +import org.eclipse.wst.common.frameworks.datamodel.IDataModel; +import org.eclipse.wst.common.frameworks.internal.enablement.nonui.WFTWrappedException; + +@SuppressWarnings("restriction") +public class AddEjbTimerClassOperation extends NewEnterpriseBeanClassOperation { + + /** + * folder location of the EJB Timer creation templates directory + */ + protected static final String TEMPLATE_FILE = "/templates/ejbtimer.javajet"; //$NON-NLS-1$ + + public AddEjbTimerClassOperation(IDataModel dataModel) { + super(dataModel); + } + + @Override + protected void generateUsingTemplates(IProgressMonitor monitor, + IPackageFragment fragment) throws WFTWrappedException, + CoreException { + // Create the enterprise bean template model + AddEjbTimerTemplateModel tempModel = new AddEjbTimerTemplateModel(model); + // Using the WTPJetEmitter, generate the java source based on the bean + // template model + try { + if (fragment != null) { + // Create the EJB Timer java file + EjbTimerTemplate tempImpl = EjbTimerTemplate.create(null); + + try { + Method method = tempImpl.getClass().getMethod("generate", //$NON-NLS-1$ + new Class[] { Object.class }); + String source = (String) method.invoke(tempImpl, tempModel); + String javaFileName = tempModel.getClassName() + ".java"; //$NON-NLS-1$ + createJavaFile(monitor, fragment, source, javaFileName); + } catch (SecurityException e) { + throw new JETException(e); + } catch (NoSuchMethodException e) { + throw new JETException(e); + } catch (IllegalArgumentException e) { + throw new JETException(e); + } catch (IllegalAccessException e) { + throw new JETException(e); + } catch (InvocationTargetException e) { + throw new JETException(e); + } + } + } catch (Exception e) { + throw new WFTWrappedException(e); + } + } +}
diff --git a/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/AddEjbTimerDataModelProvider.java b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/AddEjbTimerDataModelProvider.java new file mode 100644 index 0000000..5614f37 --- /dev/null +++ b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/AddEjbTimerDataModelProvider.java
@@ -0,0 +1,98 @@ +/******************************************************************************* + * Copyright (c) 2011 Oracle and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ludovic Champenois ludo@java.net + *******************************************************************************/ + + +package org.eclipse.jst.j2ee.ejb.internal.operations; + +import static org.eclipse.jst.j2ee.ejb.internal.operations.INewEnterpriseBeanClassDataModelProperties.EJB_NAME; + +import java.util.Set; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.jst.j2ee.internal.common.operations.NewJavaClassDataModelProvider; +import org.eclipse.jst.j2ee.internal.common.operations.NewJavaEEArtifactClassOperation; +import org.eclipse.jst.j2ee.internal.ejb.project.operations.EJBCreationResourceHandler; +import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation; +import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider; +import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonPlugin; + + +@SuppressWarnings("restriction") +public class AddEjbTimerDataModelProvider extends + NewEnterpriseBeanClassDataModelProvider { + + public static final String SCHEDULE = "AddEjbTimer.SCHEDULE"; //$NON-NLS-1$ + + @Override + public IDataModelOperation getDefaultOperation() { + return new AddEnterpriseBeanOperation(getDataModel()) { + + @Override + protected NewJavaEEArtifactClassOperation getNewClassOperation() { + return new AddEjbTimerClassOperation(getDataModel()); + } + }; + } + + /** + * Subclasses may extend this method to add their own data model's + * properties as valid base properties. + * + * @see org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider#getPropertyNames() + */ + @Override + public Set<String> getPropertyNames() { + // Add Bean specific properties defined in this data model + Set<String> propertyNames = super.getPropertyNames(); + + propertyNames.add(SCHEDULE); + + return propertyNames; + } + + /** + * Subclasses may extend this method to provide their own default values for + * any of the properties in the data model hierarchy. This method does not + * accept a null parameter. It may return null. + * + * @see NewJavaClassDataModelProvider#getDefaultProperty(String) + * @see IDataModelProvider#getDefaultProperty(String) + * + * @param propertyName + * @return Object default value of property + */ + @Override + public Object getDefaultProperty(String propertyName) { + if (propertyName.equals(SCHEDULE)) { + return EJBCreationResourceHandler.timerScheduleDefault; + } + + // Otherwise check super for default value for property + return super.getDefaultProperty(propertyName); + } + + @Override + public IStatus validate(String propertyName) { + // we need to override to remove the error condition for EJB_NAME + if (EJB_NAME.equals(propertyName)){ + return null; + } + + if (SCHEDULE.equals(propertyName)) { + String value = (String) getProperty(SCHEDULE); + if (value == null || value.trim().length() == 0) { + return WTPCommonPlugin.createErrorStatus(EJBCreationResourceHandler.errorTimerScheduleMissing); + } + } + IStatus status = super.validate(propertyName); + return status; + } +}
diff --git a/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/AddEjbTimerTemplateModel.java b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/AddEjbTimerTemplateModel.java new file mode 100644 index 0000000..9e6fafb --- /dev/null +++ b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/AddEjbTimerTemplateModel.java
@@ -0,0 +1,85 @@ +/******************************************************************************* + * Copyright (c) 2011 Oracle and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ludovic Champenois ludo@java.net + *******************************************************************************/ + +package org.eclipse.jst.j2ee.ejb.internal.operations; + +import static org.eclipse.jst.j2ee.ejb.internal.operations.INewEnterpriseBeanClassDataModelProperties.EJB_NAME; +import static org.eclipse.jst.j2ee.ejb.internal.operations.INewEnterpriseBeanClassDataModelProperties.MAPPED_NAME; + +import java.util.Collection; +import java.util.Hashtable; +import java.util.Iterator; +import java.util.Map; + +import org.eclipse.jst.j2ee.internal.common.operations.Method; +import org.eclipse.wst.common.frameworks.datamodel.IDataModel; + +@SuppressWarnings("restriction") +public class AddEjbTimerTemplateModel extends CreateEnterpriseBeanTemplateModel { + + public static final String QUALIFIED_SCHEDULE = "javax.ejb.Schedule"; //$NON-NLS-1$ + public static final String QUALIFIED_TIMER = "javax.ejb.Timer"; //$NON-NLS-1$ + public static final String QUALIFIED_STATELESS = "javax.ejb.Stateless"; //$NON-NLS-1$ + + public static final String SCHEDULED_TIMEOUT = "scheduledTimeout"; //$NON-NLS-1$ + + public AddEjbTimerTemplateModel(IDataModel adataModel) { + super(adataModel); + } + + @Override + public Collection<String> getImports() { + Collection<String> collection = super.getImports(); + + collection.add(QUALIFIED_SCHEDULE); + collection.add(QUALIFIED_STATELESS); + collection.add(QUALIFIED_TIMER); + + return collection; + } + + public Map<String, String> getClassAnnotationParams() { + Map<String, String> result = new Hashtable<String, String>(); + + String dispName = getProperty(EJB_NAME).trim(); + if (!dispName.equals(getClassName()) && (dispName.length() > 0)) { + result.put(ATT_NAME, QUOTATION_STRING + dispName + QUOTATION_STRING); + } + String mappedName = getProperty(MAPPED_NAME).trim(); + if (mappedName != null && mappedName.length() > 0) { + result.put(ATT_MAPPED_NAME, QUOTATION_STRING + mappedName + QUOTATION_STRING); + } + + return result; + } + + @Override + public String getProperty(String propertyName) { + return dataModel.getStringProperty(propertyName); + } + + @Override + public Collection<Method> getUnimplementedMethods() { + Collection<Method> unimplementedMethods = super + .getUnimplementedMethods(); + Iterator<Method> iterator = unimplementedMethods.iterator(); + + while (iterator.hasNext()) { + Method method = iterator.next(); + if (SCHEDULED_TIMEOUT.equals(method.getName())) { + iterator.remove(); + } + } + + return unimplementedMethods; + } + +}
diff --git a/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/EjbTimerTemplate.java b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/EjbTimerTemplate.java new file mode 100644 index 0000000..e446736 --- /dev/null +++ b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/EjbTimerTemplate.java
@@ -0,0 +1,239 @@ +package org.eclipse.jst.j2ee.ejb.internal.operations; + +import java.util.*; + +import org.eclipse.jst.j2ee.internal.common.operations.*; + + + +@SuppressWarnings("restriction") +public class EjbTimerTemplate { + protected static String nl; + public static synchronized EjbTimerTemplate create(String lineSeparator) + { + nl = lineSeparator; + EjbTimerTemplate result = new EjbTimerTemplate(); + nl = null; + return result; + } + + public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl; //$NON-NLS-1$ + protected final String TEXT_1 = "package "; //$NON-NLS-1$ + protected final String TEXT_2 = ";"; //$NON-NLS-1$ + protected final String TEXT_3 = NL; + protected final String TEXT_4 = NL + "import "; //$NON-NLS-1$ + protected final String TEXT_5 = ";"; //$NON-NLS-1$ + protected final String TEXT_6 = NL + NL + "@Stateless"; //$NON-NLS-1$ + protected final String TEXT_7 = NL + "public "; //$NON-NLS-1$ + protected final String TEXT_8 = "abstract "; //$NON-NLS-1$ + protected final String TEXT_9 = "final "; //$NON-NLS-1$ + protected final String TEXT_10 = "class "; //$NON-NLS-1$ + protected final String TEXT_11 = " extends "; //$NON-NLS-1$ + protected final String TEXT_12 = " implements "; //$NON-NLS-1$ + protected final String TEXT_13 = ", "; //$NON-NLS-1$ + protected final String TEXT_14 = " {"; //$NON-NLS-1$ + protected final String TEXT_15 = NL + NL + " /**" + NL + " * Default constructor. " + NL + " */" + NL + " public "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ + protected final String TEXT_16 = "() {" + NL + " // TODO Auto-generated constructor stub" + NL + " }"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + protected final String TEXT_17 = NL + " " + NL + " /**" + NL + " * @see "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + protected final String TEXT_18 = "#"; //$NON-NLS-1$ + protected final String TEXT_19 = "("; //$NON-NLS-1$ + protected final String TEXT_20 = ")" + NL + " */" + NL + " public "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + protected final String TEXT_21 = "("; //$NON-NLS-1$ + protected final String TEXT_22 = ") {" + NL + " super("; //$NON-NLS-1$ //$NON-NLS-2$ + protected final String TEXT_23 = ");" + NL + " // TODO Auto-generated constructor stub" + NL + " }"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + protected final String TEXT_24 = NL + NL + "\t/**" + NL + " * @see "; //$NON-NLS-1$ //$NON-NLS-2$ + protected final String TEXT_25 = "#"; //$NON-NLS-1$ + protected final String TEXT_26 = "("; //$NON-NLS-1$ + protected final String TEXT_27 = ")" + NL + " */" + NL + " public "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + protected final String TEXT_28 = " "; //$NON-NLS-1$ + protected final String TEXT_29 = "("; //$NON-NLS-1$ + protected final String TEXT_30 = ") {" + NL + " // TODO Auto-generated method stub"; //$NON-NLS-1$ //$NON-NLS-2$ + protected final String TEXT_31 = NL + "\t\t\treturn "; //$NON-NLS-1$ + protected final String TEXT_32 = ";"; //$NON-NLS-1$ + protected final String TEXT_33 = NL + " }"; //$NON-NLS-1$ + protected final String TEXT_34 = NL + "\t"; //$NON-NLS-1$ + protected final String TEXT_35 = NL + "\t@SuppressWarnings(\"unused\")" + NL + "\t@Schedule("; //$NON-NLS-1$ //$NON-NLS-2$ + protected final String TEXT_36 = ")" + NL + " private void scheduledTimeout(final Timer t) {" + NL + " System.out.println(\"@Schedule called at: \" + new java.util.Date());" + NL + " }" + NL + "}"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ + + public String generate(Object argument) + { + final StringBuffer stringBuffer = new StringBuffer(); + AddEjbTimerTemplateModel model = (AddEjbTimerTemplateModel) argument; + /* This Content is provided under the terms and conditions of the Eclipse Public License Version 1.0 +("EPL"). A copy of the EPL is available at http://www.eclipse.org/org/documents/epl-v10.php +For purposes of the EPL, "Program" will mean the Content. + +Copied from org.eclipse.jst.j2ee.ejb plugin. */ + + model.removeFlags(CreateJavaEEArtifactTemplateModel.FLAG_QUALIFIED_SUPERCLASS_NAME); + + /* This Content is provided under the terms and conditions of the Eclipse Public License Version 1.0 +("EPL"). A copy of the EPL is available at http://www.eclipse.org/org/documents/epl-v10.php +For purposes of the EPL, "Program" will mean the Content. + +Copied from org.eclipse.jst.j2ee.ejb plugin. */ + + if (model.getJavaPackageName() != null && model.getJavaPackageName().length() > 0) { + + stringBuffer.append(TEXT_1); + stringBuffer.append( model.getJavaPackageName() ); + stringBuffer.append(TEXT_2); + + } + + stringBuffer.append(TEXT_3); + /* This Content is provided under the terms and conditions of the Eclipse Public License Version 1.0 +("EPL"). A copy of the EPL is available at http://www.eclipse.org/org/documents/epl-v10.php +For purposes of the EPL, "Program" will mean the Content. + +Copied from org.eclipse.jst.j2ee.ejb plugin. */ + + Collection<String> imports = model.getImports(); + for (String anImport : imports) { + + stringBuffer.append(TEXT_4); + stringBuffer.append( anImport ); + stringBuffer.append(TEXT_5); + + } + + stringBuffer.append(TEXT_6); + /* This Content is provided under the terms and conditions of the Eclipse Public License Version 1.0 +("EPL"). A copy of the EPL is available at http://www.eclipse.org/org/documents/epl-v10.php +For purposes of the EPL, "Program" will mean the Content. + +Copied from org.eclipse.jst.j2ee.ejb plugin. */ + + if (model.isPublic()) { + + stringBuffer.append(TEXT_7); + + } + + if (model.isAbstract()) { + + stringBuffer.append(TEXT_8); + + } + + if (model.isFinal()) { + + stringBuffer.append(TEXT_9); + + } + + stringBuffer.append(TEXT_10); + stringBuffer.append( model.getClassName() ); + + String superClass = model.getSuperclassName(); + if (superClass != null && superClass.length() > 0) { + + stringBuffer.append(TEXT_11); + stringBuffer.append( superClass ); + + } + + List<String> interfaces = model.getInterfaces(); + if ( interfaces.size() > 0) { + + stringBuffer.append(TEXT_12); + + } + + for (int i = 0; i < interfaces.size(); i++) { + String INTERFACE = interfaces.get(i); + if (i > 0) { + + stringBuffer.append(TEXT_13); + + } + + stringBuffer.append( INTERFACE ); + + } + + stringBuffer.append(TEXT_14); + /* This Content is provided under the terms and conditions of the Eclipse Public License Version 1.0 +("EPL"). A copy of the EPL is available at http://www.eclipse.org/org/documents/epl-v10.php +For purposes of the EPL, "Program" will mean the Content. + +Copied from org.eclipse.jst.j2ee.ejb plugin. */ + + if (!model.hasEmptySuperclassConstructor()) { + + stringBuffer.append(TEXT_15); + stringBuffer.append( model.getClassName() ); + stringBuffer.append(TEXT_16); + + } + + if (model.shouldGenSuperclassConstructors()) { + List<Constructor> constructors = model.getConstructors(); + for (Constructor constructor : constructors) { + if (constructor.isPublic() || constructor.isProtected()) { + + stringBuffer.append(TEXT_17); + stringBuffer.append( model.getSuperclassName() ); + stringBuffer.append(TEXT_18); + stringBuffer.append( model.getSuperclassName() ); + stringBuffer.append(TEXT_19); + stringBuffer.append( constructor.getParamsForJavadoc() ); + stringBuffer.append(TEXT_20); + stringBuffer.append( model.getClassName() ); + stringBuffer.append(TEXT_21); + stringBuffer.append( constructor.getParamsForDeclaration() ); + stringBuffer.append(TEXT_22); + stringBuffer.append( constructor.getParamsForCall() ); + stringBuffer.append(TEXT_23); + + } + } + } + + /* This Content is provided under the terms and conditions of the Eclipse Public License Version 1.0 +("EPL"). A copy of the EPL is available at http://www.eclipse.org/org/documents/epl-v10.php +For purposes of the EPL, "Program" will mean the Content. + +Copied from org.eclipse.jst.j2ee.ejb plugin. */ + + if (model.shouldImplementAbstractMethods()) { + for (Method method : model.getUnimplementedMethods()) { + + stringBuffer.append(TEXT_24); + stringBuffer.append( method.getContainingJavaClass() ); + stringBuffer.append(TEXT_25); + stringBuffer.append( method.getName() ); + stringBuffer.append(TEXT_26); + stringBuffer.append( method.getParamsForJavadoc() ); + stringBuffer.append(TEXT_27); + stringBuffer.append( method.getReturnType() ); + stringBuffer.append(TEXT_28); + stringBuffer.append( method.getName() ); + stringBuffer.append(TEXT_29); + stringBuffer.append( method.getParamsForDeclaration() ); + stringBuffer.append(TEXT_30); + + String defaultReturnValue = method.getDefaultReturnValue(); + if (defaultReturnValue != null) { + + stringBuffer.append(TEXT_31); + stringBuffer.append( defaultReturnValue ); + stringBuffer.append(TEXT_32); + + } + + stringBuffer.append(TEXT_33); + + } + } + + stringBuffer.append(TEXT_34); + + String schedule = model.getProperty(AddEjbTimerDataModelProvider.SCHEDULE).trim(); + + stringBuffer.append(TEXT_35); + stringBuffer.append( schedule ); + stringBuffer.append(TEXT_36); + return stringBuffer.toString(); + } +}
diff --git a/plugins/org.eclipse.jst.j2ee.ejb/ejbcreation/org/eclipse/jst/j2ee/internal/ejb/project/operations/EJBCreationResourceHandler.java b/plugins/org.eclipse.jst.j2ee.ejb/ejbcreation/org/eclipse/jst/j2ee/internal/ejb/project/operations/EJBCreationResourceHandler.java index 7daba16..a55d26b 100644 --- a/plugins/org.eclipse.jst.j2ee.ejb/ejbcreation/org/eclipse/jst/j2ee/internal/ejb/project/operations/EJBCreationResourceHandler.java +++ b/plugins/org.eclipse.jst.j2ee.ejb/ejbcreation/org/eclipse/jst/j2ee/internal/ejb/project/operations/EJBCreationResourceHandler.java
@@ -7,6 +7,7 @@ * * Contributors: * IBM Corporation - initial API and implementation + * Oracle - EJB Timer *******************************************************************************/ package org.eclipse.jst.j2ee.internal.ejb.project.operations; @@ -167,7 +168,10 @@ public static String ERR_SINGLETON_NOT_ALLOWED; public static String ERR_NO_INTERFACE_NOT_ALLOWED; - + //EJB Timer specific + public static String timerScheduleDefault; + public static String errorTimerScheduleMissing; + static { NLS.initializeMessages(BUNDLE_NAME, EJBCreationResourceHandler.class); }
diff --git a/plugins/org.eclipse.jst.j2ee.ejb/property_files/ejbcreation.properties b/plugins/org.eclipse.jst.j2ee.ejb/property_files/ejbcreation.properties index c959797..df81386 100644 --- a/plugins/org.eclipse.jst.j2ee.ejb/property_files/ejbcreation.properties +++ b/plugins/org.eclipse.jst.j2ee.ejb/property_files/ejbcreation.properties
@@ -151,3 +151,6 @@ WRN_NO_CLIENT_VIEW=No client view configured. Clients will not be able to access this bean. ERR_SINGLETON_NOT_ALLOWED=The 'Singleton' state type is allowed only for EJB projects with version 3.1 or later. ERR_NO_INTERFACE_NOT_ALLOWED=The no-interface client view is allowed only for EJB projects with version 3.1 or later. + +timerScheduleDefault= second="*/10", minute="*", hour="8-23", dayOfWeek="Mon-Fri",\n dayOfMonth="*", month="*", year="*", info="MyTimer" +errorTimerScheduleMissing=The schedule cannot be empty.
diff --git a/plugins/org.eclipse.jst.j2ee.ejb/templates/ejbtimer.javajet b/plugins/org.eclipse.jst.j2ee.ejb/templates/ejbtimer.javajet new file mode 100644 index 0000000..83429b7 --- /dev/null +++ b/plugins/org.eclipse.jst.j2ee.ejb/templates/ejbtimer.javajet
@@ -0,0 +1,22 @@ +<%@ jet package="org.eclipse.jst.j2ee.ejb.internal.operations" + imports="java.util.* org.eclipse.jst.j2ee.internal.common.operations.*" + class="EjbTimerTemplate" + skeleton="generator.skeleton" +%> +<% AddEjbTimerTemplateModel model = (AddEjbTimerTemplateModel) argument; %> +<%@ include file="_flags.template" %> +<%@ include file="_package.template" %> +<%@ include file="_imports.template" %> +@Stateless +<%@ include file="_class.template" %> +<%@ include file="_constructors.template" %> +<%@ include file="_methods.template" %> + <% + String schedule = model.getProperty(AddEjbTimerDataModelProvider.SCHEDULE).trim(); + %> + @SuppressWarnings("unused") + @Schedule(<%= schedule %>) + private void scheduledTimeout(final Timer t) { + System.out.println("@Schedule called at: " + new java.util.Date()); + } +} \ No newline at end of file