Application application = event.getApplication();
if(event.getEventType() == ApplicationEvent.AFTER_APPLICATION_LOAD) {
List<WebServiceEndpoint> list = new ArrayList<WebServiceEndpoint>();
for (Object bundle : application.getWebBundleDescriptors()) {
WebServicesDescriptor webServices =
((WebBundleDescriptor) bundle).getWebServices();
list.addAll(webServices.getEndpoints());
}
if(!list.isEmpty()) {
String appName = application.getRegistrationName();
endpoints.put(appName,list);
logger.log(Level.FINE,
"serviceengine.websvc_endpoints_added",
new Object[]{appName});
}
}
if(event.getEventType() == ApplicationEvent.AFTER_APPLICATION_UNLOAD) {
endpoints.remove(application.getRegistrationName());
}