Popular Posts

Thursday, June 05, 2014

CDI - Contexts and Dependency Injection tutorial for Java EE

Contexts and Dependency Injection (CDI) is one of several Java EE 6 features that help to knit together the web tier and the transactional tier of the Java EE platform. 
CDI is a set of services that, used together, make it easy for developers to use enterprise beans along with JavaServer Faces technology in web applications. Designed for use with stateful objects, CDI also has many broader uses, allowing developers a great deal of flexibility to integrate various kinds of components in a loosely coupled but typesafe way.


CDI is the Java standard for dependency injection (DI) and interception (AOP).


The most fundamental services provided by CDI are as follows:
  • Contexts: The ability to bind the lifecycle and interactions of stateful components to well-defined but extensible lifecycle contexts
  • Dependency injection: The ability to inject components into an application in a typesafe way, including the ability to choose at deployment time which implementation of a particular interface to inject
In addition, CDI provides the following services:
  • Integration with the Expression Language (EL), which allows any component to be used directly within a JavaServer Faces page or a JavaServer Pages page
  • The ability to decorate injected components
  • The ability to associate interceptors with components using typesafe interceptor bindings
  • An event-notification model
A major theme of CDI is loose coupling. CDI does the following:
  • Decouples the server and the client by means of well-defined types and qualifiers, so that the server implementation may vary
  • Decouples the lifecycles of collaborating components by doing the following:
    • Making components contextual, with automatic lifecycle management
    • Allowing stateful components to interact like services, purely by message passing
  • Completely decouples message producers from consumers, by means of events
  • Decouples orthogonal concerns by means of Java EE interceptors

CDI tutorial

483 comments:

«Oldest   ‹Older   401 – 483 of 483
jothika said...

You post explain everything in detail and it was very interesting to read.Thank you for Sharing.
IEEE Project Center in Kanchipuram

roshlin said...

What a fantastic blog you should written in well manner.Iam really happy to read this

blog.Thanks for sharing.keep sharing more blogs. No.1 TallyTraining Institute In

Kanchipuram










roshlin said...
This comment has been removed by the author.
roshlin said...
This comment has been removed by the author.
roshlin said...


What a fantastic blog you should written in well manner.Iam really happy to read this
blog.Thanks for sharing.keep sharing more blogs.
No.1 Tally Training Institute In Kanchipuram

roshlin said...


What a fantastic blog you should written in well manner.Iam really happy to read this
blog.Thanks for sharing.keep sharing more blogs.
No.1 Tally Training Institute In Kanchipuram

Usadev said...

I am really enjoying reading your well written information. I think you spend numerous effort and time updating your blog. No: 1 Graphic Designing Training Institute in Kanchipuram|

ram raghu said...

Congratulations guys, quality information you have given!!!..Its really useful blog. Thanks for sharing this useful information.
No.1 Selenium Training Center In Kanchipuram

mano karan said...

Well Said, you have furnished the right information that will be useful to anyone at all time... No: 1 Tally Erp 9.0 Training Center in Kanchipuram|

ram raghu said...

Congratulations guys, quality information you have given!!!..Its really useful blog. Thanks for sharing this useful information.
No.1 Selenium Training Center In Kanchipuram

karthik said...

Good blog. I gained more information about your post. keep updating. No: 1 MS OFFICE Training Center in Chennai|

janaki devi said...


This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information, this is useful to me…
Machine Learning Training Center In Chennai

karthik said...

Good blog. I gained more information about your post. keep updating. No: 1 MS OFFICE Training Center in Chennai|

janaki devi said...


This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information, this is useful to me…
Machine Learning Training Center In Chennai

sandhiya said...

I really love reading and following your post as I find them extremely informative and interesting. This post is equally informative as well as interesting. No: 1 Data Science Training Center in Chennai|

sindhu sree said...

What a fantastic blog you should written in well manner.Iam really happy to read this
blog.Thanks for sharing.keep sharing more blogs.
No.1 python Training center in Kanchipuram

sindhu sree said...

What a fantastic blog you should written in well manner.Iam really happy to read this
blog.Thanks for sharing.keep sharing more blogs.
No.1 python Training center in Kanchipuram

Dhilip Kumar said...

Awesome Post!!! With unique content, I really get interest to read this post. I hope this article help many of them who looking this pretty information.
No.1 Android Training institute in Kanchipuram

Dhilip Kumar said...


Awesome Post!!! With unique content, I really get interest to read this post. I hope this article help many of them who looking this pretty information.
No.1 Android Training institute in Kanchipuram

Dhilip Kumar said...


Awesome Post!!! With unique content, I really get interest to read this post. I hope this article help many of them who looking this pretty information.
No.1 Android Training institute in Kanchipuram

suresh said...

Very happy to see this blog. Gives a wonderful information with coded explanation. Thank you for this blog. very useful to me. No: 1 JAVA Training Institute in Kanchipuram|

sandhiya said...

Very nice post here and thanks for it .I always like and such a super blog of these post.Excellent and very cool idea and great blog of different kinds of the valuable information's. No: 1 .Net Training Institute in Kanchipuram|

mano karan said...

Thanks for sharing this unique and informative post. This blog which provided me the required information. No: 1 .Net Training Institute in Kanchipuram|

sindhu sree said...


Thanks for your informative blog.Your post helped me to understand the future and career prospects. Keep on updating your blog with such awesome blog.
Final years student project In Chennai

sindhu sree said...



Thanks for your informative blog.Your post helped me to understand the future and career prospects. Keep on updating your blog with such awesome blog.
Final years student project In Chennai

Atmajakan said...

Excellent blog. Very interesting to read. I really love to read such a nice a information. Thanks! keep rocking. No: 1 Final Year Project in Chennai|

ram raghu said...


Thanks for your informative blog.Your post helped me to understand the future and career prospects. Keep on updating your blog with such awesome blog.
Best Hardware and Networking Training institute In Chennai


isaiah han said...

I am following your blog from the beginning, it was so distinct & I had a chance to collect conglomeration of information that helps me a lot to improvise myself. I hope this will help many readers who are in need of this vital piece of information. Thanks for sharing & keep your blog updated. No: 1 Blue Prism Training Institute in Chennai|

ram raghu said...


Thanks for your informative blog.Your post helped me to understand the future and career prospects. Keep on updating your blog with such awesome blog. Best Hardware and Networking Training institute In Chennai |

sandhiya said...

You have done really great job. Your blog is very unique and informative. Thanks. No: 1 Final Year Project in Chennai|

janaki devi said...


Very nice post here and thanks for it .I always like and such a super blog of these post.Excellent and very cool idea and great blog of different kinds of the valuable information's. Best Hardware and Networking Training institute In Chennai |

jeffery said...

your blog contain very useful information. Really hereafter I am very big follower of your blog.. No: 1 Best Photoshop in Kanchipuram|

janaki devi said...

Very nice post here and thanks for it .I always like and such a super blog of these post.Excellent and very cool idea and great blog of different kinds of the valuable information's.Best Ethical Hacking Training institute in Kanchipuram|

adriana lima said...

Awesome Post! I like writing style, how you describing the topics throughout the post. I hope many web reader will keep reading your post at the end, Thanks for sharing your view. No: 1 Best Corel Draw in Kanchipuram|

karlie said...

Thanks for sharing such a nice blog. Its so informative concept and easy to understand also, kindly keep updating such a nice blog.. No: 1 Tally Training Institute in Kanchipuram|

ram raghu said...

I wondered upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon.Best Microsoft .Nets Training institute in Kanchipuram|

ram raghu said...

I wondered upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon.Best Microsoft .Net Training institute in Kanchipuram|

Gisele Bundchen said...

I have read all the articles in your blog; was really impressed after reading it.Thanks for giving nice information from your blog.. No: 1 Advanced MATLAB Course in Kanchipuram|

Malar said...


I wondered upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon. No: 1 Linux Certification in Kanchipuram|

suresh said...

Thank you for sharing in this information. can learn a lot and could also be a reference, I hope to read the next your blog updates. No: 1 Software Testing Certification in Kanchipuram|

bharathidasan said...


I ever had seen this information over the blog sites; actually I am looking forward for this information. Here I had an opportunity to read, it was crystal clear keep sharing…I have an expectation about your upcoming post.
Regards, No: 1 Adobe Photoshop Training Institute in Kanchipuram|

karlie said...

I really enjoyed while reading your blog, the information you have delivered in this post was damn good. Keep sharing your post with efficient news.Regards, No: 1 Adobe Illustrator Training Institute in Kanchipuram|

mano karan said...

Thank you for sharing the information here. Its much informative and really i got some valid information. You had posted the amazing blog. No: 1 Adobe InDesign Training Institute in Kanchipuram|

sindhu sree said...

Very nice post here and thanks for it .I always like and such a super blog

of these post.Excellent and very cool idea and great blog of different

kinds of the valuable information's.
No.1 Embeded project center

In Chennai










franklin fie said...

great blog, you have provided the right information that will be beneficial to somebody at all time. Thanks for sharing such valuable Ideas to our vision. No: 1 Adobe Illustrator Training Institute in Kanchipuram|

sindhu sree said...


What a fantastic blog you should written in well manner.Iam really happy to read this
blog.Thanks for sharing.keep sharing more blogs.
No.1 CCNA Institute In Kanchipuram

Malar said...


It's very helpful for this blog.Also great with all of the valuable information you have Keep up the good work you are doing well.keepThanks for sharing. No:1 Adobe Illustrator Training Institute in Chennai

janaki devi said...

very nice blogs!!! I have to learning for lot of information for this sites...Sharing for wonderful information. Thanks for sharing this valuable

information to our vision. You have posted a trust worthy blog keep sharing....
No.1 PHP project center In kanchipuram









Neil said...

Good blog. I gained more information about your post. keep updating. Best After Effects Training Institute in Kanchipuram|

srihariparu said...

MBA Project Center in Chennai | MBA Project Center in Velachery | MBA HR Projects in Pallikaranai | MBA Finance Projects in Taramani

bharathidasan said...

Very nice post here and thanks for it .I always like and such a super blog of these post.Excellent and very cool idea and great blog of different kinds of the valuable information's.Keep Sharing Best Adobe Premier Pro Training Institute in Kanchipuram|

rajinikumar said...

I really enjoyed by reading your blog post.I too always learn something new from your post.. Best Adobe Photoshop Training Institute in Kanchipuram|

sindhu sree said...

information to our vision. You have posted a trust worthy blog keep sharing....
No.1 PHP project center In kanchipuram

lingerie pre said...

Great Post!Thank you so much for this amazing posts and please keep update like this excellent blog. No:1 Best Adobe Photoshop Training Institute in Chennai

gilbertgon said...

Interesting post!!! Thanks for posting such a useful information. I wish to read your upcoming post to enhance my skill set and keep blogging. Best Graphic Designing Training Institute in Kanchipuram|

ram raghu said...

information to our vision. You have posted a trust worthy blog keep sharing....
No.1 MBA project center In kanchipuram

ram raghu said...

http://www.abdoumoumen.net/2011/10/landing-job-at-microsoft-part1-resume.html?showComment=1571549685887#c39345753246470922

bharathi sree said...

very nice blogs!!! I have to learning for lot of information for this sites...Sharing for wonderful information. Thanks for sharing this valuable.
No.1 Android Training institute In kanchipuram

sindhu sree said...

The information you shared is very effective for learners. I learnt this technology very well with the help of this article.Thanks for this useful

information.Keep updating.
Best Tally Training Institute in Chennai









harry said...

Your post is very nice .this post is very useful to us…
Selinium Course Training
In Chennai
|
Selinium Course TrainingIn Velachery
| Selinium Course TrainingIn Tambaram

sindhu sree said...

The information you shared is very effective for learners. I learnt this technology very well with the help of this article.Thanks for this useful

information.Keep updating.
Best Tally Training Institute in Chennai









sindhu sree said...

The information you shared is very effective for learners. I learnt this technology very well with the help of this article.Thanks for this useful
information.Keep updating.
Best Tally Training Institute in Chennai




janaki devi said...

Wow it is really wonderful and awesome thus it is very much useful for me to understand many information and helped me a lot. it is really explainable very well and i got more information from your blog.
Best Tally Training Institute in Kanchipuram

janaki devi said...

Wow it is really wonderful and awesome thus it is very much useful for me to understand many information and helped me a lot. it is really explainable very well and i got more information from your blog.
Best Tally Training Institute in Kanchipuram









ram raghu said...

Wow it is really wonderful and awesome thus it is very much useful for me to understand many information and helped me a lot. it is really explainable very well and i got more information from your blog.
Best PHP Training Institute in Kanchipuram



ram raghu said...

Wow it is really wonderful and awesome thus it is very much useful for me to understand many information and helped me a lot. it is really explainable very well and i got more information from your blog.
Best PHP Training Institute in Chennai









ram raghu said...

Wow it is really wonderful and awesome thus it is very much useful for me to understand many information and helped me a lot. it is really explainable very well and i got more information from your blog.
Best PHP Training Institute in Chennai









janaki devi said...

Wow it is really wonderful and awesome thus it is very much useful for me to understand many information and helped me a lot. it is really explainable very well and i got more information from your blog.
Best Embedded project center in Chennai


roja sangeetha said...

I have read your blog. Good and more information useful for me, Thanks for sharing this information keep it up....
Best VLSI project center in Chennai

bharathi sree said...

The best thing is that your blog really informative thanks for your great information!
Best Data mining project center in kanchipuram

bharathi sree said...

This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information, this is useful to me…
Best Android project center in kanchipuram






bharathi sree said...

This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information, this is useful to me…
Best Android project center in chennai


bharathi sree said...

This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information, this is useful to me…
Best Android project center in chennai


ram raghu said...

great doing. and i happy to visit your blog to know about this wonderful information. thanks for sharing. keep updating.
Best Robotics project center in chennai

bharathidasan said...

great blog, you have provided the right information that will be beneficial to somebody at all time. Thanks for sharing such valuable Ideas to our vision. Best Premier Pro Training Institute in Kanchipuram|

ram raghu said...

great doing. and i happy to visit your blog to know about this wonderful information. thanks for sharing. keep updating.
Best Robotics project center in chennai

sindhu sree said...

Nice..You have clearly explained about the conept..Its very useful for me to undertand..Keep on sharing..
Best Robotics project center in chennai


ram raghu said...

Very good and informative information. Thanks for sharing such nice blog, keep on updating such good post.
Best AWS Training institute in Chennai








sindhu sree said...

You have done a great job, really the concept of big data was superb, its very interesting and easy to understand also.. Keep updating such a nice blog..
Best MATLAB Training institute in Chennai








bharathi sree said...

Very impressive and informative blog.. thanks for sharing your valuable

information.. it is very useful and easy to learn as well... keep rocking

and updating... looking further..
Best

CCNP Training institute in kanchipuram

rajinikumar said...


Thanks for this greatful information. all this information is very important to all the users and can be used good at all this process.please keep on updating.. Best RHCE Training Institute in Kanchipuram|

mano karan said...


Thanks you for sharing this unique useful information content with us. Really awesome work. keep on blogging. Best Advanced MATLAB Course in Kanchipuram|

janaki devi said...

very nice blogs!!! I have to learning for lot of information for this

sites...Sharing for wonderful information. Thanks for sharing this

valuable information to our vision. You have posted a trust worthy blog

keep sharing.
Best

Advanced JAVA cource in kanchipuram









«Oldest ‹Older   401 – 483 of 483   Newer› Newest»