Skip to content

Instantly share code, notes, and snippets.

@xandreafonso
Last active April 6, 2017 12:09
Show Gist options
  • Save xandreafonso/fa90a06ee3b5817e02dbcd55f7c6d78f to your computer and use it in GitHub Desktop.
Save xandreafonso/fa90a06ee3b5817e02dbcd55f7c6d78f to your computer and use it in GitHub Desktop.
CDI em ambiente desktop (por evento)
<dependency>
<groupId>org.jboss.weld.se</groupId>
<artifactId>weld-se-core</artifactId>
<version>2.4.0.Final</version>
</dependency>
@Singleton
public class WeldSe {
public static void main(String[] args) {
StartMain.main(args);
}
@Inject @Parameters
private List<String> args;
@Inject
private AnyService anyService;
public void run(@Observes ContainerInitialized event) {
anyService.doWork(args);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment