Package org.apache.catalina

Examples of org.apache.catalina.LifecycleException


   public void start() throws LifecycleException
   {
      // Validate and update our current component state
      if (started)
      {
         throw new LifecycleException
            (sm.getString("authenticator.alreadyStarted"));
      }

      if (LOG.isDebugEnabled())
      {
         LOG.debug("ClusteredSSO:  starting, clusterManagerClass=" + this.clusterManagerClass +
         ", maxEmptyLife = " + maxEmptyLife + "ms, processExpiresInterval = " + processExpiresInterval +"ms");

      }

      // Attempt to create an SSOClusterManager
      createClusterManager(this.clusterManagerClass);

      lifecycle.fireLifecycleEvent(START_EVENT, null);
      started = true;

      if (ssoClusterManager != null)
      {
         try
         {
            ssoClusterManager.start();
         }
         catch (LifecycleException e)
         {
            throw e;
         }
         catch (Exception e)
         {
            throw new LifecycleException("Caught exception starting " +
                  this.clusterManagerClass, e);
         }
      }

   }
View Full Code Here


   public void stop() throws LifecycleException
   {
      // Validate and update our current component state
      if (!started)
      {
         throw new LifecycleException
            (sm.getString("authenticator.notStarted"));
      }

      if (ssoClusterManager != null)
      {
         try
         {
            ssoClusterManager.stop();
         }
         catch (LifecycleException e)
         {
            throw e;
         }
         catch (Exception e)
         {
            throw new LifecycleException("Caught exception stopping " +
                  ssoClusterManager.getClass().getSimpleName(), e);
         }
      }

      lifecycle.fireLifecycleEvent(STOP_EVENT, null);
View Full Code Here

            ssoClusterManager = mgr;
            clusterManagerClass = className;
         }
         catch (Throwable t)
         {
            throw new LifecycleException("Cannot create " +
               "SSOClusterManager using " +
               className, t);
         }
      }
      else
      {
         Iterator<SSOClusterManager> managers = ServiceLoader.load(SSOClusterManager.class).iterator();
        
         if (!managers.hasNext())
         {
            throw new LifecycleException("No service provider found: " + SSOClusterManager.class.getName());
         }
         SSOClusterManager mgr = managers.next();
         mgr.setSSOLocalManager(this);
         ssoClusterManager = mgr;
         clusterManagerClass = this.ssoClusterManager.getClass().getName();
      }

      if (started)
      {
         try
         {
            ssoClusterManager.start();
         }
         catch (LifecycleException e)
         {
            throw e;
         }
         catch (Exception e)
         {
            throw new LifecycleException("Caught exception stopping " +
                  ssoClusterManager.getClass().getSimpleName(), e);
         }
      }
   }
View Full Code Here

         ccm = (CachedConnectionManager) server.getAttribute(new ObjectName(ccmName), "Instance");
         tm = (TransactionManager) server.getAttribute(new ObjectName(tmName), "TransactionManager");
      }
      catch (Exception e)
      {
         throw new LifecycleException(e);
      }
     
      // TODO unshareable resources
      support.fireLifecycleEvent(START_EVENT, this);
   }
View Full Code Here

   public void start() throws LifecycleException
   {
      // ctxLoader is set upon construction and nullified during stop
      if (this.ctxLoader == null)
         throw new LifecycleException("WebCtxLoader cannot be restarted");

      if (injectionContainer != null)
      {
         log.debug("injectionContainer enabled and processing beginning with JBoss WebCtxLoader");
         // we need to do this because the classloader is initialize by the web container and
View Full Code Here

   {
      log_.debug("Starting JBossManager");

      // Validate and update our current component state
      if (started_)
         throw new LifecycleException("JBossManager alreadyStarted");
     
      backgroundProcessAllowed.set(true);
     
      lifecycle_.fireLifecycleEvent(START_EVENT, null);
      started_ = true;
View Full Code Here

   {
      log_.debug("Stopping JBossManager");

      // Validate and update our current component state
      if (!started_)
         throw new LifecycleException
            ("JBossManager notStarted");
      lifecycle_.fireLifecycleEvent(STOP_EVENT, null);
      started_ = false;

      // unregister from the MBeanServer
View Full Code Here

            server.addNotificationListener(TomcatDeployer.TOMCAT_SERVICE_NAME, this, null, null);
         }
      }
      catch (Exception e)
      {
         throw new LifecycleException(e);
      }
     
      // Handle re-entrance
      if (!this.semaphore.tryAcquire())
      {
View Full Code Here

            server.removeNotificationListener(TomcatDeployer.TOMCAT_SERVICE_NAME, this);
         }
      }
      catch (Exception e)
      {
         throw new LifecycleException(e);
      }
     
      // Handle re-entrance
      if (this.semaphore.tryAcquire())
      {
         try
         {
            log_.debug("Closing off LockingValve");
           
            // Acquire all remaining permits, shutting off locking valve
            this.semaphore.acquire(TOTAL_PERMITS - 1);
         }
         catch (InterruptedException e)
         {
            Thread.currentThread().interrupt();
            this.semaphore.release();
           
            throw new LifecycleException(e);
         }
      }
     
      // Let subclasses clean up
      stopExtensions();
View Full Code Here

      }
      catch (Throwable t)
      {
         String str = "Problem starting DistributedCacheManager for HttpSession clustering";
         log_.error(str, t);
         throw new LifecycleException(str, t);
      }

      batchingManager = proxy_.getBatchingManager();
      if(batchingManager == null)
      {
         throw new LifecycleException("start(): Obtained null batchingManager");
      }
     
      try
      {        
         this.outdatedSessionChecker = initOutdatedSessionChecker();
         initializeUnloadedSessions();
        
         // Setup our SnapshotManager
         initSnapshotManager();

         // Add SnapshotValve and, if needed, JvmRouteValve and batch repl valve
         installValves();
        
         backgroundProcessAllowed.set(true);

         started_ = true;
        
         // Notify our interested LifecycleListeners
         lifecycle_.fireLifecycleEvent(AFTER_START_EVENT, this);
        
         // Let subclasses do what they want
         startExtensions();
        
         log_.debug("start(): DistributedCacheManager started");
      }
      catch (Exception e)
      {
         log_.error("Unable to start manager.", e);
         throw new LifecycleException(e);
      }
     
      registerManagerMBean();
   }
View Full Code Here

TOP

Related Classes of org.apache.catalina.LifecycleException

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.