public EnvironmentInterceptorBinding() {
super("environment-interceptor");
}
public Object parse(Element element, Parse parse, Parser parser) {
EnvironmentInterceptorDescriptor environmentInterceptorDescriptor = new EnvironmentInterceptorDescriptor();
ConfigurationImpl configuration = (ConfigurationImpl) parse.contextStackFind(ConfigurationImpl.class);
environmentInterceptorDescriptor.setConfiguration(configuration);
if ( element.hasAttribute("policy")
&& ("requiresNew".equals(element.getAttribute("policy")))
) {
environmentInterceptorDescriptor.setPolicy(Policy.REQUIRES_NEW);
}
return environmentInterceptorDescriptor;
}