Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Bring back singleton option when creating a new Session Bean and interfaceless EJBs #6257

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import org.netbeans.modules.j2ee.metadata.model.api.support.annotation.ObjectProvider;
import org.netbeans.modules.j2ee.metadata.model.api.support.annotation.PersistentObjectManager;

// @todo: Support JakartaEE
public class EnterpriseBeansImpl implements EnterpriseBeans {

private final AnnotationModelHelper helper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
/**
* @author Petr Slechta
*/
// @todo: Support JakartaEE
public class AnnotationHelpers {

private AnnotationModelHelper helper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
*
* @author Martin Adamek
*/
// @todo: Support JakartaEE
public final class SendJMSGenerator {

private static final Logger LOG = Logger.getLogger(SendJMSGenerator.class.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public EjbType run(EjbJarMetadata metadata) throws Exception {
Project project = FileOwnerQuery.getOwner(ejbClassFO);
if (project != null){
J2eeProjectCapabilities projectCap = J2eeProjectCapabilities.forProject(project);
allowsNoInterface = projectCap != null ? projectCap.isEjb31LiteSupported() : false;
allowsNoInterface = (projectCap != null && (projectCap.isEjb31LiteSupported() || projectCap.isEjb40LiteSupported()));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's about 3.2 lite? From my understanding EJB lite is a subset of EJB full. So if EJB lite should support it as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My reading of isEjb31LiteSupported is, that it is true if EJB 3.2 is supported. Assuming EJB follows the convention, that breaking changes are communicated by a change in the major number, this makes sense (repeating myself: I assume 3.2 is a superset of 3.1).
Yes if isEjb31Supported returns true, isEjb31LiteSupported will, the same is true for the other EJB capability checks.

}

controller = new SessionMethodController(className, model, allowsNoInterface);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,9 @@ private void inProjectComboActionPerformed(java.awt.event.ActionEvent evt) {//GE
// End of variables declaration//GEN-END:variables

private void updateCheckboxes() {
J2eeProjectCapabilities projectCap = J2eeProjectCapabilities.forProject(project);
//by default for ejb 3.1 no interfaces will be created
localCheckBox.setSelected(!J2eeProjectCapabilities.forProject(project).isEjb31LiteSupported());
localCheckBox.setSelected(!(projectCap.isEjb31LiteSupported() || projectCap.isEjb40LiteSupported()));
changeSupport.fireChange();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ public boolean isValid() {
return false;
}
if (!(component.isRemote() || component.isLocal())) {
if(J2eeProjectCapabilities.forProject(project).isEjb31LiteSupported()) {
J2eeProjectCapabilities projectCap = J2eeProjectCapabilities.forProject(project);
if(projectCap.isEjb31LiteSupported() || projectCap.isEjb40LiteSupported()) {
//if it's jee6 project, ejb 3.1 allow to omit any interfaces
} else {
wizardDescriptor.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, NbBundle.getMessage(EjbFacadeWizardPanel2.class, "ERR_ChooseInterface")); // NOI18N
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
*
* @author Martin Fousek <marfous@netbeans.org>
*/
// @todo: Support JakartaEE
@SuppressWarnings("serial") // not used to be serialized
public class MdbPropertiesPanelVisual extends javax.swing.JPanel {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
* This class contains only static methods.
* @author Tomas Mysik
*/
// @todo: Support JakartaEE
public abstract class MessageDestinationUiSupport {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ public boolean isValid() {
}
boolean isLocal = wizardPanel.isLocal();
boolean isRemote = wizardPanel.isRemote();
if (!isLocal && !isRemote && !J2eeProjectCapabilities.forProject(project).isEjb31LiteSupported()) {
J2eeProjectCapabilities projectCap = J2eeProjectCapabilities.forProject(project);
if (!isLocal && !isRemote && !projectCap.isEjb31LiteSupported() && !projectCap.isEjb40LiteSupported()) {
wizardDescriptor.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, NbBundle.getMessage(SessionEJBWizardDescriptor.class,"ERR_RemoteOrLocal_MustBeSelected")); //NOI18N
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -476,15 +476,15 @@ public Project getRemoteInterfaceProject() {
}

private boolean isSingletonSupported(J2eeProjectCapabilities projectCap) {
return projectCap.isEjb31LiteSupported();
return projectCap.isEjb31LiteSupported() || projectCap.isEjb40LiteSupported();
}

private boolean isNoInterfaceViewSupported(J2eeProjectCapabilities projectCap) {
return projectCap.isEjb31LiteSupported();
return projectCap.isEjb31LiteSupported() || projectCap.isEjb40LiteSupported();
}

private boolean isTimerSupported(J2eeProjectCapabilities projectCap) {
return projectCap.isEjb31Supported() || projectCap.isEjb32LiteSupported();
return projectCap.isEjb31Supported() || projectCap.isEjb32LiteSupported() || projectCap.isEjb40LiteSupported();
}

private boolean isRemoteInterfaceSupported() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"AsynchronousMethodInvocation.description=Checks usage of @Asynchronous. Tests whether it's used within supported project and interface type.",
"AsynchronousMethodInvocation.err.asynchronous.in.ejb31=Asynchronous method invocation is not allowed in project targeting JavaEE 6 Lite profile"
})
// @todo: Support JakartaEE
public final class AsynchronousMethodInvocation {

private AsynchronousMethodInvocation() { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
* @author ads
*
*/
// @todo: Support JakartaEE
class ObjectProviders {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.netbeans.modules.j2ee.metadata.model.api.support.annotation.PersistentObjectManager;
import org.netbeans.modules.j2ee.persistence.api.metadata.orm.*;

// @todo: Support JakartaEE
public class EntityMappingsImpl implements EntityMappings {

private final AnnotationModelHelper helper;
Expand Down