>>>I was really asking how you implemented the scanning.  I.e. the code
details rather than the spec details.
>>>A link the scanning code will work too.
Scanning code is

https://svn.apache.org/repos/asf/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/spi/ee/deployer/WarMetaDataDiscoveryImpl.java

>>>Do you have a link to the listener?
Listener code;
https://svn.apache.org/repos/asf/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/servlet/WebBeansConfigurationListener.java

Some explanation :

Context initialized method calls
https://svn.apache.org/repos/asf/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/WebBeansLifeCycle.java
instance's *"applicationStarted"* method.This method gets discovery class
instance and call its "init" and "scan" methods respectively.

   this.discovery = ServiceLoader.getService(MetaDataDiscoveryService.class);
>    this.discovery.init(event.getServletContext());
>
>    this.discovery.scan();
>
>

After that it calls,
https://svn.apache.org/repos/asf/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/WebBeansContainerDeployer.java
"deploy" method to deploy all classes.

deployer.deploy(this.discovery);
>
>
WebBeansContainerDeployer "deploy" method calls "deployFromClassPath" method
to resolve "Managed Beans" and "EJB Beans". It gets all scanned classes via
given scanner.

protected void deployFromClassPath(MetaDataDiscoveryService scanner)
throws ClassNotFoundException
>
>
I hope this help

Thanks;

--Gurkan

2009/8/18 David Blevins <[email protected]>

>
> On Aug 17, 2009, at 11:13 PM, Gurkan Erdogdu wrote:
>
>  Hi David,
>>
>> Firstly, thanks for answering.
>>
>> As you specified we currently boot OpenWebBeans as a servlet context
>> listener to get all OWB  classes and to create OWB specific beans. For
>> each
>> class, we ask OpenEJB whether it is an EJB related class or not. If it is
>> not an EJB class, we define OWB "*Managed Bean*" instance, if it is we
>> create "*EJB Bean*" instance.
>>
>
> Nice.
>
>  OWB beans are used for creating actual object instances whenever they are
>> injected into some other beans. OWB container finds which bean it injects
>> using type safe algorithm. (In below example, it tries to find OWB Managed
>> Bean with "*API Type*" PaymentProcessor and "*Binding Type*" is @Payment)
>>
>> For Example;
>>
>> class Person{
>>  @Payment PaymentProcessor processor;
>> }
>>
>
> I was really asking how you implemented the scanning.  I.e. the code
> details rather than the spec details.
>
> A link the scanning code will work too.
>
>  We could probably boot you a lot sooner so you can participate more
>>>>>
>>>> closely in deployment.
>> Tomcat calls our context listener after deployment, so we are able to use
>> EJB integration. So there is no problem for deployment ordering
>>
>
> We do need to scan those classes at deploy time to ensure all the resources
> they need are created, added to JNDI, etc. by the time the app starts.  So
> we will need to find a way to boot you a bit sooner.
>
> Do you have a link to the listener?
>
> -David
>
>


-- 
Gurkan Erdogdu
http://gurkanerdogdu.blogspot.com

Reply via email to