/** * @param bMustBePresent * if <code>true</code> the scope must be present, <code>false</code> * if it may be <code>null</code>. * @return The scope to be used for this type of singleton. */ @Nonnull private static IGlobalWebScope _getStaticScope (final boolean bMustBePresent) { return bMustBePresent ? WebScopeManager.getGlobalScope () : WebScopeManager.getGlobalScopeOrNull (); }
/** * Public no argument constructor must be available. */ public ReIndexJob () { // Save to avoid global scope access m_aSC = WebScopeManager.getGlobalScope ().getServletContext (); }
public WebScoped () { this (new OfflineHttpServletRequest (WebScopeManager.getGlobalScope ().getServletContext (), false)); }
return bCreateIfNotExisting ? WebScopeManager.getGlobalScope () : WebScopeManager.getGlobalScopeOrNull (); case SESSION: return WebScopeManager.getSessionScope (bCreateIfNotExisting);
/** * @return The dummy HTTP request to be used for executing this job. By * default an {@link OfflineHttpServletRequest} is created. */ @Nonnull @OverrideOnDemand protected MockHttpServletRequest createMockHttpServletRequest () { // Don't use "MockServletContext" to avoid that the global Servlet Context // Path is overriden! final OfflineHttpServletRequest ret = new OfflineHttpServletRequest (WebScopeManager.getGlobalScope () .getServletContext (), false); // Use a fixed session ID, because Quartz jobs regularly use the session and // this avoids spanning too many sessions ret.setSessionID ("quartz.job." + ClassHelper.getClassLocalName (getClass ())); return ret; }
@Override protected void fillContent (@Nonnull final WPECTYPE aWPEC) { final HCNodeList aNodeList = aWPEC.getNodeList (); final Locale aDisplayLocale = aWPEC.getDisplayLocale (); final IGlobalWebScope aGlobalScope = WebScopeManager.getGlobalScope (); // Refresh button final BootstrapButtonToolbar aToolbar = new BootstrapButtonToolbar (aWPEC); aToolbar.addButton (EPhotonCoreText.BUTTON_REFRESH.getDisplayText (aDisplayLocale), aWPEC.getSelfHref (), EDefaultIcon.REFRESH); aNodeList.addChild (aToolbar); // Global scope aNodeList.addChild (_getGlobalScopeInfo (aWPEC, aGlobalScope)); } }
@Override protected void fillContent (@Nonnull final WPECTYPE aWPEC) { final HCNodeList aNodeList = aWPEC.getNodeList (); final Locale aDisplayLocale = aWPEC.getDisplayLocale (); final IGlobalWebScope aGlobalScope = WebScopeManager.getGlobalScope (); // Refresh button final BootstrapButtonToolbar aToolbar = new BootstrapButtonToolbar (aWPEC); aToolbar.addButton (EPhotonCoreText.BUTTON_REFRESH.getDisplayText (aDisplayLocale), aWPEC.getSelfHref (), EDefaultIcon.REFRESH); aNodeList.addChild (aToolbar); // Global scope aNodeList.addChild (_getGlobalScopeInfo (aWPEC, aGlobalScope)); } }
aNodeList.addChild (aToolbar); final ServletContext aSC = WebScopeManager.getGlobalScope ().getServletContext ();
aNodeList.addChild (aToolbar); final ServletContext aSC = WebScopeManager.getGlobalScope ().getServletContext ();