EjbWebServiceRegistryListenerpublic class EjbWebServiceRegistryListener extends Object implements com.sun.enterprise.webservice.monitoring.EndpointLifecycleListenerListener for EJB webservice endpoint registrations and unregistrations.
Upon receiving an EJB webservice endpoint registration event, this
listener will register the EJB webservice endpoint's path as an ad-hoc
path with the web container, along with information about the
ad-hoc servlet responsible for servicing any requests on this path.
Upon receiving an EJB webservice endpoint unregistration event, this
listener will unregister the EJB webservice endpoint's path as an
ad-hoc path from the web container. |
Fields Summary |
---|
private static final EjbWebServiceServletInfo | EJB_WEB_SERVICE_SERVLET_INFO | private WebContainer | webContainer |
Constructors Summary |
---|
public EjbWebServiceRegistryListener(WebContainer webContainer)Constructor.
this.webContainer = webContainer;
|
Methods Summary |
---|
public void | endpointAdded(com.sun.enterprise.webservice.monitoring.Endpoint endpoint)Receives and processes notification of a new webservice endpoint
installation in the appserver.
This method extracts the context root from the endpoint's URL, at
which it registers an EjbWebServiceWebModule which handles all HTTP
requests for the endpoint.
if (!TransportType.HTTP.equals(endpoint.getTransport())) {
return;
}
if (!EndpointType.EJB_ENDPOINT.equals(endpoint.getEndpointType())) {
return;
}
String epURI = endpoint.getEndpointSelector();
String epCtxRoot = null;
String epPath = null;
int index = epURI.indexOf('/", 1);
if (index < 0) {
epCtxRoot = epURI;
epPath = "";
} else {
epCtxRoot = epURI.substring(0, index);
epPath = epURI.substring(index);
}
String epSubtree = epPath + "/__container$publishing$subctx/";
String epAppName = null;
WebServiceEndpoint wse = endpoint.getDescriptor();
if (wse != null) {
BundleDescriptor bd = wse.getBundleDescriptor();
if (bd != null) {
Application app = bd.getApplication();
if (app != null) {
epAppName = app.getRegistrationName();
}
}
}
webContainer.registerAdHocPathAndSubtree(
epPath,
epSubtree,
epCtxRoot,
epAppName,
EJB_WEB_SERVICE_SERVLET_INFO);
| public void | endpointRemoved(com.sun.enterprise.webservice.monitoring.Endpoint endpoint)Receives and processes notification of a webservice endpoint
removal from the appserver.
This method extracts the context root from the endpoint's URL, and
unregisters the corresponding EjbWebServiceWebModule from the web
container
if (!TransportType.HTTP.equals(endpoint.getTransport())) {
return;
}
if (!EndpointType.EJB_ENDPOINT.equals(endpoint.getEndpointType())) {
return;
}
String epURI = endpoint.getEndpointSelector();
String epCtxRoot = null;
String epPath = null;
int index = epURI.indexOf('/", 1);
if (index < 0) {
epCtxRoot = epURI;
epPath = "";
} else {
epCtxRoot = epURI.substring(0, index);
epPath = epURI.substring(index);
}
String epSubtree = epPath + "/__container$publishing$subctx/";
webContainer.unregisterAdHocPathAndSubtree(epPath, epSubtree,
epCtxRoot);
| public void | register()Registers this EjbWebServiceRegistryListener with the EJB webservice
registry.
WebServiceEngineImpl wsEngine = WebServiceEngineImpl.getInstance();
wsEngine.addLifecycleListener(this);
/*
* Process any webservice endpoints that had been added before we've
* started listening for registration events.
*/
Iterator<Endpoint> endpoints = wsEngine.getEndpoints();
if (endpoints != null) {
while (endpoints.hasNext()) {
endpointAdded(endpoints.next());
}
}
| public void | unregister()Unregisters this EjbWebServiceRegistryListener from the EJB webservice
registry.
WebServiceEngineImpl.getInstance().removeLifecycleListener(this);
|
|