Bug 581077 Jakarta EE 10 EjbBeans with jakarta.-packagename Change-Id: Ic729c405101e37810d14e22caa8fd0aaa11c5b4e
diff --git a/plugins/org.eclipse.jst.ejb.ui/plugin.properties b/plugins/org.eclipse.jst.ejb.ui/plugin.properties index 5fc51e4..c1d25ca 100644 --- a/plugins/org.eclipse.jst.ejb.ui/plugin.properties +++ b/plugins/org.eclipse.jst.ejb.ui/plugin.properties
@@ -100,10 +100,10 @@ ejbAnnotationDecorator.description=Adds decorator(s) to the Enterprise Bean which are annotated. create.ejb.module_ui_=Create an EJB module -BeanEjbRegionWizard.name=Session Bean (EJB 3.x) -BeanWebRegionWizard.description=Create a new EJB 3.x Session Bean -MDBEjbRegionWizard.name=Message-Driven Bean (EJB 3.x) -MDBEjbRegionWizard.description=Create a new EJB 3.x Message-Driven Bean +BeanEjbRegionWizard.name=Session Bean (EJB 3.x/4.x) +BeanWebRegionWizard.description=Create a new EJB 3.x/4.x Session Bean +MDBEjbRegionWizard.name=Message-Driven Bean (EJB 3.x/4.x) +MDBEjbRegionWizard.description=Create a new EJB 3.x/4.x Message-Driven Bean EJBTIMER.ejbtimerlabel=EJB Timer
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 index 2e9245a..5e50497 100644 --- 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
@@ -40,9 +40,9 @@ public Collection<String> getImports() { Collection<String> collection = super.getImports(); - collection.add(QUALIFIED_SCHEDULE); - collection.add(QUALIFIED_STATELESS); - collection.add(QUALIFIED_TIMER); + collection.add(convertToJakartaPackage(QUALIFIED_SCHEDULE)); + collection.add(convertToJakartaPackage(QUALIFIED_STATELESS)); + collection.add(convertToJakartaPackage(QUALIFIED_TIMER)); return collection; }
diff --git a/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/CreateEnterpriseBeanTemplateModel.java b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/CreateEnterpriseBeanTemplateModel.java index b03ffa2..46c8129 100644 --- a/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/CreateEnterpriseBeanTemplateModel.java +++ b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/CreateEnterpriseBeanTemplateModel.java
@@ -11,6 +11,7 @@ package org.eclipse.jst.j2ee.ejb.internal.operations; import static org.eclipse.jst.j2ee.ejb.internal.operations.INewEnterpriseBeanClassDataModelProperties.TRANSACTION_TYPE; +import static org.eclipse.jst.j2ee.ejb.internal.operations.INewEnterpriseBeanClassDataModelProperties.USE_JAKARTA_PACKAGENAME; import org.eclipse.jst.j2ee.internal.common.operations.CreateJavaEEArtifactTemplateModel; import org.eclipse.wst.common.frameworks.datamodel.IDataModel; @@ -18,6 +19,10 @@ public class CreateEnterpriseBeanTemplateModel extends CreateJavaEEArtifactTemplateModel { + private static final String JAKARTA = "jakarta"; //$NON-NLS-1$ + + protected static final String JAVAX = "javax"; //$NON-NLS-1$ + protected static final String ATT_MAPPED_NAME = "mappedName"; //$NON-NLS-1$ protected static final String QUOTATION_STRING = "\""; //$NON-NLS-1$ @@ -35,4 +40,11 @@ else throw new IllegalStateException("illegal transaction type: " + transactionType); //$NON-NLS-1$ } + + public String convertToJakartaPackage(String qualifiedName) { + if (dataModel.getBooleanProperty(USE_JAKARTA_PACKAGENAME)) { + return qualifiedName.replace(CreateEnterpriseBeanTemplateModel.JAVAX, CreateEnterpriseBeanTemplateModel.JAKARTA); + } + return qualifiedName; + } }
diff --git a/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/CreateMessageDrivenBeanTemplateModel.java b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/CreateMessageDrivenBeanTemplateModel.java index ebe5db2..173c753 100644 --- a/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/CreateMessageDrivenBeanTemplateModel.java +++ b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/CreateMessageDrivenBeanTemplateModel.java
@@ -51,18 +51,18 @@ public Collection<String> getImports() { Collection<String> collection = super.getImports(); - collection.add(QUALIFIED_MESSAGE_DRIVEN); + collection.add(convertToJakartaPackage(QUALIFIED_MESSAGE_DRIVEN)); if (isJMS()){ - collection.add(QUALIFIED_ACTIVATION_CONFIG_PROPERTY); - collection.add(NewMessageDrivenBeanClassDataModelProvider.QUALIFIED_JMS_MESSAGELISTENER); - collection.add(QUALIFIED_JSM_MESSAGE); + collection.add(convertToJakartaPackage(QUALIFIED_ACTIVATION_CONFIG_PROPERTY)); + collection.add(convertToJakartaPackage(NewMessageDrivenBeanClassDataModelProvider.QUALIFIED_JMS_MESSAGELISTENER)); + collection.add(convertToJakartaPackage(QUALIFIED_JSM_MESSAGE)); } if (!isContainerType()) { - collection.add(QUALIFIED_TRANSACTION_MANAGEMENT); - collection.add(QUALIFIED_TRANSACTION_MANAGEMENT_TYPE); + collection.add(convertToJakartaPackage(QUALIFIED_TRANSACTION_MANAGEMENT)); + collection.add(convertToJakartaPackage(QUALIFIED_TRANSACTION_MANAGEMENT_TYPE)); } - collection.add(dataModel.getStringProperty(MESSAGE_LISTENER_INTERFACE)); + collection.add(convertToJakartaPackage(dataModel.getStringProperty(MESSAGE_LISTENER_INTERFACE))); return collection; } @@ -75,9 +75,9 @@ if (isJMS()){ String destinationType = dataModel.getStringProperty(DESTINATION_TYPE); if (destinationType.equals(DestinationType.QUEUE.toString())) - activationConfigProperties.put(PROP_DESTINATION_TYPE, "javax.jms.Queue"); //$NON-NLS-1$ + activationConfigProperties.put(PROP_DESTINATION_TYPE, convertToJakartaPackage("javax.jms.Queue")); //$NON-NLS-1$ else if (destinationType.equals(DestinationType.TOPIC.toString())) - activationConfigProperties.put(PROP_DESTINATION_TYPE, "javax.jms.Topic"); //$NON-NLS-1$ + activationConfigProperties.put(PROP_DESTINATION_TYPE, convertToJakartaPackage("javax.jms.Topic")); //$NON-NLS-1$ else throw new IllegalStateException("illegal destination type: " + destinationType); //$NON-NLS-1$ } @@ -113,7 +113,7 @@ while (iterator.hasNext()) { Method method = iterator.next(); - if (ON_MESSAGE.equals(method.getName()) && ON_MESSAGE_SIGNATURE.equals(method.getSignature())) { + if (ON_MESSAGE.equals(method.getName()) && convertToJakartaPackage(ON_MESSAGE_SIGNATURE).equals(method.getSignature())) { iterator.remove(); } }
diff --git a/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/CreateSessionBeanTemplateModel.java b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/CreateSessionBeanTemplateModel.java index f286139..bd5f535 100644 --- a/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/CreateSessionBeanTemplateModel.java +++ b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/CreateSessionBeanTemplateModel.java
@@ -64,54 +64,54 @@ String stateType = dataModel.getStringProperty(STATE_TYPE); if (stateType.equals(StateType.STATELESS.toString())) { - collection.add(QUALIFIED_STATELESS); + collection.add(convertToJakartaPackage(QUALIFIED_STATELESS)); } else if (stateType.equals(StateType.STATEFUL.toString())) { - collection.add(QUALIFIED_STATEFUL); + collection.add(convertToJakartaPackage(QUALIFIED_STATEFUL)); } else if (stateType.equals(StateType.SINGLETON.toString())) { - collection.add(QUALIFIED_SINGLETON); + collection.add(convertToJakartaPackage(QUALIFIED_SINGLETON)); } else { throw new IllegalStateException("illegal state type: " + stateType); //$NON-NLS-1$ } if (!isContainerType()) { - collection.add(QUALIFIED_TRANSACTION_MANAGEMENT); - collection.add(QUALIFIED_TRANSACTION_MANAGEMENT_TYPE); + collection.add(convertToJakartaPackage(QUALIFIED_TRANSACTION_MANAGEMENT)); + collection.add(convertToJakartaPackage(QUALIFIED_TRANSACTION_MANAGEMENT_TYPE)); } if (isRemoteHomeChecked()) { - collection.add(QUALIFIED_REMOTE_HOME); + collection.add(convertToJakartaPackage(QUALIFIED_REMOTE_HOME)); collection.add(remoteHomeClassName); } if (isLocalHomeChecked()) { - collection.add(QUALIFIED_LOCAL_HOME); + collection.add(convertToJakartaPackage(QUALIFIED_LOCAL_HOME)); collection.add(localHomeClassName); } if (isNoInterfaceChecked()) { - collection.add(QUALIFIED_LOCAL_BEAN); + collection.add(convertToJakartaPackage(QUALIFIED_LOCAL_BEAN)); } if (isAsynchronous()) { - collection.add(QUALIFIED_ASYNCHRONOUS); + collection.add(convertToJakartaPackage(QUALIFIED_ASYNCHRONOUS)); } List<BusinessInterface> interfaces = getBusinessInterfaces(); if (addBusinessAnnotationToBeanClass()){ for (BusinessInterface iface : interfaces) { if (iface.isLocal()) { - collection.add(QUALIFIED_LOCAL); + collection.add(convertToJakartaPackage(QUALIFIED_LOCAL)); } else if (iface.isRemote()) { - collection.add(QUALIFIED_REMOTE); + collection.add(convertToJakartaPackage(QUALIFIED_REMOTE)); } } } else { for (BusinessInterface iface : interfaces) { if (iface.isLocal() && iface.exists()) { - collection.add(QUALIFIED_LOCAL); + collection.add(convertToJakartaPackage(QUALIFIED_LOCAL)); } else if (iface.isRemote() && iface.exists()) { - collection.add(QUALIFIED_REMOTE); + collection.add(convertToJakartaPackage(QUALIFIED_REMOTE)); } } }
diff --git a/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/INewEnterpriseBeanClassDataModelProperties.java b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/INewEnterpriseBeanClassDataModelProperties.java index 9ec9386..0001afd 100644 --- a/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/INewEnterpriseBeanClassDataModelProperties.java +++ b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/INewEnterpriseBeanClassDataModelProperties.java
@@ -34,5 +34,12 @@ * @see TransactionType */ public static final String TRANSACTION_TYPE = "INewEnterpriseBeanClassDataModelProperties.TRANSACTION_TYPE"; //$NON-NLS-1$ - + + /** + * Optional, boolean property used to specify whether to generate jakarta vs. javax packagenames. + * The default is true for EJB 4.0 or JEE10 projects, otherwise - + * false. + */ + public static final String USE_JAKARTA_PACKAGENAME = "INewEnterpriseBeanClassDataModelProperties.USE_JAKARTA_PACKAGENAME"; //$NON-NLS-1$ + }
diff --git a/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/LocalBusinessInterfaceTemplate.java b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/LocalBusinessInterfaceTemplate.java index 0e36565..8ef1107 100644 --- a/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/LocalBusinessInterfaceTemplate.java +++ b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/LocalBusinessInterfaceTemplate.java
@@ -46,7 +46,7 @@ if (model.addBusinessAnnotationToInterface()) { - stringBuffer.append(TEXT_4); + stringBuffer.append(model.convertToJakartaPackage(TEXT_4)); }
diff --git a/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/LocalComponentInterfaceTemplate.java b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/LocalComponentInterfaceTemplate.java index 35dd8f8..607e900 100644 --- a/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/LocalComponentInterfaceTemplate.java +++ b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/LocalComponentInterfaceTemplate.java
@@ -40,7 +40,7 @@ } - stringBuffer.append(TEXT_3); + stringBuffer.append(model.convertToJakartaPackage(TEXT_3)); stringBuffer.append( model.getLocalComponentClassSimpleName() ); stringBuffer.append(TEXT_4); stringBuffer.append(TEXT_5);
diff --git a/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/LocalHomeInterfaceTemplate.java b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/LocalHomeInterfaceTemplate.java index ea95fe5..2f040e1 100644 --- a/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/LocalHomeInterfaceTemplate.java +++ b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/LocalHomeInterfaceTemplate.java
@@ -45,7 +45,7 @@ } - stringBuffer.append(TEXT_3); + stringBuffer.append(model.convertToJakartaPackage(TEXT_3)); if(!model.getLocalComponentPackage().equals(model.getLocalHomePackage())){ stringBuffer.append(TEXT_4); stringBuffer.append( model.getLocalComponentPackage());
diff --git a/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/NewEnterpriseBeanClassDataModelProvider.java b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/NewEnterpriseBeanClassDataModelProvider.java index c593922..6af161b 100644 --- a/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/NewEnterpriseBeanClassDataModelProvider.java +++ b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/NewEnterpriseBeanClassDataModelProvider.java
@@ -14,6 +14,7 @@ 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 static org.eclipse.jst.j2ee.ejb.internal.operations.INewEnterpriseBeanClassDataModelProperties.TRANSACTION_TYPE; +import static org.eclipse.jst.j2ee.ejb.internal.operations.INewEnterpriseBeanClassDataModelProperties.USE_JAKARTA_PACKAGENAME; import static org.eclipse.jst.j2ee.internal.common.operations.INewJavaClassDataModelProperties.CLASS_NAME; import static org.eclipse.jst.j2ee.internal.common.operations.INewJavaClassDataModelProperties.JAVA_PACKAGE; import static org.eclipse.jst.j2ee.internal.common.operations.INewJavaClassDataModelProperties.SUPERCLASS; @@ -59,6 +60,7 @@ propertyNames.add(EJB_NAME); propertyNames.add(MAPPED_NAME); propertyNames.add(TRANSACTION_TYPE); + propertyNames.add(USE_JAKARTA_PACKAGENAME); return propertyNames; } @@ -85,7 +87,9 @@ return ""; //$NON-NLS-1$ } else if (propertyName.equals(TRANSACTION_TYPE)) { return TransactionType.CONTAINER.toString(); - } + } else if (propertyName.equals(USE_JAKARTA_PACKAGENAME)) { + return Boolean.valueOf(ejb4xOrLater()); + } // Otherwise check super for default value for property return super.getDefaultProperty(propertyName); @@ -188,6 +192,7 @@ // constant array used for version tolerance: EJB version, Web version, Web Fragment version private static final int EJB31_VERSIONS[] = {J2EEVersionConstants.VERSION_3_1, J2EEVersionConstants.VERSION_3_0, J2EEVersionConstants.VERSION_3_0}; private static final int EJB32_VERSIONS[] = {J2EEVersionConstants.VERSION_3_2, J2EEVersionConstants.VERSION_3_1, J2EEVersionConstants.VERSION_3_1}; + private static final int EJB40_VERSIONS[] = {J2EEVersionConstants.VERSION_4_0, J2EEVersionConstants.VERSION_5_0, J2EEVersionConstants.VERSION_5_0}; protected boolean ejb3xOrLater(int ejbVersion) { boolean retVal = false; @@ -232,4 +237,40 @@ return retVal; } + + protected boolean ejb4xOrLater() { + boolean retVal = false; + IProject project = getTargetProject(); + // default to EJB 31 + int ejbVersions[] = EJB40_VERSIONS; + IProjectFacetVersion facetVersion = null; + int versionToCheck = -1; + + + if (project != null) + { + if (JavaEEProjectUtilities.isEJBProject(project)) + { + facetVersion = JavaEEProjectUtilities.getProjectFacetVersion(project, IJ2EEFacetConstants.EJB); + versionToCheck = ejbVersions[0]; + } + else if (JavaEEProjectUtilities.isDynamicWebProject(project)) + { + facetVersion = JavaEEProjectUtilities.getProjectFacetVersion(project, IJ2EEFacetConstants.DYNAMIC_WEB); + versionToCheck = ejbVersions[1]; + } + else if (JavaEEProjectUtilities.isWebFragmentProject(project)) + { + facetVersion = JavaEEProjectUtilities.getProjectFacetVersion(project, IJ2EEFacetConstants.WEBFRAGMENT); + versionToCheck = ejbVersions[2]; + } + if (facetVersion != null) + { + int version = J2EEVersionUtil.convertVersionStringToInt(facetVersion.getVersionString()); + retVal = version >= versionToCheck; + } + } + return retVal; + } + }
diff --git a/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/NewMessageDrivenBeanClassDataModelProvider.java b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/NewMessageDrivenBeanClassDataModelProvider.java index e0f9d11..b559abe 100644 --- a/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/NewMessageDrivenBeanClassDataModelProvider.java +++ b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/NewMessageDrivenBeanClassDataModelProvider.java
@@ -33,6 +33,8 @@ public static final String QUALIFIED_JMS_MESSAGELISTENER = "javax.jms.MessageListener"; //$NON-NLS-1$ + public static final String QUALIFIED_JMS_MESSAGELISTENER_JAKARTA = "jakarta.jms.MessageListener"; //$NON-NLS-1$ + @Override public IDataModelOperation getDefaultOperation() { return new AddMessageDrivenBeanOperation(getDataModel()); @@ -71,7 +73,11 @@ public Object getDefaultProperty(String propertyName) { if (propertyName.equals(INTERFACES)){ List<String> list = new ArrayList<String>(); - list.add(QUALIFIED_JMS_MESSAGELISTENER); + if(ejb4xOrLater()) { + list.add(QUALIFIED_JMS_MESSAGELISTENER_JAKARTA); + }else { + list.add(QUALIFIED_JMS_MESSAGELISTENER); + } return list; } else if (propertyName.equals(SUPERCLASS)) { return ""; //$NON-NLS-1$
diff --git a/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/RemoteBusinessInterfaceTemplate.java b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/RemoteBusinessInterfaceTemplate.java index 21dae54..c055f5e 100644 --- a/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/RemoteBusinessInterfaceTemplate.java +++ b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/RemoteBusinessInterfaceTemplate.java
@@ -46,7 +46,7 @@ if (model.addBusinessAnnotationToInterface()) { - stringBuffer.append(TEXT_4); + stringBuffer.append(model.convertToJakartaPackage(TEXT_4)); }
diff --git a/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/RemoteComponentInterfaceTemplate.java b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/RemoteComponentInterfaceTemplate.java index 1b7064f..d53ea1a 100644 --- a/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/RemoteComponentInterfaceTemplate.java +++ b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/RemoteComponentInterfaceTemplate.java
@@ -40,7 +40,7 @@ } - stringBuffer.append(TEXT_3); + stringBuffer.append(model.convertToJakartaPackage(TEXT_3)); stringBuffer.append( model.getRemoteComponentClassSimpleName() ); stringBuffer.append(TEXT_4); stringBuffer.append(TEXT_5);
diff --git a/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/RemoteHomeInterfaceTemplate.java b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/RemoteHomeInterfaceTemplate.java index 801f6a9..8d50d6d 100644 --- a/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/RemoteHomeInterfaceTemplate.java +++ b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/RemoteHomeInterfaceTemplate.java
@@ -45,7 +45,7 @@ } - stringBuffer.append(TEXT_3); + stringBuffer.append(model.convertToJakartaPackage(TEXT_3)); if(!model.getRemoteComponentPackage().equals(model.getRemoteHomePackage())){ stringBuffer.append(TEXT_4); stringBuffer.append( model.getRemoteComponentPackage() );
diff --git a/plugins/org.eclipse.jst.jee.ejb/ejb/org/eclipse/jst/jee/model/internal/EjbAnnotationFactory.java b/plugins/org.eclipse.jst.jee.ejb/ejb/org/eclipse/jst/jee/model/internal/EjbAnnotationFactory.java index b99619b..f5e2177 100644 --- a/plugins/org.eclipse.jst.jee.ejb/ejb/org/eclipse/jst/jee/model/internal/EjbAnnotationFactory.java +++ b/plugins/org.eclipse.jst.jee.ejb/ejb/org/eclipse/jst/jee/model/internal/EjbAnnotationFactory.java
@@ -65,6 +65,7 @@ private static final String LOCAL_HOME = "LocalHome"; //$NON-NLS-1$ private static final String REMOTE_HOME = "RemoteHome"; //$NON-NLS-1$ private static final String JAVAX_EJB_TIMER = "javax.ejb.Timer"; //$NON-NLS-1$ + private static final String JAKARTA_EJB_TIMER = "jakarta.ejb.Timer"; //$NON-NLS-1$ private static final String TIMER = "Timer"; //$NON-NLS-1$ private static final String RETAIN_IF_EXCEPTION = "retainIfException"; //$NON-NLS-1$ private static final String REMOVE = "Remove"; //$NON-NLS-1$ @@ -82,11 +83,15 @@ private static final String NAME = "name"; //$NON-NLS-1$ private static final String VOID_RETURN_TYPE = "V"; //$NON-NLS-1$ private static final String JAVAX_EJB_STATEFUL = "javax.ejb.Stateful"; //$NON-NLS-1$ + private static final String JAKARTA_EJB_STATEFUL = "jakarta.ejb.Stateful"; //$NON-NLS-1$ private static final String JAVAX_EJB_SINGLETON = "javax.ejb.Singleton"; //$NON-NLS-1$ + private static final String JAKARTA_EJB_SINGLETON = "jakarta.ejb.Singleton"; //$NON-NLS-1$ private static final String STATEFUL = "Stateful"; //$NON-NLS-1$ private static final String JAVAX_EJB_MESSAGE_DRIVEN = "javax.ejb.MessageDriven"; //$NON-NLS-1$ + private static final String JAKARTA_EJB_MESSAGE_DRIVEN = "jakarta.ejb.MessageDriven"; //$NON-NLS-1$ private static final String MESSAGE_DRIVEN = "MessageDriven"; //$NON-NLS-1$ private static final String JAVAX_EJB_STATELESS = "javax.ejb.Stateless"; //$NON-NLS-1$ + private static final String JAKARTA_EJB_STATELESS = "jakarta.ejb.Stateless"; //$NON-NLS-1$ private static final String STATELESS = "Stateless"; //$NON-NLS-1$ private static final String SINGLETON = "Singleton"; //$NON-NLS-1$ @@ -115,16 +120,16 @@ Result result = new Result(); for (IAnnotation annotation : type.getAnnotations()) { String annotationName = annotation.getElementName(); - if (STATELESS.equals(annotationName) || JAVAX_EJB_STATELESS.equals(annotationName)) { + if (STATELESS.equals(annotationName) || JAVAX_EJB_STATELESS.equals(annotationName) || JAKARTA_EJB_STATELESS.equals(annotationName)) { processStatelessBean(result, annotation, type); break; - } else if (MESSAGE_DRIVEN.equals(annotationName) || JAVAX_EJB_MESSAGE_DRIVEN.equals(annotationName)) { + } else if (MESSAGE_DRIVEN.equals(annotationName) || JAVAX_EJB_MESSAGE_DRIVEN.equals(annotationName) || JAKARTA_EJB_MESSAGE_DRIVEN.equals(annotationName)) { processMessageDrivenBean(result, annotation, type); break; - } else if (STATEFUL.equals(annotationName) || JAVAX_EJB_STATEFUL.equals(annotationName)) { + } else if (STATEFUL.equals(annotationName) || JAVAX_EJB_STATEFUL.equals(annotationName) || JAKARTA_EJB_STATEFUL.equals(annotationName)) { processStatefulBean(result, annotation, type); break; - } else if (SINGLETON.equals(annotationName) || JAVAX_EJB_SINGLETON.equals(annotationName)) { + } else if (SINGLETON.equals(annotationName) || JAVAX_EJB_SINGLETON.equals(annotationName) || JAKARTA_EJB_SINGLETON.equals(annotationName)) { processSingletonBean(result, annotation, type); break; } @@ -557,7 +562,7 @@ if (method.getNumberOfParameters() != 1) return; String paramName = Signature.toString(method.getParameterTypes()[0]); - if (!TIMER.equals(paramName) && !JAVAX_EJB_TIMER.equals(paramName)) + if (!TIMER.equals(paramName) && !JAVAX_EJB_TIMER.equals(paramName) && !JAKARTA_EJB_TIMER.equals(paramName)) return; if (method.getExceptionTypes().length != 0) return;
diff --git a/plugins/org.eclipse.jst.jee.web/web/org/eclipse/jst/jee/model/internal/WebAnnotationFactory.java b/plugins/org.eclipse.jst.jee.web/web/org/eclipse/jst/jee/model/internal/WebAnnotationFactory.java index bd0ee75..f09b796 100644 --- a/plugins/org.eclipse.jst.jee.web/web/org/eclipse/jst/jee/model/internal/WebAnnotationFactory.java +++ b/plugins/org.eclipse.jst.jee.web/web/org/eclipse/jst/jee/model/internal/WebAnnotationFactory.java
@@ -62,12 +62,15 @@ private static final String WEB_SERVLET = "WebServlet"; //$NON-NLS-1$ private static final String WEB_SERVLET_FQ = "javax.servlet.annotation.WebServlet"; //$NON-NLS-1$ + private static final String WEB_SERVLET_FQ_JAKARTA = "jakarta.servlet.annotation.WebServlet"; //$NON-NLS-1$ private static final String WEB_LISTENER = "WebListener"; //$NON-NLS-1$ private static final String WEB_LISTENER_FQ = "javax.servlet.annotation.WebListener"; //$NON-NLS-1$ + private static final String WEB_LISTENER_FQ_JAKARTA = "jakarta.servlet.annotation.WebListener"; //$NON-NLS-1$ private static final String WEB_FILTER = "WebFilter"; //$NON-NLS-1$ private static final String WEB_FILTER_FQ = "javax.servlet.annotation.WebFilter"; //$NON-NLS-1$ + private static final String WEB_FILTER_FQ_JAKARTA = "jakarta.servlet.annotation.WebFilter"; //$NON-NLS-1$ @@ -129,7 +132,7 @@ String filterName = (String) getAnnotatedValue(FILTER_NAME, memberValuePairs); String descr = (String) getAnnotatedValue(DESCRIPTION, memberValuePairs); Boolean async = (Boolean) getAnnotatedValue(ASYNC_SUPPORTED, memberValuePairs); - if(WEB_SERVLET.equals(annotationName) || WEB_SERVLET_FQ.equals(annotationName)){ + if(WEB_SERVLET.equals(annotationName) || WEB_SERVLET_FQ.equals(annotationName) || WEB_SERVLET_FQ_JAKARTA.equals(annotationName)){ Servlet servlet = (Servlet)artifact; if (name != null) { servlet.setServletName(name); @@ -146,7 +149,7 @@ } processUrlMapping(result, annotation, servlet); - } else if(WEB_FILTER.equals(annotationName) || WEB_FILTER_FQ.equals(annotationName)){ + } else if(WEB_FILTER.equals(annotationName) || WEB_FILTER_FQ.equals(annotationName) || WEB_FILTER_FQ_JAKARTA.equals(annotationName)){ Filter filter = (Filter)artifact; if (filterName != null) { filter.setFilterName(filterName); @@ -163,7 +166,7 @@ } processUrlMapping(result, annotation, filter); - } else if(WEB_LISTENER.equals(annotationName) || WEB_LISTENER_FQ.equals(annotationName)){ + } else if(WEB_LISTENER.equals(annotationName) || WEB_LISTENER_FQ.equals(annotationName) || WEB_LISTENER_FQ_JAKARTA.equals(annotationName)){ Listener listener = (Listener)artifact; Description description = JavaeeFactory.eINSTANCE.createDescription(); if(listener.getListenerClass() == null){