Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 368737

Summary: Allow adopters to add @Remote and @Local annotations to EJB class when creating a session EJB
Product: [WebTools] WTP EJB Tools Reporter: Roberto Sanchez Herrera <shr31223>
Component: jst.ejbAssignee: Roberto Sanchez Herrera <shr31223>
Status: RESOLVED FIXED QA Contact: Kaloyan Raev <kaloyan>
Severity: enhancement    
Priority: P3 CC: cbridgha, ccc, dimitar.giormov
Version: 3.2.5PFlags: cbridgha: review+
Target Milestone: 3.2.5 P   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 366346    
Bug Blocks: 368749    
Attachments:
Description Flags
Proposed patch for 3.2.5 P none

Description Roberto Sanchez Herrera CLA 2012-01-16 11:37:14 EST
Bug for backporting this code to WTP 3.2.5 P

+++ This bug was initially created as a clone of Bug #366346 +++

Currently, when you create a session EJB with local and/or remote view and you do not implement any other interface, the remote and/or local interfaces are created with the proper annotation (@remote or @local), and the resulting bean only implements these interfaces. But if you implement an extra interface in the wizard, the resulting bean class will have the @Remote and/or @Local annotation as well, 

This enhancement proposes to change this behavior by default, or provide a way to change this behavior, to add to the bean class the @remote and @local annotations besides implementing the interfaces even when you do not implement an extra interface, something like this:

/**
 * Session Bean implementation class MyBean
 */
@Stateless
@LocalBean
@Remote({com.test.MyBeanRemote.class})
@Local({com.test.MyBeanLocal.class})
public class MyBean implements MyBeanRemote, MyBeanLocal {
.....
}

The benefit to placing then annotations on the bean class is that it's clear what the business interfaces of an EJB are. Besides, this would help developers if they change their mind later and they want to implement an extra interface in their beans, or if they later want to add an extra remote/local business interface. This could also tools and application servers.
Comment 1 Roberto Sanchez Herrera CLA 2012-01-16 11:39:50 EST
Created attachment 209563 [details]
Proposed patch for 3.2.5 P
Comment 2 Chuck Bridgham CLA 2012-01-16 13:18:46 EST
approve
Comment 3 Roberto Sanchez Herrera CLA 2012-01-20 12:35:58 EST
Code committed and released to R3_2_5_patches. Resolving bug.