This content has been marked as final.
Show 3 replies
-
1. Re: examining a concrete Weld example from se.simple.example - Helloworld
asookazian Nov 13, 2009 1:36 AM (in response to asookazian)So how does this method get invoked exactly?
org.jboss.weld.environment.se.StartMain.main()
I'm imagining it's trace back to this cmd line command:
mvn -Drun -Dname=Pete
aha! found it in pom.xml:
<profiles> <profile> <id>run</id> <activation> <property> <name>run</name> </property> </activation> <build> <plugins> <plugin> <executions> <execution> <id>run</id> <phase>package</phase> <goals> <goal>java</goal> </goals> </execution> </executions> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <configuration> <mainClass>org.jboss.weld.environment.se.StartMain</mainClass> <arguments> <argument>${name}</argument> </arguments> </configuration> </plugin> </plugins> </build> </profile> </profiles>
and then this method in org.jboss.weld.environment.se.example.simple.HelloWorld is invoked:
public void printHello( @Observes ContainerInitialized init )
b/c of the presence of the @Observes annotation. In this case the
container
is the JVM or what as this is a simple Java app that is not deployed in a servlet container...Is this legal?
@Observes public void printHello( ContainerInitialized init )
-
2. Re: examining a concrete Weld example from se.simple.example - Helloworld
nickarls Nov 13, 2009 7:47 AM (in response to asookazian)- Somewhere, accessible to the manager, you need to have something resolvable with the qualifier @Parameters and the type List<String> (most probably a producer in this case)
- Nothing is being injected in this case. If the method would have had parameters, they would have been resolved and injected.
-
3. Re: examining a concrete Weld example from se.simple.example - Helloworld
nickarls Nov 13, 2009 7:48 AM (in response to asookazian)No. Arbi, you promised us you would read the specs ;-)