April 2018
Intermediate to advanced
382 pages
10h 11m
English
First, we are building a server to manage our event and observers:
public static void main(String[] args){ try(SeContainer container = SeContainerInitializer.newInstance().initialize()){ container .getBeanManager() .fireEvent(new ExampleEvent("event: " + System.currentTimeMillis())); }}
This will give us all the resources needed to run the recipe as if it was a Java EE server.
Then we build an observer:
public void thisEventBefore( @Observes @Priority(Interceptor.Priority.APPLICATION - 200) MyEvent event){ System.out.println("thisEventBefore: " + event.getValue());}
So, we have three important topics:
Read now
Unlock full access