Skip to content

Instantly share code, notes, and snippets.

@mathieuancelin
Created April 20, 2011 19:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mathieuancelin/932349 to your computer and use it in GitHub Desktop.
Save mathieuancelin/932349 to your computer and use it in GitHub Desktop.
@ApplicationScoped
public class ServiceListener {
public void bindService(@Observes @Specification(MyService.class) ServiceArrival event) {
System.out.println("A new service just arrived");
MyService arrived = event.type(MyService.class).getService();
}
public void unbindService(@Observes @Specification(MyService.class) ServiceDeparture event) {
System.out.println("A service just went out");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment