Package org.zkoss.zk.ui

Examples of org.zkoss.zk.ui.WebApp


  private Map _fieldsMap; //(class name, String[] of fields)
  private Map _threadLocalsMap; //(class name, ThreadLocal_Contents[] for fields)
  private final boolean _enabled; //whether event thread enabled

  public ThreadLocalListener() {
    final WebApp app = Executions.getCurrent().getDesktop().getWebApp();
    _fieldsMap = (Map) app.getAttribute("zkplus.util.ThreadLocalListener.fieldsMap");
    _enabled = app.getConfiguration().isEventThreadEnabled();
    if (_fieldsMap == null) {
      _fieldsMap = new HashMap(8);
      final String PREF = "zkplus.util.ThreadLocalListener.fieldsMap";
      app.setAttribute(PREF, _fieldsMap);
      //read preference
      String val = app.getConfiguration().getPreference("ThreadLocal", null);
      if (val == null)
        val = Library.getProperty(PREF);
      if (val != null) {
        final Collection klassSets = CollectionsX.parse(null, val, ';');
        for(Iterator its = klassSets.iterator(); its.hasNext(); ) {
View Full Code Here


  private static final Object SOMETHING = new Object();

  private final boolean _enabled; //whether event thread enabled

  public HibernateSessionContextListener() {
    final WebApp app = Executions.getCurrent().getDesktop().getWebApp();
    _enabled = app.getConfiguration().isEventThreadEnabled();
  }
View Full Code Here

 
  private Object[] _threadLocals = null;
  private final boolean _enabled; //whether event thread enabled

  public SpringTransactionSynchronizationListener() {
    final WebApp app = Executions.getCurrent().getDesktop().getWebApp();
    _enabled = app.getConfiguration().isEventThreadEnabled();
  }
View Full Code Here

  private static final Log log = Log.lookup(AcegiSecurityContextListener.class);
  private SecurityContext _context;
  private final boolean _enabled; //whether event thread enabled

  public AcegiSecurityContextListener() {
    final WebApp app = Executions.getCurrent().getDesktop().getWebApp();
    _enabled = app.getConfiguration().isEventThreadEnabled();
  }
View Full Code Here

   * @return false if the page is not found.
   */
  private void process(Session sess,
  HttpServletRequest request, HttpServletResponse response,
  PageDefinition pagedef, String path) throws ServletException, IOException {
    final WebApp wapp = sess.getWebApp();
    final WebAppCtrl wappc = (WebAppCtrl)wapp;

    final Desktop desktop =
      getWebManager().getDesktop(sess, request, response, path, true);
    if (desktop == null) //forward or redirect
View Full Code Here

    EntityManager em = initEntityManagerFactory(puName, properties).createEntityManager();
    return em;
  }

  private static WebApp getWebApp() {
    WebApp app = null;
    final Execution exec = Executions.getCurrent();
    if (exec != null) {
      final Desktop desktop = exec.getDesktop();
      if (desktop != null) {
        app = desktop.getWebApp();
View Full Code Here

      _desktops.disableExpunge(oldexp);
    }
  }
  private static void desktopDestroyed(Desktop desktop) {
    final Session sess = desktop.getSession();
    final WebApp wapp = desktop.getWebApp();
    ((DesktopCtrl)desktop).invokeDesktopCleanups();
    final Configuration config = wapp.getConfiguration();
    config.invokeDesktopCleanups(desktop);
      //Feature 1767347: call DesktopCleanup before desktopDestroyed
      //such that app dev has a chance to manipulate the desktop
    ((WebAppCtrl)wapp).getUiEngine().desktopDestroyed(desktop);
View Full Code Here

  //ServletContextAttributeListener//
  public void attributeAdded(ServletContextAttributeEvent evt) {
    final String name = evt.getName();
    if (!shallIgnore(name)) {
      final WebApp wapp = WebManager.getWebAppIfAny(evt.getServletContext());
      if (wapp instanceof SimpleWebApp)
        ((SimpleWebApp)wapp).getScopeListeners()
          .notifyAdded(name, evt.getValue());
    }
  }
View Full Code Here

    }
  }
  public void attributeRemoved(ServletContextAttributeEvent evt) {
    final String name = evt.getName();
    if (!shallIgnore(name)) {
      final WebApp wapp = WebManager.getWebAppIfAny(evt.getServletContext());
      if (wapp instanceof SimpleWebApp)
        ((SimpleWebApp)wapp).getScopeListeners()
          .notifyRemoved(name);
    }
  }
View Full Code Here

    }
  }
  public void attributeReplaced(ServletContextAttributeEvent evt) {
    final String name = evt.getName();
    if (!shallIgnore(name)) {
      final WebApp wapp = WebManager.getWebAppIfAny(evt.getServletContext());
      if (wapp instanceof SimpleWebApp)
        ((SimpleWebApp)wapp).getScopeListeners()
          .notifyReplaced(name, evt.getValue());
    }
  }
View Full Code Here

TOP

Related Classes of org.zkoss.zk.ui.WebApp

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.