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

Bug 330619

Summary: [Validation] Validation for customization classes
Product: [WebTools] Dali JPA Tools Reporter: Nan Li <nan.n.li>
Component: GeneralAssignee: Nan Li <nan.n.li>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: neil.hauge
Version: unspecifiedFlags: neil.hauge: review+
Target Milestone: 3.0 M7   
Hardware: PC   
OS: Windows 7   
Whiteboard: EclipseLink
Attachments:
Description Flags
Patch neil.hauge: iplog+

Description Nan Li CLA 2010-11-18 17:11:58 EST
Build Identifier: 20100917-0705

-Entity customizer class-
1. The class implements org.eclipse.persistence.config.DescriptorCustomizer interface.
2. The class has a public, zero-argument constructor.

-Session Customizer Class- 
1. The class implements org.eclipse.persistence.config.SessionCustomizer interface.
2. The class has a public, zero-argument constructor.

-Exception Handler Class- 
1. The class implements org.eclipse.persistence.exceptions.ExceptionHandler interface.
2. The class has a public, zero-argument constructor.

-Session Event Listener-
1. The class implements org.eclipse.persistence.sessions.SessionEventListener interface.
2. The class has a public, zero-argument constructor.

-Performance Profiler-
Refer to bug 277138

Reproducible: Always

Steps to Reproduce:
1. Create a persistence.xml and open it
2. Go to the Customization tab
3. Try to specify the customizers
Comment 1 Nan Li CLA 2011-03-03 16:00:22 EST
1. The validation of the entity customizer class specified in the persistence.xml will be replaced by the validation of the entity customizer class specified against the entity itself.

2. The validation of session event listeners will be deferred till bug 330620 gets fixed.
Comment 2 Nan Li CLA 2011-03-03 16:06:15 EST
To better handle the bugs, the validation of session event listeners will be tracked with bug 330620 instead of letting both bugs depend on each other.
Comment 3 Nan Li CLA 2011-03-07 13:54:25 EST
Created attachment 190582 [details]
Patch

1. This patch includes the fixes of bug 227138, bug 330610, and bug 331482.
2. The validation logic is
	1) if the given value is an empty value, e.g. <property name="eclipselink.profiler" value=""/>, an error is given telling a class should be specified.
	2) if the given value is an nonexistent class, an error is given telling the class does not exist on the project classpath.
	3) if the given class does not have a public, zero-argument constructor, an error is given telling the class must have a public, zero-argument constructor.
		(This validation does not apply to session loggers.)
	4) if the given class does not implement the right interface, an error message is given telling the class should implement the corresponding interface.
Comment 4 Nan Li CLA 2011-03-07 13:58:58 EST
bug 330610 in comment #3 should be bug 330619
Comment 5 Neil Hauge CLA 2011-04-19 11:00:58 EDT
Patch committed to head.