Methods Summary |
---|
private boolean | checkInterface(WebserviceMappingBean bean)
return bean.getServiceInterface().isAssignableFrom(
bean.getServiceImpl().getClass());
|
public java.util.Map | getMapping()
return this.mapping;
|
protected com.caucho.hessian.server.HessianSkeleton | getMappingFromPath(java.lang.String path)The last part of the request URL is used to identify a configured service
mapping.
if (path.endsWith("/"))
path = path.substring(0, path.length() - 1);
String requestedService = path.substring(path.lastIndexOf("/") + 1);
HessianSkeleton retVal = this.skeletonCache.get(requestedService);
if (retVal == null) {
WebserviceMappingBean wsBean = this.mapping.get(requestedService);
if (wsBean == null)
throw new NoSuchServiceException();
if (!checkInterface(wsBean))
throw new RuntimeException(
"The configured webservice interface is not assignable from the corresponding service");
retVal = new HessianSkeleton(wsBean.getServiceImpl(), wsBean
.getServiceInterface());
/*
* rather create this service twice as synchronize the whole block
*/
this.skeletonCache.putIfAbsent(requestedService, retVal);
}
return retVal;
|
public HessianServiceSkeletonInvoker | getServiceSkeletonInvoker(javax.servlet.http.HttpServletRequest arg0)
if (arg0 == null)
throw new IllegalArgumentException(
"HttpServletRequest must not be null");
HessianSkeleton mappingFromRequest = getMappingFromPath(arg0
.getPathInfo());
return new HessianServiceSkeletonInvokerImpl(mappingFromRequest);
|
public void | setMapping(java.util.Map mapping)
this.mapping = mapping;
|