Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 154964 Details for
Bug 241667
Optional local business interfaces for EJB 3.1 beans
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
patch - warning for no business interface
241667_patch.txt (text/plain), 9.62 KB, created by
Kaloyan Raev
on 2009-12-23 08:10:26 EST
(
hide
)
Description:
patch - warning for no business interface
Filename:
MIME Type:
Creator:
Kaloyan Raev
Created:
2009-12-23 08:10:26 EST
Size:
9.62 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jst.ejb.ui >Index: ejb_ui/org/eclipse/jst/ejb/ui/internal/wizard/NewSessionBeanClassWizardPage.java >=================================================================== >RCS file: /cvsroot/webtools/ejbtools/plugins/org.eclipse.jst.ejb.ui/ejb_ui/org/eclipse/jst/ejb/ui/internal/wizard/NewSessionBeanClassWizardPage.java,v >retrieving revision 1.11 >diff -u -r1.11 NewSessionBeanClassWizardPage.java >--- ejb_ui/org/eclipse/jst/ejb/ui/internal/wizard/NewSessionBeanClassWizardPage.java 9 Jun 2009 18:45:08 -0000 1.11 >+++ ejb_ui/org/eclipse/jst/ejb/ui/internal/wizard/NewSessionBeanClassWizardPage.java 23 Dec 2009 13:12:00 -0000 >@@ -15,6 +15,7 @@ > 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; >+import static org.eclipse.jst.j2ee.internal.common.operations.INewJavaClassDataModelProperties.INTERFACES; > > import org.eclipse.swt.SWT; > import org.eclipse.swt.layout.GridData; >@@ -102,13 +103,14 @@ > protected String[] getValidationPropertyNames() { > String[] retVal = null; > String[] baseVals = super.getValidationPropertyNames(); >- retVal = new String[baseVals.length+2]; >- for (int cnt=0; cnt < baseVals.length; cnt++) >+ retVal = new String[baseVals.length + 2]; >+ for (int i = 0; i < baseVals.length; i++) > { >- retVal[cnt] = baseVals[cnt]; >+ retVal[i] = baseVals[i]; > } > retVal[baseVals.length] = LOCAL_BUSINESS_INTERFACE; >- retVal[baseVals.length+1] = REMOTE_BUSINESS_INTERFACE; >+ retVal[baseVals.length + 1] = REMOTE_BUSINESS_INTERFACE; >+ retVal[baseVals.length + 1] = INTERFACES; > return retVal; > } > } >Index: ejb_ui/org/eclipse/jst/ejb/ui/internal/wizard/AddSessionBeanWizardPage.java >=================================================================== >RCS file: /cvsroot/webtools/ejbtools/plugins/org.eclipse.jst.ejb.ui/ejb_ui/org/eclipse/jst/ejb/ui/internal/wizard/AddSessionBeanWizardPage.java,v >retrieving revision 1.15 >diff -u -r1.15 AddSessionBeanWizardPage.java >--- ejb_ui/org/eclipse/jst/ejb/ui/internal/wizard/AddSessionBeanWizardPage.java 9 Jun 2009 18:45:09 -0000 1.15 >+++ ejb_ui/org/eclipse/jst/ejb/ui/internal/wizard/AddSessionBeanWizardPage.java 23 Dec 2009 13:12:00 -0000 >@@ -231,11 +231,11 @@ > } > > private void removeInterfaceFromModel(BusinessInterface element) { >- Collection<BusinessInterface> biList = (Collection<BusinessInterface>) model >- .getProperty(INTERFACES); >+ Collection<BusinessInterface> biList = (Collection<BusinessInterface>) model.getProperty(INTERFACES); > biList.remove(element); > model.setProperty(INTERFACES, biList); > model.setProperty(BUSINESS_INTERFACES, biList); >+ model.notifyPropertyChange(INTERFACES, IDataModel.VALUE_CHG); > } > > public void updateBusinessInterfacesList() { >@@ -303,7 +303,7 @@ > @Override > protected String[] getValidationPropertyNames() { > return new String[] { LOCAL_HOME_INTERFACE, REMOTE_HOME_INTERFACE, LOCAL_COMPONENT_INTERFACE, >- REMOTE_COMPONENT_INTERFACE, EJB_NAME }; >+ REMOTE_COMPONENT_INTERFACE, EJB_NAME, INTERFACES }; > } > > @Override >Index: ejb_ui/org/eclipse/jst/ejb/ui/internal/wizard/AddButtonListener.java >=================================================================== >RCS file: /cvsroot/webtools/ejbtools/plugins/org.eclipse.jst.ejb.ui/ejb_ui/org/eclipse/jst/ejb/ui/internal/wizard/AddButtonListener.java,v >retrieving revision 1.10 >diff -u -r1.10 AddButtonListener.java >--- ejb_ui/org/eclipse/jst/ejb/ui/internal/wizard/AddButtonListener.java 9 Jun 2009 18:49:02 -0000 1.10 >+++ ejb_ui/org/eclipse/jst/ejb/ui/internal/wizard/AddButtonListener.java 23 Dec 2009 13:12:00 -0000 >@@ -64,6 +64,7 @@ > biList.add(iface); > model.setProperty(INTERFACES, biList); > model.setProperty(BUSINESS_INTERFACES, biList); >+ model.notifyPropertyChange(INTERFACES, IDataModel.VALUE_CHG); > page.updateBusinessInterfacesList(); > } > } >#P org.eclipse.jst.j2ee.ejb >Index: property_files/ejbcreation.properties >=================================================================== >RCS file: /cvsroot/webtools/ejbtools/plugins/org.eclipse.jst.j2ee.ejb/property_files/ejbcreation.properties,v >retrieving revision 1.12 >diff -u -r1.12 ejbcreation.properties >--- property_files/ejbcreation.properties 4 Jul 2008 13:07:25 -0000 1.12 >+++ property_files/ejbcreation.properties 23 Dec 2009 13:12:02 -0000 >@@ -147,3 +147,4 @@ > 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. >Index: ejbcreation/org/eclipse/jst/j2ee/internal/ejb/project/operations/EJBCreationResourceHandler.java >=================================================================== >RCS file: /cvsroot/webtools/ejbtools/plugins/org.eclipse.jst.j2ee.ejb/ejbcreation/org/eclipse/jst/j2ee/internal/ejb/project/operations/EJBCreationResourceHandler.java,v >retrieving revision 1.11 >diff -u -r1.11 EJBCreationResourceHandler.java >--- ejbcreation/org/eclipse/jst/j2ee/internal/ejb/project/operations/EJBCreationResourceHandler.java 9 Jun 2009 22:47:05 -0000 1.11 >+++ ejbcreation/org/eclipse/jst/j2ee/internal/ejb/project/operations/EJBCreationResourceHandler.java 23 Dec 2009 13:12:02 -0000 >@@ -162,6 +162,7 @@ > 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; > > > static { >Index: ejb/org/eclipse/jst/j2ee/ejb/internal/operations/NewSessionBeanClassDataModelProvider.java >=================================================================== >RCS file: /cvsroot/webtools/ejbtools/plugins/org.eclipse.jst.j2ee.ejb/ejb/org/eclipse/jst/j2ee/ejb/internal/operations/NewSessionBeanClassDataModelProvider.java,v >retrieving revision 1.17 >diff -u -r1.17 NewSessionBeanClassDataModelProvider.java >--- ejb/org/eclipse/jst/j2ee/ejb/internal/operations/NewSessionBeanClassDataModelProvider.java 14 Oct 2009 12:52:11 -0000 1.17 >+++ ejb/org/eclipse/jst/j2ee/ejb/internal/operations/NewSessionBeanClassDataModelProvider.java 23 Dec 2009 13:12:02 -0000 >@@ -33,6 +33,7 @@ > > 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; >@@ -47,12 +48,14 @@ > import org.eclipse.jst.j2ee.internal.common.J2EECommonMessages; > import org.eclipse.jst.j2ee.internal.common.operations.NewJavaClassDataModelProvider; > import org.eclipse.jst.j2ee.internal.ejb.project.operations.EJBCreationResourceHandler; >+import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetConstants; > import org.eclipse.osgi.util.NLS; > import org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor; > import org.eclipse.wst.common.frameworks.datamodel.IDataModel; > 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; >+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; > > public class NewSessionBeanClassDataModelProvider extends NewEnterpriseBeanClassDataModelProvider { > >@@ -302,11 +305,11 @@ > @Override > public IStatus validate(String propertyName) { > if (LOCAL_BUSINESS_INTERFACE.equals(propertyName)) { >- if (model.getBooleanProperty(LOCAL)) { >+ if (getBooleanProperty(LOCAL)) { > return validateEjbInterface(getStringProperty(propertyName)); > } > } else if (REMOTE_BUSINESS_INTERFACE.equals(propertyName)) { >- if (model.getBooleanProperty(REMOTE)) { >+ if (getBooleanProperty(REMOTE)) { > return validateEjbInterface(getStringProperty(propertyName)); > } > } else if (LOCAL_COMPONENT_INTERFACE.equals(propertyName) || >@@ -314,11 +317,13 @@ > LOCAL_HOME_INTERFACE.equals(propertyName) || > REMOTE_HOME_INTERFACE.equals(propertyName)) { > return validateComponentHomeInterfaces(); >+ } else if (INTERFACES.equals(propertyName)) { >+ return validateInterfacesList(); > } > > return super.validate(propertyName); > } >- >+ > protected IStatus validateEjbInterface(String fullyQualifiedName) { > IStatus status = validateJavaTypeName(fullyQualifiedName); > if (status.getSeverity() != IStatus.ERROR) { >@@ -423,6 +428,14 @@ > return Status.OK_STATUS; > } > >+ 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); >+ } >+ return Status.OK_STATUS; >+ } >+ > private boolean hasRequiredElementInSignature(String[] allElementNames, String[] wanted) { > if (allElementNames == null || allElementNames.length == 0){ > return false; >@@ -462,5 +475,13 @@ > } > return WTPCommonPlugin.OK_STATUS; > } >+ >+ private boolean isEJB30Project() { >+ try { >+ return ProjectFacetsManager.create(getTargetProject()).hasProjectFacet(IJ2EEFacetConstants.EJB_30); >+ } catch (CoreException e) { >+ return false; >+ } >+ } > > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 241667
: 154964 |
159894
|
159902