public void onEntityCallback(Object entity) {
try {
invocationCount++;
// Thread.dumpStack();
InitialContext jndiContext = new InitialContext();
EJBContext ctx = (EJBContext)jndiContext.lookup("java:comp/EJBContext");
System.out.println(ctx.getCallerPrincipal().getName() + ", entity=" + entity);
} catch (NamingException e) {
throw new RuntimeException("initial context error", e);
}
}