use of org.glassfish.webservices.monitoring.WebServiceEngineImpl in project Payara by payara.
the class WebServiceEjbEndpointRegistry method registerEndpoint.
@Override
public void registerEndpoint(WebServiceEndpoint webserviceEndpoint, EjbEndpointFacade ejbContainer, Object servant, Class tieClass) {
String uri = null;
EjbRuntimeEndpointInfo endpoint = createEjbEndpointInfo(webserviceEndpoint, ejbContainer, servant, tieClass);
synchronized (webServiceEjbEndpoints) {
String uriRaw = endpoint.getEndpointAddressUri();
if (uriRaw != null) {
uri = (uriRaw.charAt(0) == '/') ? uriRaw.substring(1) : uriRaw;
if (webServiceEjbEndpoints.containsKey(uri)) {
logger.log(Level.SEVERE, LogUtils.ENTERPRISE_WEBSERVICE_DUPLICATE_SERVICE, uri);
}
webServiceEjbEndpoints.put(uri, endpoint);
regenerateEjbContextRoots();
if (adapterListMap.get(uri) == null) {
ServletAdapterList list = new ServletAdapterList();
adapterListMap.put(uri, list);
}
} else
throw new WebServiceException(logger.getResourceBundle().getString(LogUtils.EJB_ENDPOINTURI_ERROR));
}
// notify monitoring layers that a new endpoint is being created.
WebServiceEngineImpl engine = WebServiceEngineImpl.getInstance();
if (hasMappingFileUri(endpoint.getEndpoint())) {
engine.createHandler((com.sun.xml.rpc.spi.runtime.SystemHandlerDelegate) null, endpoint.getEndpoint());
} else {
engine.createHandler(endpoint.getEndpoint());
}
}
use of org.glassfish.webservices.monitoring.WebServiceEngineImpl in project Payara by payara.
the class WebServiceEjbEndpointRegistry method unregisterEndpoint.
@Override
public void unregisterEndpoint(String endpointAddressUri) {
EjbRuntimeEndpointInfo endpoint = null;
synchronized (webServiceEjbEndpoints) {
String uriRaw = endpointAddressUri;
String uri = (uriRaw.charAt(0) == '/') ? uriRaw.substring(1) : uriRaw;
ServletAdapterList list = adapterListMap.get(uri);
if (list != null) {
// since we are using the uri in the adapterListMap
for (ServletAdapter x : list) {
x.getEndpoint().dispose();
for (Handler handler : x.getEndpoint().getBinding().getHandlerChain()) {
try {
WebServiceContractImpl wscImpl = WebServiceContractImpl.getInstance();
if (wscImpl.getInvocationManager().getCurrentInvocation() != null) {
InjectionManager injManager = wscImpl.getInjectionManager();
injManager.destroyManagedObject(handler);
}
} catch (InjectionException e) {
logger.log(Level.WARNING, LogUtils.DESTORY_ON_HANDLER_FAILED, new Object[] { handler.getClass(), x.getEndpoint().getServiceName(), e.getMessage() });
continue;
}
}
}
// Fix for issue 9523
adapterListMap.remove(uri);
}
endpoint = (EjbRuntimeEndpointInfo) webServiceEjbEndpoints.remove(uri);
regenerateEjbContextRoots();
}
if (endpoint == null) {
return;
}
// notify the monitoring layers that an endpoint is destroyed
WebServiceEngineImpl engine = WebServiceEngineImpl.getInstance();
engine.removeHandler(endpoint.getEndpoint());
}
Aggregations