bean archives in Java EE6
By sreekanth on Oct 05, 2010
Jave EE6 comes with a new feature called CDI (Context Dependency Injection).This allows you to inject beans and various other J2EE resources in to your application.
For CDI to roll in into your application, there should be a way to tell that the container that you want to use this feature.This is done through beans.xml.
This beans.xml file must be placed in either META-INF/beans.xml and WEB-INF/beans.xml directory of your application to get it work.This file can be simply a place holder file which tells the run time that this module has beans that need to be used for CDI.Apart from that this file allows you to declare your interceptors, decorators and alternatives that you want to use.
So any archive that comes with a beans.xml is said to be bean archive and the container only looks into bean archives for beans to be used as a part of CDI .