As many of you will know, Ubuntu 10.04 Lucid Lynx is officially being released today - perhaps has already been released as I am writing this. Ubuntu 10.04 is an Long Term Support (LTS) version. With the Long Term Support (LTS) version you get 3 years support on Ubuntu Desktop, and 5 years on Ubuntu Server.
Let's get a bird's eye view of what is on offer in this latest avatar namely Ubuntu 10.04 a.k.a Lucid Lynx.
Read more »
Rabu, 28 April 2010
Ubuntu 10.04 Lucid Lynx - A Fresh Look At What Is On Offer
Diposting oleh
Unknown
di
23.37
0
komentar
Label: lucid lynx, news, ubuntu
Kamis, 22 April 2010
Run Google Android on an Apple iPhone
Do you own an Apple iPhone? If yes, have you wished you could run a Linux flavour on your iPhone perhaps via dual booting ? Then your wish is answered. "Linux on the iPhone" blog team has successfully installed Google Android (which runs a Linux kernel) on Apple iPhone.
Watch the following video and gauge for yourselves how well Google Android performs on an Apple iPhone.
Read more »
Diposting oleh
Unknown
di
12.33
0
komentar
Label: android, apple, cell phones, dual booting, google, iphone
Minggu, 11 April 2010
GlobalSAN iSCSI initiator for Mac OS/X v. 4 has been released
As I told you in another blog post, I'm using GlobalSAN iSCSI initiator for Mac OS/X to remotely connect to my time machine disk, which happens to be a ZFS volume managed by a Solaris host. Studio Network Solutions has just released GlobalSAN version 4: alongside some UI enhancements, this new version of the GlobalSAN software takes advantage of Snow Leopard characteristics. A screenshot of the new GlobalSAN UI is the following:
Diposting oleh
Unknown
di
14.36
0
komentar
JSR 303 - Overview, part 3
The JSR 303 API
- The bootstrap SPI
- The validator API (which itself is made up the client API and the validation routine)
- Important helper classes and interfaces used during the validation process such as the ConstraintViolation class and the message interpolators.
- The constraint metadata request API
The bootstrap process: how to obtain a Validator
During the bootstrap process the service provider which implements the JSR 303 is discovered, configured and initialized. I won't cover the details of the bootstrapping API and if you're interested, you can check the specification. From an user standpoint, this API is important because it's the entry point to the validation API. After discovering and configuring all the available providers, you'll use the Validation class to obtain an instance of a ValidatorFactory.The validator API
No matter which validate method you choose it will return a set of contraint violations for the type T. A constraint violation is a type which is part of the JSR 303 API whose purpose is describing the errors found during the validation process. Such a type will be described later on.
The last method of the Validator interface is used to retrieve a BeanDescriptor, which is a structure which describes the constraints applied to a specific class' instances. You usually won't use this method in your daily life with a JSR 303 implementation unless you are building sophisticated logic which has to rely to such information at runtime.
Defining a constraint
- The @Constraint annotation is used to declare that the following annotation will be used as a constraint annotation. The validatedBy attribute of the @Constraint annotation is used to declare the class of the associated constraint validator, in this case the class EmailValidator.
- The standard @Target annotation is used to indicate which kind of element type this annotation will be used with. A JSR 303 compliant implementation will let you define and use constraint for the FIELD, METHOD and TYPE element types. In this example an email address is represented by a String instance so that TYPE is not specified in the constraint definition. If we were to define a class to represent an email address, we could define a constraint and a validator to annotate our class.
- The required RUNTIME @Retention policy is necessary so that the JSR 303 implementation be able to read validation metadata at runtime.
- The message() element is used to return a message in case of a validation error. The JSR 303 supports a flexible mechanism to define messages and this example uses the standard "{...}" notation to internationalize our messages in a properties resource bundle.
Defining a constraint validator
Since Pattern instances are thread-safe, our EmailValidator will take advantage of it by caching the regular expression used to validate email addresses. The isValid method simply checks that the String instance is not null (in which case the email address is considered to be valid, as suggested by the JSR 303 spec), and uses a Matcher instance to match it against our pattern.
Although a bit primitive, this is a sound constraint validator and you can take advantage of it immediately by annotating the fields of your beans. In my case, for example, I'm using it in a JPA entity and in a CDI bean which backs a JSF page in which users are submitting their email address. Without additional code, I'm taking advantage of JSF, JPA and JSR-303 to enforce a validation policy on both the web channel and the persistence layer of my Java EE 6 application.
Diposting oleh
Unknown
di
11.00
0
komentar
Label: java, java ee, jsr, validation