Skip to content

Instantly share code, notes, and snippets.

@jeanouii
Created July 10, 2014 18:53
Show Gist options
  • Select an option

  • Save jeanouii/6a28f5cddc30368cd2c8 to your computer and use it in GitHub Desktop.

Select an option

Save jeanouii/6a28f5cddc30368cd2c8 to your computer and use it in GitHub Desktop.
public void beforeInfoTreeBuilder(final BeforeAppInfoBuilderEvent event) {
LOGGER.fine("Adding governance interceptor to application > " + event.getAppModule().getModuleId());
final List<EjbModule> ejbModules = event.getAppModule().getEjbModules();
for (EjbModule ejbModule : ejbModules) {
final EjbJar ejbJar = ejbModule.getEjbJar();
ejbJar.addInterceptor(new Interceptor(GovernanceEnforcerInterceptor.class));
final AssemblyDescriptor assemblyDescriptor = ejbJar.getAssemblyDescriptor();
assemblyDescriptor.addInterceptorBinding(new InterceptorBinding("*", GovernanceEnforcerInterceptor.class.getName()));
LOGGER.fine("Successfully added governance interceptor to ejb module > " + ejbModule.getModuleId());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment