Reader small image

You're reading from  Java EE 7 Development with NetBeans 8

Product typeBook
Published inJan 2015
Reading LevelIntermediate
PublisherPackt
ISBN-139781783983520
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
David R Heffelfinger
David R Heffelfinger
author image
David R Heffelfinger

David Heffelfinger is the Chief Technology Officer of Ensode Technology, LLC, a software consulting firm based in the greater Washington DC area. He has been architecting, designing, and developing software professionally since 1995, and has been using Java as his primary programming language since 1996. He has worked on many large-scale projects for several clients including the US Department of Homeland Security, Freddie Mac, Fannie Mae, and the US Department of Defense. He also has a Masters degree in Software Engineering from Southern Methodist University. David is Editor-in-Chief of Ensode.net (http://www.ensode.net), a website about Java, Linux, and other technology topics.
Read more about David R Heffelfinger

Right arrow

Interceptor binding types


One of the advantages of EJBs is that they allow us to easily perform aspect-oriented programming (AOP) via interceptors. CDI allows us to write interceptor binding types; this lets us bind interceptors to beans and the beans do not have to depend on the interceptor directly. Interceptor binding types are annotations that are themselves annotated with @InterceptorBinding.

Creating an interceptor binding type in NetBeans involves creating a new file, selecting the Contexts and Dependency Injection category, and selecting the Interceptor Binding Type file type.

Then, we need to enter a class name and select or enter a package for our new interceptor binding type.

At this point,, NetBeans generates the code for our interceptor binding type:

package com.ensode.cdiintro.interceptorbinding;

import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Java EE 7 Development with NetBeans 8
Published in: Jan 2015Publisher: PacktISBN-13: 9781783983520

Author (1)

author image
David R Heffelfinger

David Heffelfinger is the Chief Technology Officer of Ensode Technology, LLC, a software consulting firm based in the greater Washington DC area. He has been architecting, designing, and developing software professionally since 1995, and has been using Java as his primary programming language since 1996. He has worked on many large-scale projects for several clients including the US Department of Homeland Security, Freddie Mac, Fannie Mae, and the US Department of Defense. He also has a Masters degree in Software Engineering from Southern Methodist University. David is Editor-in-Chief of Ensode.net (http://www.ensode.net), a website about Java, Linux, and other technology topics.
Read more about David R Heffelfinger