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 20426 Details for
Bug 92201
iajc ant task for 1.5.0M2 throws compiler error and ajcore dump
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
IboValidationAspect.java
IboValidationAspect.java (text/plain), 2.41 KB, created by
David Wong
on 2005-04-27 21:10:14 EDT
(
hide
)
Description:
IboValidationAspect.java
Filename:
MIME Type:
Creator:
David Wong
Created:
2005-04-27 21:10:14 EDT
Size:
2.41 KB
patch
obsolete
>package com.amway.validation; > >import java.util.*; > >import org.apache.log4j.Logger; >import org.aspectj.lang.*; >import org.apache.commons.validator.ValidatorException; > >import com.amway.model.*; >import com.amway.service.*; >import com.amway.exception.*; >import com.amway.resource.Message; > >/** >* Validate IBO in business service delegate (SOA interface for web services). >* >* @author David Wong >*/ >public aspect IboValidationAspect { > static Logger log = Logger.getLogger("trace"); > > /** > * Validate an IBO before persistent operations on it. > * Since the project is for an RIA client, any failed validation checks are considered > * an error since they should have been caught by the client validation first. Validation > * errors are logged instead of sent to the client. > * > * Therefore the client and server validations should be kept in sync. > * > * If there is a change to a HTML based client (where javascript validation can be turned > * off) then the logic here should be changed to return validation error messages to the > * client. > * > * @author David Wong > */ > void around(AgsServiceDelegate del, Ibo ibo) throws AgsException : > execution(public * AgsServiceDelegate.*(Ibo)) > && !execution(* AgsServiceDelegate+.handle*(..)) > && target(del) > && args(ibo) > { > if (ibo == null) > { > // should really be IllegalArgumentException, except the joinpoint is at the component interface > // so we throw a business exception > throw new AgsException(Message.message("error.validation.missing")); > } > log.debug("About validate IBO for " + thisJoinPointStaticPart.getSignature().getName() + " with IBO " + ibo.getIboNumber()); > > try { > // validate the IBO > IboValidator validator = new IboValidator(); > List errors = new ArrayList(); > boolean valid = validator.validate(ibo, errors); > > if (valid) > { > proceed(del, ibo); > } > else > { > // create error msg > String domainDescriptor = Message.message("Ibo.descriptor"); > Object[] args = {domainDescriptor}; > String msg = Message.message("error.validation.fail", args); > > // log the validation errors > log.error(msg + ":"); > for (Iterator iter = errors.iterator(); iter.hasNext(); ) > { > log.error(iter.next()); > } > > // throw exception to indicate failed validation > throw new AgsException(msg); > } > } catch (ValidatorException ve) { > log.error(ve); > throw new AgsException(ve); > } > } > > >}
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 Raw
Actions:
View
Attachments on
bug 92201
:
20179
|
20276
| 20426 |
20427
|
21246