[241667] Optional local business interfaces for EJB 3.1 beans
diff --git a/plugins/org.eclipse.jst.ejb.ui/ejb_ui/org/eclipse/jst/ejb/ui/internal/util/EJBUIMessages.java b/plugins/org.eclipse.jst.ejb.ui/ejb_ui/org/eclipse/jst/ejb/ui/internal/util/EJBUIMessages.java
index 0bff385..f073689 100644
--- a/plugins/org.eclipse.jst.ejb.ui/ejb_ui/org/eclipse/jst/ejb/ui/internal/util/EJBUIMessages.java
+++ b/plugins/org.eclipse.jst.ejb.ui/ejb_ui/org/eclipse/jst/ejb/ui/internal/util/EJBUIMessages.java
@@ -73,6 +73,7 @@
public static String LOCAL_BUSINESS_INTERFACE;
public static String LOCAL_BUSINESS_INTERFACE_LABEL;
public static String LOCAL_HOME_INTERFACE_LABEL;
+ public static String NO_INTERFACE;
public static String EJB_NAME;
public static String TRANSACTION_TYPE_CONTAINER;
public static String TRANSACTION_TYPE_BEAN;
diff --git a/plugins/org.eclipse.jst.ejb.ui/ejb_ui/org/eclipse/jst/ejb/ui/internal/wizard/IEjbWizardConstants.java b/plugins/org.eclipse.jst.ejb.ui/ejb_ui/org/eclipse/jst/ejb/ui/internal/wizard/IEjbWizardConstants.java
index 0dc7d39..07a8e73 100644
--- a/plugins/org.eclipse.jst.ejb.ui/ejb_ui/org/eclipse/jst/ejb/ui/internal/wizard/IEjbWizardConstants.java
+++ b/plugins/org.eclipse.jst.ejb.ui/ejb_ui/org/eclipse/jst/ejb/ui/internal/wizard/IEjbWizardConstants.java
@@ -27,6 +27,7 @@
public static final String REMOTE_BUSINESS_INTERFACE_LABEL = EJBUIMessages.REMOTE_BUSINESS_INTERFACE_LABEL;
public static final String LOCAL_BUSINESS_INTERFACE = EJBUIMessages.LOCAL_BUSINESS_INTERFACE;
public static final String LOCAL_BUSINESS_INTERFACE_LABEL = EJBUIMessages.LOCAL_BUSINESS_INTERFACE_LABEL;
+ public static final String NO_INTERFACE = EJBUIMessages.NO_INTERFACE;
public static final String EJB_NAME = EJBUIMessages.EJB_NAME;
public final static String TRANSACTION_TYPE_CONTAINER = EJBUIMessages.TRANSACTION_TYPE_CONTAINER;
diff --git a/plugins/org.eclipse.jst.ejb.ui/ejb_ui/org/eclipse/jst/ejb/ui/internal/wizard/NewSessionBeanClassWizardPage.java b/plugins/org.eclipse.jst.ejb.ui/ejb_ui/org/eclipse/jst/ejb/ui/internal/wizard/NewSessionBeanClassWizardPage.java
index bc40c6d..d5c0d3e 100644
--- a/plugins/org.eclipse.jst.ejb.ui/ejb_ui/org/eclipse/jst/ejb/ui/internal/wizard/NewSessionBeanClassWizardPage.java
+++ b/plugins/org.eclipse.jst.ejb.ui/ejb_ui/org/eclipse/jst/ejb/ui/internal/wizard/NewSessionBeanClassWizardPage.java
@@ -12,6 +12,7 @@
import static org.eclipse.jst.j2ee.ejb.internal.operations.INewSessionBeanClassDataModelProperties.LOCAL;
import static org.eclipse.jst.j2ee.ejb.internal.operations.INewSessionBeanClassDataModelProperties.LOCAL_BUSINESS_INTERFACE;
+import static org.eclipse.jst.j2ee.ejb.internal.operations.INewSessionBeanClassDataModelProperties.NO_INTERFACE;
import static org.eclipse.jst.j2ee.ejb.internal.operations.INewSessionBeanClassDataModelProperties.REMOTE;
import static org.eclipse.jst.j2ee.ejb.internal.operations.INewSessionBeanClassDataModelProperties.REMOTE_BUSINESS_INTERFACE;
import static org.eclipse.jst.j2ee.ejb.internal.operations.INewSessionBeanClassDataModelProperties.STATE_TYPE;
@@ -38,6 +39,7 @@
private Combo stateTypeCombo;
private Button remoteCheckbox;
private Button localCheckbox;
+ private Button noInterfaceCheckbox;
private Text remoteInterfaceName;
private Text localInterfaceName;
@@ -79,12 +81,9 @@
remoteCheckbox = new Button(group, SWT.CHECK);
remoteCheckbox.setLayoutData(gdhspan(1));
remoteCheckbox.setText(IEjbWizardConstants.REMOTE_BUSINESS_INTERFACE);
- GridData data2 = new GridData(GridData.FILL_HORIZONTAL);
- data2.horizontalSpan = 1;
- remoteInterfaceName = new Text(group, SWT.SINGLE | SWT.BORDER);
synchHelper.synchCheckbox(remoteCheckbox, REMOTE, null);
-
- remoteInterfaceName.setLayoutData(data2);
+ remoteInterfaceName = new Text(group, SWT.SINGLE | SWT.BORDER);
+ remoteInterfaceName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
synchHelper.synchText(remoteInterfaceName, REMOTE_BUSINESS_INTERFACE, null);
localCheckbox = new Button(group, SWT.CHECK);
@@ -92,8 +91,13 @@
localCheckbox.setText(IEjbWizardConstants.LOCAL_BUSINESS_INTERFACE);
synchHelper.synchCheckbox(localCheckbox, LOCAL, null);
localInterfaceName = new Text(group, SWT.SINGLE | SWT.BORDER);
- localInterfaceName.setLayoutData(data2);
+ localInterfaceName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
synchHelper.synchText(localInterfaceName, LOCAL_BUSINESS_INTERFACE, null);
+
+ noInterfaceCheckbox = new Button(group, SWT.CHECK);
+ noInterfaceCheckbox.setLayoutData(gdhspan(2));
+ noInterfaceCheckbox.setText(IEjbWizardConstants.NO_INTERFACE);
+ synchHelper.synchCheckbox(noInterfaceCheckbox, NO_INTERFACE, null);
}
private static GridData gdhspan(int span) {
@@ -111,6 +115,7 @@
names.add(INTERFACES);
names.add(LOCAL_BUSINESS_INTERFACE);
names.add(REMOTE_BUSINESS_INTERFACE);
+ names.add(NO_INTERFACE);
return names.toArray(new String[0]);
}
diff --git a/plugins/org.eclipse.jst.ejb.ui/property_files/ejb_ui.properties b/plugins/org.eclipse.jst.ejb.ui/property_files/ejb_ui.properties
index 692328a..6ca7ffc 100644
--- a/plugins/org.eclipse.jst.ejb.ui/property_files/ejb_ui.properties
+++ b/plugins/org.eclipse.jst.ejb.ui/property_files/ejb_ui.properties
@@ -58,6 +58,7 @@
REMOTE_HOME_INTERFACE_LABEL=Remote Home Interface:
LOCAL_BUSINESS_INTERFACE=&Local
LOCAL_BUSINESS_INTERFACE_LABEL=Local Business Interface:
+NO_INTERFACE=No-&interface
LOCAL_HOME_INTERFACE_LABEL=Local Home Interface:
LOCAL_COMPONENT_INTERFACE_CODE=L
LOCAL_HOME_INTERFACE_CODE=LH
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 e5973bb..0cbf234 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
@@ -14,7 +14,7 @@
import static org.eclipse.jst.j2ee.ejb.internal.operations.INewEnterpriseBeanClassDataModelProperties.MAPPED_NAME;
import static org.eclipse.jst.j2ee.internal.common.operations.INewJavaClassDataModelProperties.INTERFACES;
import static org.eclipse.jst.j2ee.ejb.internal.operations.INewSessionBeanClassDataModelProperties.LOCAL_HOME;
-import static org.eclipse.jst.j2ee.ejb.internal.operations.INewSessionBeanClassDataModelProperties.REMOTE_HOME;
+import static org.eclipse.jst.j2ee.ejb.internal.operations.INewSessionBeanClassDataModelProperties.*;
import static org.eclipse.jst.j2ee.ejb.internal.operations.INewSessionBeanClassDataModelProperties.STATE_TYPE;
import java.util.ArrayList;
@@ -32,6 +32,7 @@
public static final String QUALIFIED_STATELESS = "javax.ejb.Stateless"; //$NON-NLS-1$
public static final String QUALIFIED_STATEFUL = "javax.ejb.Stateful"; //$NON-NLS-1$
public static final String QUALIFIED_SINGLETON = "javax.ejb.Singleton"; //$NON-NLS-1$
+ public static final String QUALIFIED_LOCAL_BEAN = "javax.ejb.LocalBean"; //$NON-NLS-1$
public static final String QUALIFIED_LOCAL = "javax.ejb.Local"; //$NON-NLS-1$
public static final String QUALIFIED_REMOTE = "javax.ejb.Remote"; //$NON-NLS-1$
public static final String QUALIFIED_REMOTE_HOME = "javax.ejb.RemoteHome"; //$NON-NLS-1$
@@ -83,6 +84,10 @@
collection.add(localHomeClassName);
}
+ if (isNoInterfaceChecked()) {
+ collection.add(QUALIFIED_LOCAL_BEAN);
+ }
+
List<BusinessInterface> interfaces = getBusinessInterfaces();
for (BusinessInterface iface : interfaces) {
if (iface.isLocal() && iface.exists()) {
@@ -160,6 +165,10 @@
public boolean isRemoteHomeChecked() {
return dataModel.getBooleanProperty(REMOTE_HOME);
}
+
+ public boolean isNoInterfaceChecked() {
+ return dataModel.getBooleanProperty(NO_INTERFACE);
+ }
public Map<String, String> getClassAnnotationParams() {
Map<String, String> result = new Hashtable<String, String>();
diff --git a/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/INewSessionBeanClassDataModelProperties.java b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/INewSessionBeanClassDataModelProperties.java
index e1aaa4f..c0fa887 100644
--- a/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/INewSessionBeanClassDataModelProperties.java
+++ b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/INewSessionBeanClassDataModelProperties.java
@@ -29,12 +29,22 @@
* business interface. The default is false.
*/
public static final String REMOTE = "INewSessionBeanClassDataModelProperties.REMOTE"; //$NON-NLS-1$
-
+
/**
* Optional, boolean property used to specify whether to generate a local
- * business interface. The default is true.
+ * business interface. The default is true for EJB 3.0 projects, otherwise -
+ * false.
*/
public static final String LOCAL = "INewSessionBeanClassDataModelProperties.LOCAL"; //$NON-NLS-1$
+
+ /**
+ * Optional, boolean property used to specify whether to generate a
+ * no-interface client view. The default is true for EJB 3.1 projects and
+ * later, otherwise - false.
+ *
+ * @since 3.2
+ */
+ public static final String NO_INTERFACE = "INewSessionBeanClassDataModelProperties.NO_INTERFACE"; //$NON-NLS-1$
/**
* Optional, boolean property used to specify whether to generate a EJB 2.x
diff --git a/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/NewSessionBeanClassDataModelProvider.java b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/NewSessionBeanClassDataModelProvider.java
index d52308e..4d2a65b 100644
--- a/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/NewSessionBeanClassDataModelProvider.java
+++ b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/NewSessionBeanClassDataModelProvider.java
@@ -15,6 +15,7 @@
import static org.eclipse.jst.j2ee.ejb.internal.operations.INewSessionBeanClassDataModelProperties.LOCAL_COMPONENT_INTERFACE;
import static org.eclipse.jst.j2ee.ejb.internal.operations.INewSessionBeanClassDataModelProperties.LOCAL_HOME;
import static org.eclipse.jst.j2ee.ejb.internal.operations.INewSessionBeanClassDataModelProperties.LOCAL_HOME_INTERFACE;
+import static org.eclipse.jst.j2ee.ejb.internal.operations.INewSessionBeanClassDataModelProperties.NO_INTERFACE;
import static org.eclipse.jst.j2ee.ejb.internal.operations.INewSessionBeanClassDataModelProperties.REMOTE;
import static org.eclipse.jst.j2ee.ejb.internal.operations.INewSessionBeanClassDataModelProperties.REMOTE_BUSINESS_INTERFACE;
import static org.eclipse.jst.j2ee.ejb.internal.operations.INewSessionBeanClassDataModelProperties.REMOTE_COMPONENT_INTERFACE;
@@ -32,7 +33,6 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.core.IJavaProject;
@@ -57,7 +57,6 @@
import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider;
import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonPlugin;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
public class NewSessionBeanClassDataModelProvider extends NewEnterpriseBeanClassDataModelProvider {
@@ -89,6 +88,7 @@
propertyNames.add(LOCAL_BUSINESS_INTERFACE);
propertyNames.add(REMOTE);
propertyNames.add(LOCAL);
+ propertyNames.add(NO_INTERFACE);
propertyNames.add(STATE_TYPE);
propertyNames.add(REMOTE_HOME);
propertyNames.add(LOCAL_HOME);
@@ -120,17 +120,19 @@
else if (propertyName.equals(REMOTE))
return Boolean.FALSE;
else if (propertyName.equals(LOCAL))
- return Boolean.TRUE;
+ return new Boolean(!ejb31OrLater());
+ else if (propertyName.equals(NO_INTERFACE))
+ return new Boolean(ejb31OrLater());
else if (propertyName.equals(STATE_TYPE))
return StateType.STATELESS.toString();
else if (propertyName.equals(INTERFACES)) {
List<BusinessInterface> listResult = new ArrayList<BusinessInterface>();
String className = getStringProperty(QUALIFIED_CLASS_NAME);
- if ((Boolean) getProperty(REMOTE) && className.length() > 0) {
+ if (getBooleanProperty(REMOTE) && className.length() > 0) {
BusinessInterface remoteInterface = new BusinessInterface(getStringProperty(REMOTE_BUSINESS_INTERFACE), BusinessInterfaceType.REMOTE);
listResult.add(remoteInterface);
}
- if ((Boolean) getProperty(LOCAL) && className.length() > 0) {
+ if (getBooleanProperty(LOCAL) && className.length() > 0) {
BusinessInterface localInterface = new BusinessInterface(getStringProperty(LOCAL_BUSINESS_INTERFACE), BusinessInterfaceType.LOCAL);
listResult.add(localInterface);
}
@@ -188,37 +190,14 @@
// Call super to set the property on the data model
boolean result = super.propertySet(propertyName, propertyValue);
- if (propertyName.equals(REMOTE)) {
- if (!getDataModel().isPropertySet(INTERFACES)) {
- getDataModel().notifyPropertyChange(INTERFACES, IDataModel.DEFAULT_CHG);
- } else {
- updateBusinessInterfaces(REMOTE);
- }
- getDataModel().notifyPropertyChange(REMOTE_BUSINESS_INTERFACE, IDataModel.ENABLE_CHG);
-
- }
- if (propertyName.equals(LOCAL)) {
- if (!getDataModel().isPropertySet(INTERFACES)) {
- getDataModel().notifyPropertyChange(INTERFACES, IDataModel.DEFAULT_CHG);
- } else {
- updateBusinessInterfaces(LOCAL);
- }
- getDataModel().notifyPropertyChange(LOCAL_BUSINESS_INTERFACE, IDataModel.ENABLE_CHG);
- }
- if (REMOTE_BUSINESS_INTERFACE.equals(propertyName))
- {
- if(getRemoteProperty() != null){
- getRemoteProperty().setFullyQualifiedName(propertyValue.toString());
- }
- }
- else if (LOCAL_BUSINESS_INTERFACE.equals(propertyName))
- {
- if(getLocalProperty() != null){
- getLocalProperty().setFullyQualifiedName(propertyValue.toString());
- }
- }
- else if (CLASS_NAME.equals(propertyName) || JAVA_PACKAGE.equals(propertyName))
- {
+ if (PROJECT_NAME.equals(propertyName)) {
+ IDataModel dataModel = getDataModel();
+ dataModel.notifyPropertyChange(REMOTE, IDataModel.DEFAULT_CHG);
+ dataModel.notifyPropertyChange(LOCAL, IDataModel.DEFAULT_CHG);
+ dataModel.notifyPropertyChange(NO_INTERFACE, IDataModel.DEFAULT_CHG);
+ dataModel.notifyPropertyChange(REMOTE_BUSINESS_INTERFACE, IDataModel.DEFAULT_CHG);
+ dataModel.notifyPropertyChange(LOCAL_BUSINESS_INTERFACE, IDataModel.DEFAULT_CHG);
+ } else if (CLASS_NAME.equals(propertyName) || JAVA_PACKAGE.equals(propertyName)) {
IDataModel dataModel = getDataModel();
dataModel.notifyPropertyChange(REMOTE_BUSINESS_INTERFACE, IDataModel.DEFAULT_CHG);
dataModel.notifyPropertyChange(LOCAL_BUSINESS_INTERFACE, IDataModel.DEFAULT_CHG);
@@ -226,7 +205,30 @@
dataModel.notifyPropertyChange(LOCAL_HOME_INTERFACE, IDataModel.DEFAULT_CHG);
dataModel.notifyPropertyChange(REMOTE_COMPONENT_INTERFACE, IDataModel.DEFAULT_CHG);
dataModel.notifyPropertyChange(LOCAL_COMPONENT_INTERFACE, IDataModel.DEFAULT_CHG);
- }
+ } else if (propertyName.equals(REMOTE)) {
+ if (!getDataModel().isPropertySet(INTERFACES)) {
+ getDataModel().notifyPropertyChange(INTERFACES, IDataModel.DEFAULT_CHG);
+ } else {
+ updateBusinessInterfaces(REMOTE);
+ }
+ getDataModel().notifyPropertyChange(REMOTE_BUSINESS_INTERFACE, IDataModel.ENABLE_CHG);
+
+ } else if (propertyName.equals(LOCAL)) {
+ if (!getDataModel().isPropertySet(INTERFACES)) {
+ getDataModel().notifyPropertyChange(INTERFACES, IDataModel.DEFAULT_CHG);
+ } else {
+ updateBusinessInterfaces(LOCAL);
+ }
+ getDataModel().notifyPropertyChange(LOCAL_BUSINESS_INTERFACE, IDataModel.ENABLE_CHG);
+ } else if (REMOTE_BUSINESS_INTERFACE.equals(propertyName)) {
+ if(getRemoteProperty() != null){
+ getRemoteProperty().setFullyQualifiedName(propertyValue.toString());
+ }
+ } else if (LOCAL_BUSINESS_INTERFACE.equals(propertyName)) {
+ if(getLocalProperty() != null){
+ getLocalProperty().setFullyQualifiedName(propertyValue.toString());
+ }
+ }
return result;
}
@@ -262,14 +264,6 @@
return super.getValidPropertyDescriptors(propertyName);
}
- private boolean ejb31OrLater() {
- IProject project = getTargetProject();
- IProjectFacetVersion facetVersion = JavaEEProjectUtilities.getProjectFacetVersion(project, IJ2EEFacetConstants.EJB);
- int version = J2EEVersionUtil.convertVersionStringToInt(facetVersion.getVersionString());
- int ejb31version = J2EEVersionUtil.convertVersionStringToInt(IJ2EEFacetConstants.EJB_31.getVersionString());
- return version >= ejb31version;
- }
-
private void updateBusinessInterfaces(String propertyName) {
List<BusinessInterface> list = (List<BusinessInterface>) getProperty(INTERFACES);
if (propertyName.equals(REMOTE)) {
@@ -314,6 +308,10 @@
public IStatus validate(String propertyName) {
if (STATE_TYPE.equals(propertyName)) {
return validateStateType();
+ } else if (NO_INTERFACE.equals(propertyName)) {
+ if (getBooleanProperty(NO_INTERFACE)) {
+ return validateNoInterface();
+ }
} else if (LOCAL_BUSINESS_INTERFACE.equals(propertyName)) {
if (getBooleanProperty(LOCAL)) {
return validateEjbInterface(getStringProperty(propertyName));
@@ -337,7 +335,14 @@
protected IStatus validateStateType() {
String value = getStringProperty(STATE_TYPE);
if (StateType.SINGLETON.toString().equals(value) && !ejb31OrLater()) {
- return WTPCommonPlugin.createErrorStatus(EJBCreationResourceHandler.ERR_SINGLETON_ALLOWED_ONLY_FOR_31_AND_LATER);
+ return WTPCommonPlugin.createErrorStatus(EJBCreationResourceHandler.ERR_SINGLETON_NOT_ALLOWED);
+ }
+ return Status.OK_STATUS;
+ }
+
+ protected IStatus validateNoInterface() {
+ if (!ejb31OrLater()) {
+ return WTPCommonPlugin.createErrorStatus(EJBCreationResourceHandler.ERR_NO_INTERFACE_NOT_ALLOWED);
}
return Status.OK_STATUS;
}
@@ -448,8 +453,8 @@
protected IStatus validateInterfacesList() {
List<BusinessInterface> list = (List<BusinessInterface>) getProperty(INTERFACES);
- if (list.isEmpty() && isEJB30Project()) {
- return new Status(IStatus.WARNING, EjbPlugin.PLUGIN_ID, EJBCreationResourceHandler.WRN_NO_BUSINESS_INTERFACE);
+ if (list.isEmpty() && !ejb31OrLater()) {
+ return new Status(IStatus.WARNING, EjbPlugin.PLUGIN_ID, EJBCreationResourceHandler.WRN_NO_CLIENT_VIEW);
}
return Status.OK_STATUS;
}
@@ -493,13 +498,13 @@
}
return WTPCommonPlugin.OK_STATUS;
}
-
- private boolean isEJB30Project() {
- try {
- return ProjectFacetsManager.create(getTargetProject()).hasProjectFacet(IJ2EEFacetConstants.EJB_30);
- } catch (CoreException e) {
- return false;
- }
- }
+ private boolean ejb31OrLater() {
+ IProject project = getTargetProject();
+ IProjectFacetVersion facetVersion = JavaEEProjectUtilities.getProjectFacetVersion(project, IJ2EEFacetConstants.EJB);
+ int version = J2EEVersionUtil.convertVersionStringToInt(facetVersion.getVersionString());
+ int ejb31version = J2EEVersionUtil.convertVersionStringToInt(IJ2EEFacetConstants.EJB_31.getVersionString());
+ return version >= ejb31version;
+ }
+
}
diff --git a/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/SessionBeanTemplate.java b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/SessionBeanTemplate.java
index 3a45dd1..22ab654 100644
--- a/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/SessionBeanTemplate.java
+++ b/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/SessionBeanTemplate.java
@@ -39,39 +39,40 @@
protected final String TEXT_22 = ", "; //$NON-NLS-1$
protected final String TEXT_23 = ".class"; //$NON-NLS-1$
protected final String TEXT_24 = " })"; //$NON-NLS-1$
- protected final String TEXT_25 = NL + "@LocalHome("; //$NON-NLS-1$
- protected final String TEXT_26 = ".class)"; //$NON-NLS-1$
- protected final String TEXT_27 = NL + "@RemoteHome("; //$NON-NLS-1$
- protected final String TEXT_28 = ".class)"; //$NON-NLS-1$
- protected final String TEXT_29 = NL + "public "; //$NON-NLS-1$
- protected final String TEXT_30 = "abstract "; //$NON-NLS-1$
- protected final String TEXT_31 = "final "; //$NON-NLS-1$
- protected final String TEXT_32 = "class "; //$NON-NLS-1$
- protected final String TEXT_33 = " extends "; //$NON-NLS-1$
- protected final String TEXT_34 = " implements "; //$NON-NLS-1$
- protected final String TEXT_35 = ", "; //$NON-NLS-1$
- protected final String TEXT_36 = " {"; //$NON-NLS-1$
- protected final String TEXT_37 = NL + NL + " /**" + NL + " * Default constructor. " + NL + " */" + NL + " public "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- protected final String TEXT_38 = "() {" + NL + " // TODO Auto-generated constructor stub" + NL + " }"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- protected final String TEXT_39 = NL + " " + NL + " /**" + NL + " * @see "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- protected final String TEXT_40 = "#"; //$NON-NLS-1$
- protected final String TEXT_41 = "("; //$NON-NLS-1$
- protected final String TEXT_42 = ")" + NL + " */" + NL + " public "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- protected final String TEXT_43 = "("; //$NON-NLS-1$
- protected final String TEXT_44 = ") {" + NL + " super("; //$NON-NLS-1$ //$NON-NLS-2$
- protected final String TEXT_45 = ");" + NL + " // TODO Auto-generated constructor stub" + NL + " }"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- protected final String TEXT_46 = NL + NL + "\t/**" + NL + " * @see "; //$NON-NLS-1$ //$NON-NLS-2$
- protected final String TEXT_47 = "#"; //$NON-NLS-1$
- protected final String TEXT_48 = "("; //$NON-NLS-1$
- protected final String TEXT_49 = ")" + NL + " */" + NL + " public "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- protected final String TEXT_50 = " "; //$NON-NLS-1$
- protected final String TEXT_51 = "("; //$NON-NLS-1$
- protected final String TEXT_52 = ") {" + NL + " // TODO Auto-generated method stub"; //$NON-NLS-1$ //$NON-NLS-2$
- protected final String TEXT_53 = NL + "\t\t\treturn "; //$NON-NLS-1$
- protected final String TEXT_54 = ";"; //$NON-NLS-1$
- protected final String TEXT_55 = NL + " }"; //$NON-NLS-1$
- protected final String TEXT_56 = NL + NL + "}"; //$NON-NLS-1$
- protected final String TEXT_57 = NL;
+ protected final String TEXT_25 = NL + "@LocalBean"; //$NON-NLS-1$
+ protected final String TEXT_26 = NL + "@LocalHome("; //$NON-NLS-1$
+ protected final String TEXT_27 = ".class)"; //$NON-NLS-1$
+ protected final String TEXT_28 = NL + "@RemoteHome("; //$NON-NLS-1$
+ protected final String TEXT_29 = ".class)"; //$NON-NLS-1$
+ protected final String TEXT_30 = NL + "public "; //$NON-NLS-1$
+ protected final String TEXT_31 = "abstract "; //$NON-NLS-1$
+ protected final String TEXT_32 = "final "; //$NON-NLS-1$
+ protected final String TEXT_33 = "class "; //$NON-NLS-1$
+ protected final String TEXT_34 = " extends "; //$NON-NLS-1$
+ protected final String TEXT_35 = " implements "; //$NON-NLS-1$
+ protected final String TEXT_36 = ", "; //$NON-NLS-1$
+ protected final String TEXT_37 = " {"; //$NON-NLS-1$
+ protected final String TEXT_38 = NL + NL + " /**" + NL + " * Default constructor. " + NL + " */" + NL + " public "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ protected final String TEXT_39 = "() {" + NL + " // TODO Auto-generated constructor stub" + NL + " }"; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
+ protected final String TEXT_40 = NL + " " + NL + " /**" + NL + " * @see "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ protected final String TEXT_41 = "#"; //$NON-NLS-1$
+ protected final String TEXT_42 = "("; //$NON-NLS-1$
+ protected final String TEXT_43 = ")" + NL + " */" + NL + " public "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ protected final String TEXT_44 = "("; //$NON-NLS-1$
+ protected final String TEXT_45 = ") {" + NL + " super("; //$NON-NLS-1$ //$NON-NLS-2$
+ protected final String TEXT_46 = ");" + NL + " // TODO Auto-generated constructor stub" + NL + " }"; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
+ protected final String TEXT_47 = NL + NL + "\t/**" + NL + " * @see "; //$NON-NLS-1$//$NON-NLS-2$
+ protected final String TEXT_48 = "#"; //$NON-NLS-1$
+ protected final String TEXT_49 = "("; //$NON-NLS-1$
+ protected final String TEXT_50 = ")" + NL + " */" + NL + " public "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ protected final String TEXT_51 = " "; //$NON-NLS-1$
+ protected final String TEXT_52 = "("; //$NON-NLS-1$
+ protected final String TEXT_53 = ") {" + NL + " // TODO Auto-generated method stub"; //$NON-NLS-1$ //$NON-NLS-2$
+ protected final String TEXT_54 = NL + "\t\t\treturn "; //$NON-NLS-1$
+ protected final String TEXT_55 = ";"; //$NON-NLS-1$
+ protected final String TEXT_56 = NL + " }"; //$NON-NLS-1$
+ protected final String TEXT_57 = NL + NL + "}"; //$NON-NLS-1$
+ protected final String TEXT_58 = NL;
public String generate(Object argument)
{
@@ -188,48 +189,54 @@
}
- if (model.isLocalHomeChecked()) {
+ if (model.isNoInterfaceChecked()) {
stringBuffer.append(TEXT_25);
- stringBuffer.append(model.getLocalHomeClassSimpleName());
+
+ }
+
+ if (model.isLocalHomeChecked()) {
+
stringBuffer.append(TEXT_26);
+ stringBuffer.append(model.getLocalHomeClassSimpleName());
+ stringBuffer.append(TEXT_27);
}
if (model.isRemoteHomeChecked()) {
- stringBuffer.append(TEXT_27);
- stringBuffer.append(model.getRemoteHomeClassSimpleName());
stringBuffer.append(TEXT_28);
+ stringBuffer.append(model.getRemoteHomeClassSimpleName());
+ stringBuffer.append(TEXT_29);
}
if (model.isPublic()) {
- stringBuffer.append(TEXT_29);
+ stringBuffer.append(TEXT_30);
}
if (model.isAbstract()) {
- stringBuffer.append(TEXT_30);
+ stringBuffer.append(TEXT_31);
}
if (model.isFinal()) {
- stringBuffer.append(TEXT_31);
+ stringBuffer.append(TEXT_32);
}
- stringBuffer.append(TEXT_32);
+ stringBuffer.append(TEXT_33);
stringBuffer.append( model.getClassName() );
String superClass = model.getSuperclassName();
if (superClass != null && superClass.length() > 0) {
- stringBuffer.append(TEXT_33);
+ stringBuffer.append(TEXT_34);
stringBuffer.append( superClass );
}
@@ -237,7 +244,7 @@
List<String> interfaces = model.getInterfaces();
if ( interfaces.size() > 0) {
- stringBuffer.append(TEXT_34);
+ stringBuffer.append(TEXT_35);
}
@@ -245,7 +252,7 @@
String INTERFACE = interfaces.get(i);
if (i > 0) {
- stringBuffer.append(TEXT_35);
+ stringBuffer.append(TEXT_36);
}
@@ -253,13 +260,13 @@
}
- stringBuffer.append(TEXT_36);
+ stringBuffer.append(TEXT_37);
if (!model.hasEmptySuperclassConstructor()) {
- stringBuffer.append(TEXT_37);
- stringBuffer.append( model.getClassName() );
stringBuffer.append(TEXT_38);
+ stringBuffer.append( model.getClassName() );
+ stringBuffer.append(TEXT_39);
}
@@ -268,19 +275,19 @@
for (Constructor constructor : constructors) {
if (constructor.isPublic() || constructor.isProtected()) {
- stringBuffer.append(TEXT_39);
- stringBuffer.append( model.getSuperclassName() );
stringBuffer.append(TEXT_40);
stringBuffer.append( model.getSuperclassName() );
stringBuffer.append(TEXT_41);
- stringBuffer.append( constructor.getParamsForJavadoc() );
+ stringBuffer.append( model.getSuperclassName() );
stringBuffer.append(TEXT_42);
- stringBuffer.append( model.getClassName() );
+ stringBuffer.append( constructor.getParamsForJavadoc() );
stringBuffer.append(TEXT_43);
- stringBuffer.append( constructor.getParamsForDeclaration() );
+ stringBuffer.append( model.getClassName() );
stringBuffer.append(TEXT_44);
- stringBuffer.append( constructor.getParamsForCall() );
+ stringBuffer.append( constructor.getParamsForDeclaration() );
stringBuffer.append(TEXT_45);
+ stringBuffer.append( constructor.getParamsForCall() );
+ stringBuffer.append(TEXT_46);
}
}
@@ -290,36 +297,36 @@
if (model.shouldImplementAbstractMethods()) {
for (Method method : model.getUnimplementedMethods()) {
- stringBuffer.append(TEXT_46);
- stringBuffer.append( method.getContainingJavaClass() );
stringBuffer.append(TEXT_47);
- stringBuffer.append( method.getName() );
+ stringBuffer.append( method.getContainingJavaClass() );
stringBuffer.append(TEXT_48);
- stringBuffer.append( method.getParamsForJavadoc() );
- stringBuffer.append(TEXT_49);
- stringBuffer.append( method.getReturnType() );
- stringBuffer.append(TEXT_50);
stringBuffer.append( method.getName() );
+ stringBuffer.append(TEXT_49);
+ stringBuffer.append( method.getParamsForJavadoc() );
+ stringBuffer.append(TEXT_50);
+ stringBuffer.append( method.getReturnType() );
stringBuffer.append(TEXT_51);
- stringBuffer.append( method.getParamsForDeclaration() );
+ stringBuffer.append( method.getName() );
stringBuffer.append(TEXT_52);
+ stringBuffer.append( method.getParamsForDeclaration() );
+ stringBuffer.append(TEXT_53);
String defaultReturnValue = method.getDefaultReturnValue();
if (defaultReturnValue != null) {
- stringBuffer.append(TEXT_53);
- stringBuffer.append( defaultReturnValue );
stringBuffer.append(TEXT_54);
+ stringBuffer.append( defaultReturnValue );
+ stringBuffer.append(TEXT_55);
}
- stringBuffer.append(TEXT_55);
+ stringBuffer.append(TEXT_56);
}
}
- stringBuffer.append(TEXT_56);
stringBuffer.append(TEXT_57);
+ stringBuffer.append(TEXT_58);
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 5d1dcff..7daba16 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
@@ -163,8 +163,9 @@
public static String ERR_REMOTE_HOME_NOT_INTERFACE;
public static String ERR_NO_MESSAGE_LISTENER_INTERFACE;
public static String WRN_BEAN_NAME_IS_EMPTY;
- public static String WRN_NO_BUSINESS_INTERFACE;
- public static String ERR_SINGLETON_ALLOWED_ONLY_FOR_31_AND_LATER;
+ public static String WRN_NO_CLIENT_VIEW;
+ public static String ERR_SINGLETON_NOT_ALLOWED;
+ public static String ERR_NO_INTERFACE_NOT_ALLOWED;
static {
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 00c3dc8..c959797 100644
--- a/plugins/org.eclipse.jst.j2ee.ejb/property_files/ejbcreation.properties
+++ b/plugins/org.eclipse.jst.j2ee.ejb/property_files/ejbcreation.properties
@@ -148,5 +148,6 @@
ERR_REMOTE_HOME_NOT_INTERFACE=The specified Remote Home interface is not valid.
ERR_BEAN_ALREADY_EXISTS=Enterprise bean with the same Ejb Name already exists.
WRN_BEAN_NAME_IS_EMPTY=Bean name is empty, the containter will use the name of the bean class.
-WRN_NO_BUSINESS_INTERFACE=No business interface configured. Clients will not be able to access this bean.
-ERR_SINGLETON_ALLOWED_ONLY_FOR_31_AND_LATER=The 'Singleton' state type is allowed only for EJB projects with version 3.1 and later.
+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.
diff --git a/plugins/org.eclipse.jst.j2ee.ejb/templates/messageDrivenBean_classHeader.template b/plugins/org.eclipse.jst.j2ee.ejb/templates/messageDrivenBean_classHeader.template
index dc5aef8..cb3c33b 100644
--- a/plugins/org.eclipse.jst.j2ee.ejb/templates/messageDrivenBean_classHeader.template
+++ b/plugins/org.eclipse.jst.j2ee.ejb/templates/messageDrivenBean_classHeader.template
@@ -1,6 +1,5 @@
/**
* Message-Driven Bean implementation class for: <%=model.getClassName()%>
- *
*/
@MessageDriven
<%
diff --git a/plugins/org.eclipse.jst.j2ee.ejb/templates/sessionBean_classHeader.template b/plugins/org.eclipse.jst.j2ee.ejb/templates/sessionBean_classHeader.template
index 3c4d445..74a7388 100644
--- a/plugins/org.eclipse.jst.j2ee.ejb/templates/sessionBean_classHeader.template
+++ b/plugins/org.eclipse.jst.j2ee.ejb/templates/sessionBean_classHeader.template
@@ -68,6 +68,12 @@
<%
}
+ if (model.isNoInterfaceChecked()) {
+%>
+@LocalBean
+<%
+ }
+
if (model.isLocalHomeChecked()) {
%>
@LocalHome(<%=model.getLocalHomeClassSimpleName()%>.class)