Package org.zkoss.zk.ui.sys

Examples of org.zkoss.zk.ui.sys.DesktopCache


    if (dc != null) dc.sessionWillPassivate(sess);
  }
  /** Invokes {@link #getDesktopCache}'s {@link DesktopCache#sessionDidActivate}.
   */
  public void sessionDidActivate(Session sess) {
    final DesktopCache dc = ((SessionCtrl)sess).getDesktopCache();
    if (dc != null) dc.sessionDidActivate(sess);
  }
View Full Code Here


  private WebApp _wapp;

  //-- DesktopCacheProvider --//
  public DesktopCache getDesktopCache(Session sess) {
    final SessionCtrl sessCtrl = (SessionCtrl)sess;
    DesktopCache dc = sessCtrl.getDesktopCache();
    if (dc == null) {
      synchronized (this) {
        dc = sessCtrl.getDesktopCache();
        if (dc == null) {
          dc = new SimpleDesktopCache(_wapp.getConfiguration());
View Full Code Here

    }
    return dc;
  }
  public void sessionDestroyed(Session sess) {
    final SessionCtrl sessCtrl = (SessionCtrl)sess;
    final DesktopCache dc = sessCtrl.getDesktopCache();
    if (dc != null) {
      sessCtrl.setDesktopCache(null);
      dc.stop();
    }
  }
View Full Code Here

  }

  /** Invokes {@link #getDesktopCache}'s {@link DesktopCache#sessionWillPassivate}.
   */
  public void sessionWillPassivate(Session sess) {
    final DesktopCache dc = ((SessionCtrl)sess).getDesktopCache();
    if (dc != null) dc.sessionWillPassivate(sess);
  }
View Full Code Here

    private static final long serialVersionUID = 20060622L;

  //-- DesktopCacheProvider --//
  public DesktopCache getDesktopCache(Session sess) {
    final WebApp wapp = sess.getWebApp();
    DesktopCache dc = (DesktopCache)wapp.getAttribute(ATTR_CACHE);
    if (dc == null) {
      synchronized (this) {
        dc = (DesktopCache)wapp.getAttribute(ATTR_CACHE);
        if (dc == null) {
          dc = new SimpleDesktopCache(
View Full Code Here

  }

  /** Invokes {@link #getDesktopCache}'s {@link DesktopCache#sessionWillPassivate}.
   */
  public void sessionWillPassivate(Session sess) {
    DesktopCache dc = (DesktopCache)sess.getAttribute(ATTR_CACHE);
    if (dc != null) dc.sessionWillPassivate(sess);
  }
View Full Code Here

    if (dc != null) dc.sessionWillPassivate(sess);
  }
  /** Invokes {@link #getDesktopCache}'s {@link DesktopCache#sessionDidActivate}.
   */
  public void sessionDidActivate(Session sess) {
    DesktopCache dc = (DesktopCache)sess.getAttribute(ATTR_CACHE);
    if (dc != null) dc.sessionDidActivate(sess);
  }
View Full Code Here

  public void start(WebApp wapp) {
    //ignore it
  }
  public void stop(WebApp wapp) {
    DesktopCache dc = (DesktopCache)wapp.getAttribute(ATTR_CACHE);
    if (dc != null) {
      wapp.removeAttribute(ATTR_CACHE);
      dc.stop();
    }
  }
View Full Code Here

    final Configuration config = _wapp.getConfiguration();
    _exec = exec; //fake
    try {
      final WebAppCtrl wappc = (WebAppCtrl)_wapp;
      final DesktopCache dc = _sess != null ? wappc.getDesktopCache(_sess): null;
        //_sess is null if in a working thread
      final IdGenerator idgen = wappc.getIdGenerator();
      if (idgen != null)
        _id = idgen.nextDesktopId(this);
      if (_id == null)
        _id = nextDesktopId(dc);
      else if (idgen != null)
        ComponentsCtrl.checkUuid(_id);
      updateUuidPrefix();

      config.invokeDesktopInits(this, request); //it might throw exception
      if (exec != null && exec.isVoided()) return; //sendredirect or forward

      if (dc != null)
        dc.addDesktop(this); //add to cache after invokeDesktopInits

      final Monitor monitor = config.getMonitor();
      if (monitor != null) {
        try {
          monitor.desktopCreated(this);
View Full Code Here

      throw new IllegalStateException("Callable only in recovring");
    if (id == null || id.length() <= 1 || id.charAt(0) != 'g')
      throw new IllegalArgumentException("Invalid desktop ID. You have to recover to the original value, not creating a new value: "+id);

    //_sess and dc are null if in a working thread
    final DesktopCache dc = _sess != null ? ((WebAppCtrl)_wapp).getDesktopCache(_sess): null;
    if (dc != null)
      dc.removeDesktop(this);

    _id = id;
    updateUuidPrefix();

    if (dc != null)
      dc.addDesktop(this);
  }
View Full Code Here

TOP

Related Classes of org.zkoss.zk.ui.sys.DesktopCache

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.