public Locale get() { Locale value = (Locale) rsacbl.getBeanLocator().locateBean(targetbean); return value; } }
/** * For a request-scope "blank" producer, fetches and returns the corresponding * request-scope bean. For any other producer, returns the argument unchanged. */ public ComponentProducer wrapProducer(ComponentProducer towrap) { String beanname = (String) componentMap.get(towrap); ComponentProducer togo = towrap; if (beanname != null) { togo = (ComponentProducer) rsacbl.getBeanLocator().locateBean(beanname); } return togo; }
private Object fetchBean(Map map, String viewID) { Object got = map.get(viewID); if (got instanceof String) { got = rsacbl.getBeanLocator().locateBean((String) got); } return got; }
public String get() { String value = (String) rsacbl.getBeanLocator().locateBean(targetbean); return value; }
protected void service(HttpServletRequest requst, HttpServletResponse response) { rsacbeanlocator.getBeanLocator().locateBean("rootHandlerBean"); } }
public Object getTarget() throws Exception { return rsacbl.getBeanLocator().locateBean(targetbean); }
private void fetchFallbacks() { fallbackbeans = new ArrayList(); for (int i = 0; i < fallbacks.size(); ++i) { String fallback = fallbacks.stringAt(i); FallbackBeanLocator fbl = (FallbackBeanLocator) wbl.locateBean(fallback); fallbackbeans.add(fbl); } }
/** Returns the request-scope bean with the given name, bound to the * standard RSAC locator within the application context bound to the * current thread. Only use this method in a genuine emergency! */ public static Object getRequestBean(String name) { RSACBeanLocator rsacbl = (RSACBeanLocator) getBean("RSACBeanLocator"); return rsacbl.getBeanLocator().locateBean(name); }
public Object locateBean(String path) { if (isPermitted(path)) { return wbl.locateBean(path); } else { reportImpermissiblePath(path); return null; } }
/** * Locates a particular request bean, assuming that a request is currently active. That * is, this is either a singleshot test, or that getRequestLauncher() has been invoked * without disposing the current RSAC. */ public Object locateRequestBean(String name) { return getRSACBeanLocator().getBeanLocator().locateBean(name); }
public Object locateBean(String path) { Object fetch = wbl.locateBean(path); if (fetch != null) { return fetch; } else { if (fallbackbeans == null) { fetchFallbacks(); } Object togo = tryLocateFallback(path); return togo; } }
public Object getObject() throws Exception { WriteableBeanLocator wbl = RSACbeanlocator.getDeadBeanLocator(); if (wbl.locateBean(beanName) != null) { throw new IllegalStateException("Incorrect use of EntityBeanLocator detected. " + "This implementation is designed to work only with the RSACBeanLocator, " + "and must cause the delivered BeanLocator to be immediately cached " + "in the RSAC on first use per request"); } EntityBeanLocatorImpl togo = new EntityBeanLocatorImpl(this); wbl.set(beanName, togo); if (entityClazz == null) { Object newsample = togo.locateBean(EntityBeanLocator.NEW_PREFIX); entityClazz = newsample.getClass(); } return togo; }
public void invokeRunnable(Runnable towrap) { TargettedMessageList tml = (TargettedMessageList) rsacbeanlocator .getBeanLocator().locateBean(tmlbeanname); ThreadErrorState.beginRequest(); ErrorStateEntry ese = ThreadErrorState.getErrorState(); ese.messages = tml; try { towrap.run(); } finally { ThreadErrorState.endRequest(); } }
protected void service(HttpServletRequest request, HttpServletResponse response) { RSACUtils.startServletRequest(request, response, rsacbeanlocator, RSACUtils.HTTP_SERVLET_FACTORY); try { rsacbeanlocator.getBeanLocator().locateBean("rootHandlerBean"); } catch (Throwable t) { // Catch and log this here because Tomcat's stack rendering is // non-standard and crummy. Logger.log.error("Error servicing RSAC request: ", t); if (t instanceof Error) { throw ((Error) t); } } finally { rsacbeanlocator.endRequest(); } } }
context.locateBean("rootHandlerBean"); togo.requestContext = rsacbl.getDeadBeanLocator(); togo.ARIResult = (ARIResult) rsacbl.getBeanLocator().locateBean("ARIResultConcrete"); RSFActionHandler actionHandler = (RSFActionHandler) rsacbl.getBeanLocator().locateBean("actionHandler"); togo.actionResult = actionHandler.getActionResult();
context.locateBean("rootHandlerBean"); togo.viewWrapper = new ViewWrapper(viewRender.getView().viewroot, smc); BareRootHandlerBean brhb = (BareRootHandlerBean) context.locateBean("rootHandlerBean"); StringGetter response = (StringGetter) context.locateBean("servletResponseFactory"); String directMarkup = response.get(); if (directMarkup.length() == 0) {
public void run() { rsacbl.startRequest(); try { WriteableBeanLocator wbl = rsacbl.getBeanLocator(); BeanUtil.copyBeans(seedbeans, wbl); BeanUtil.copyBeans(newbeans, wbl); wbl.locateBean(rootbeanname); } catch (Exception e) { throw UniversalRuntimeException.accumulate(e, "Error servicing RSACLazarus request"); } finally { rsacbl.endRequest(); } } };
public static void startServletRequest(HttpServletRequest request, HttpServletResponse response, RSACBeanLocator rsacbl, String factorybeanname) { // Logger.log.info("Got rsacbg " + rsacbl); if (!rsacbl.isStarted()) { rsacbl.startRequest(); } WriteableBeanLocator locator = rsacbl.getBeanLocator(); HttpServletFactory factory = (HttpServletFactory) locator.locateBean(factorybeanname); factory.setHttpServletRequest(request); factory.setHttpServletResponse(response); locator.set(factorybeanname, factory); // notify the "seed list" of the change. setRequestApplicationContext(request, locator); }
public void handleAccess(HttpServletRequest req, HttpServletResponse res, EntityReference reference, WBLAcceptor acceptor) { try { rsacbl.startRequest(); // A request bean locator just good for this request. WriteableBeanLocator rbl = rsacbl.getBeanLocator(); // inchuck entityReference rbl.set("sakai-EntityReference", reference.toString()); if (acceptor != null) { acceptor.acceptWBL(rbl); } RSACUtils.startServletRequest(wrapRequest(req), res, rsacbl, RSACUtils.HTTP_SERVLET_FACTORY); // pass the request to RSF. rbl.locateBean("rootHandlerBean"); } catch (Exception t) { // Access servlet performs no useful logging, do it here. Logger.log.error("Error handling access request", t); Throwable unwrapped = UniversalRuntimeException.unwrapException(t); if (unwrapped instanceof RuntimeException) { throw ((RuntimeException) unwrapped); } else throw UniversalRuntimeException.accumulate(unwrapped, "Error handling access request"); } finally { rsacbl.endRequest(); } }
public void handleAccess(HttpServletRequest req, HttpServletResponse res, EntityReference reference, WBLAcceptor acceptor) { try { rsacbl.startRequest(); // A request bean locator just good for this request. WriteableBeanLocator rbl = rsacbl.getBeanLocator(); // inchuck entityReference rbl.set("sakai-EntityReference", reference.toString()); if (acceptor != null) { acceptor.acceptWBL(rbl); } RSACUtils.startServletRequest(wrapRequest(req), res, rsacbl, RSACUtils.HTTP_SERVLET_FACTORY); // pass the request to RSF. rbl.locateBean("rootHandlerBean"); } catch (Exception t) { // Access servlet performs no useful logging, do it here. Logger.log.error("Error handling access request", t); Throwable unwrapped = UniversalRuntimeException.unwrapException(t); if (unwrapped instanceof RuntimeException) { throw ((RuntimeException) unwrapped); } else throw UniversalRuntimeException.accumulate(unwrapped, "Error handling access request"); } finally { rsacbl.endRequest(); } }