Methods Summary |
---|
public EjbRuntimeEndpointInfo | createEjbEndpointInfo(com.sun.enterprise.deployment.WebServiceEndpoint webServiceEndpoint, com.sun.ejb.containers.StatelessSessionContainer ejbContainer, java.lang.Object servant, java.lang.Class tieClass)Creates a new EjbRuntimeEndpointInfo instance depending on the type
and version of the web service implementation.
EjbRuntimeEndpointInfo info;
if ("1.1".compareTo(webServiceEndpoint.getWebService().getWebServicesDescriptor().getSpecVersion())>=0) {
info = new Ejb2RuntimeEndpointInfo(webServiceEndpoint, ejbContainer, servant, tieClass);
} else {
info = new EjbRuntimeEndpointInfo(webServiceEndpoint, ejbContainer, servant);
}
return info;
|
private java.lang.String | getContextRootForUri(java.lang.String uri)
StringTokenizer tokenizer = new StringTokenizer(uri, "/");
if (tokenizer.hasMoreTokens()) {
return tokenizer.nextToken();
} else {
return null;
}
|
public EjbRuntimeEndpointInfo | getEjbWebServiceEndpoint(java.lang.String uriRaw, java.lang.String method, java.lang.String query)
EjbRuntimeEndpointInfo endpoint = null;
if (uriRaw==null || uriRaw.length()==0) {
return null;
}
// Strip off any leading slash.
String uri = (uriRaw.charAt(0) == '/") ? uriRaw.substring(1) : uriRaw;
synchronized(webServiceEjbEndpoints) {
if( method.equals("GET") ) {
// First check for a context root match so we avoid iterating
// through all ejb endpoints. This logic will be used for
// all HTTP GETs, so it's important to reduce the overhead in
// the likely most common case that the request is for a web
// component.
String contextRoot = getContextRootForUri(uri);
if( ejbContextRoots.contains(contextRoot) ) {
// Now check for a match with a specific ejb endpoint.
Collection values = webServiceEjbEndpoints.values();
for(Iterator iter = values.iterator(); iter.hasNext();) {
EjbRuntimeEndpointInfo next = (EjbRuntimeEndpointInfo)
iter.next();
if( next.getEndpoint().matchesEjbPublishRequest
(uri, query)) {
endpoint = next;
break;
}
}
}
} else {
// In this case the uri must match exactly to be an ejb web
// service invocation, so do a direct table lookup.
endpoint = (EjbRuntimeEndpointInfo)
webServiceEjbEndpoints.get(uri);
}
}
return endpoint;
|
public java.util.Collection | getEjbWebServiceEndpoints()
return webServiceEjbEndpoints.entrySet();
|
public static com.sun.enterprise.webservice.WebServiceEjbEndpointRegistry | getRegistry()
return registry;
|
private void | regenerateEjbContextRoots()
synchronized(webServiceEjbEndpoints) {
Set contextRoots = new HashSet();
for(Iterator iter = webServiceEjbEndpoints.keySet().iterator();
iter.hasNext();) {
String uri = (String) iter.next();
String contextRoot = getContextRootForUri(uri);
if( (contextRoot != null) && !contextRoot.equals("") ) {
contextRoots.add(contextRoot);
}
}
ejbContextRoots = contextRoots;
}
|
public void | registerEjbWebServiceEndpoint(EjbRuntimeEndpointInfo endpoint)
String ctxtRoot;
synchronized(webServiceEjbEndpoints) {
String uriRaw = endpoint.getEndpointAddressUri();
String uri = (uriRaw.charAt(0)=='/") ? uriRaw.substring(1) : uriRaw;
if (webServiceEjbEndpoints.containsKey(uri)) {
logger.log(Level.SEVERE,
localStrings.getString("enterprise.webservice.duplicateService",
new Object[]{uri}));
}
webServiceEjbEndpoints.put(uri, endpoint);
regenerateEjbContextRoots();
ctxtRoot = getContextRootForUri(uri);
if(adapterListMap.get(ctxtRoot) == null) {
ServletAdapterList list = new ServletAdapterList();
adapterListMap.put(ctxtRoot, list);
}
}
// notify monitoring layers that a new endpoint is being created.
WebServiceEngineImpl engine = (WebServiceEngineImpl) WebServiceEngineFactory.getInstance().getEngine();
if (endpoint.getEndpoint().getWebService().getMappingFileUri()!=null) {
engine.createHandler((com.sun.xml.rpc.spi.runtime.SystemHandlerDelegate)null, endpoint.getEndpoint());
} else {
engine.createHandler(endpoint.getEndpoint());
// Safe to assume that it's a JAXWS endpoint
endpoint.initRuntimeInfo((ServletAdapterList)adapterListMap.get(ctxtRoot));
}
|
public void | unregisterEjbWebServiceEndpoint(java.lang.String endpointAddressUri)
EjbRuntimeEndpointInfo endpoint = null;
synchronized(webServiceEjbEndpoints) {
String uriRaw = endpointAddressUri;
String uri = (uriRaw.charAt(0)=='/") ? uriRaw.substring(1) : uriRaw;
String ctxtRoot = getContextRootForUri(uri);
ServletAdapterList list = (ServletAdapterList)adapterListMap.get(ctxtRoot);
if(list != null) {
for(ServletAdapter x : list) {
x.getEndpoint().dispose();
}
}
endpoint = (EjbRuntimeEndpointInfo) webServiceEjbEndpoints.remove(uri);
regenerateEjbContextRoots();
}
if (endpoint==null) {
return;
}
// notify the monitoring layers that an endpoint is destroyed
WebServiceEngineImpl engine = (WebServiceEngineImpl) WebServiceEngineFactory.getInstance().getEngine();
engine.removeHandler(endpoint.getEndpoint());
|