Last active
April 6, 2017 12:09
-
-
Save xandreafonso/fa90a06ee3b5817e02dbcd55f7c6d78f to your computer and use it in GitHub Desktop.
CDI em ambiente desktop (por evento)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>org.jboss.weld.se</groupId> | |
<artifactId>weld-se-core</artifactId> | |
<version>2.4.0.Final</version> | |
</dependency> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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