FileDocCategorySizeDatePackage
ApplicationLoaderEventListenerImpl.javaAPI DocGlassfish v2 API4732Fri May 04 22:36:10 BST 2007com.sun.enterprise.webservice

ApplicationLoaderEventListenerImpl

public class ApplicationLoaderEventListenerImpl extends Object implements com.sun.enterprise.server.event.ApplicationLoaderEventListener
Class that listens for deployment notifications. This class is used to store the webservice endpoints in the EndpointRegistry that are later used in the creation of JBIAdapter's. Related Issue: 6519371
author
Vikas Awasthi

Fields Summary
private final Logger
logger
private Map
endpoints
Constructors Summary
Methods Summary
public java.util.ListgetEndpoints(java.lang.String appName)

        return endpoints.get(appName);
    
public voidhandleApplicationEvent(com.sun.enterprise.server.event.ApplicationEvent event)


        
        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());
        }
    
public voidhandleEjbContainerEvent(com.sun.enterprise.server.event.EjbContainerEvent event)

    
public voidmergeEndpointRegistry(java.util.Map ws_endpoints)
During appserver restart applications are loaded before Java EE service engine is installed. This method will be called once during the startup of Java EE service engine. At this time, we need to merge all the endpoints collected so far with the map maintained in EndpointRegistry.

        ws_endpoints.putAll(endpoints);
        endpoints = ws_endpoints;