private static final Log logger = LogFactory.getLog( GwtRpcPluginProxyServlet.class );
private static final Pattern pentahoBasePattern = Pattern.compile( "^/.*/WEBAPP_ROOT/" ); //$NON-NLS-1$
@Override
protected Object resolveDispatchTarget( String servletContextPath ) {
IServiceManager serviceManager = PentahoSystem.get( IServiceManager.class, PentahoSessionHolder.getSession() );
String key = getDispatchKey();
if ( null == serviceManager.getServiceConfig( "gwt", key ) ) { //$NON-NLS-1$
String errMsg =
Messages.getInstance().getErrorString( "GwtRpcPluginProxyServlet.ERROR_0001_SERVICE_NOT_FOUND", key ); //$NON-NLS-1$
logger.error( errMsg );
throw new GwtRpcProxyException( errMsg );
}
Object targetBean = null;
try {
targetBean = serviceManager.getServiceBean( "gwt", key ); //$NON-NLS-1$
} catch ( ServiceException e ) {
throw new GwtRpcProxyException( Messages.getInstance().getErrorString(
"GwtRpcPluginProxyServlet.ERROR_0002_FAILED_TO_GET_BEAN_REFERENCE", key ), e ); //$NON-NLS-1$
}