Package org.apache.catalina

Examples of org.apache.catalina.Lifecycle


      String type = event.getType();
      if (Lifecycle.BEFORE_STOP_EVENT.equals(type)
            || Lifecycle.STOP_EVENT.equals(type)
            || Lifecycle.AFTER_STOP_EVENT.equals(type))
      {
         Lifecycle source = event.getLifecycle();
         boolean removed;
         if (source instanceof ManagerBase)
         {
            removed = activeManagers.remove(((ManagerBase)source).getObjectName());
         }
         else if (source instanceof JBossManager)
         {
            removed = activeManagers.remove(((JBossManager)source).getObjectName());
         }
         else
         {
            removed = activeManagers.remove(source);
         }
        
         if (removed)
         {
            source.removeLifecycleListener(this);
           
            LOG.debug("ClusteredSSO: removed stopped " +
                                             "manager " + source.toString());           
         }
        
         // TODO consider getting the sessions and removing any from our sso's
         // Idea is to cleanup after managers that don't destroy sessions
        
View Full Code Here


      Object[] args = {};
      String[] sig = {};
      Connector[] connectors = (Connector[]) server.invoke(service, "findConnectors", args, sig);
      for (int n = 0; n < connectors.length; n++)
      {
         Lifecycle lc = connectors[n];
         lc.start();
      }
      connectorsRunning = true;

      // Notify listeners that connectors have started processing requests
      sendNotification(new Notification(TOMCAT_CONNECTORS_STARTED, this, getNextNotificationSequenceNumber()));
View Full Code Here

      }
     
      Container container = this.getContainer();
      if (container instanceof Lifecycle)
      {
         Lifecycle lifecycle = (Lifecycle) container;
         LifecycleListener[] listeners = lifecycle.findLifecycleListeners();
        
         // Remove existing listeners
         for (LifecycleListener listener: listeners)
         {
            lifecycle.removeLifecycleListener(listener);
         }
        
         // Register our listener first
         lifecycle.addLifecycleListener(this);
        
         // Re-register the old listeners
         for (LifecycleListener listener: listeners)
         {
            lifecycle.addLifecycleListener(listener);
         }
      }

      try
      {
View Full Code Here

   /** . */
   private TC6ServletContainerContext containerContext;

   public synchronized void lifecycleEvent(LifecycleEvent event)
   {
      Lifecycle lifecycle = event.getLifecycle();

      //
      if (lifecycle instanceof Server)
      {
         Server server = (Server)lifecycle;
View Full Code Here

      String type = event.getType();
      if (Lifecycle.BEFORE_STOP_EVENT.equals(type)
            || Lifecycle.STOP_EVENT.equals(type)
            || Lifecycle.AFTER_STOP_EVENT.equals(type))
      {
         Lifecycle source = event.getLifecycle();
         boolean removed;
         if (source instanceof ManagerBase)
         {
            removed = activeManagers.remove(((ManagerBase)source).getObjectName());
         }
         else if (source instanceof JBossManager)
         {
            removed = activeManagers.remove(((JBossManager)source).getObjectName());
         }
         else
         {
            removed = activeManagers.remove(source);
         }
        
         if (removed)
         {
            source.removeLifecycleListener(this);
           
            getContainer().getLogger().debug("ClusteredSSO: removed stopped " +
                                             "manager " + source.toString());           
         }
        
         // TODO consider getting the sessions and removing any from our sso's
         // Idea is to cleanup after managers that don't destroy sessions
        
View Full Code Here

            throw new LifecycleException(MESSAGES.failToStartManager(), e);
        }

        Container container = this.getContainer();
        if (container instanceof Lifecycle) {
            Lifecycle lifecycle = (Lifecycle) container;
            LifecycleListener[] listeners = lifecycle.findLifecycleListeners();

            // Remove existing listeners
            for (LifecycleListener listener : listeners) {
                lifecycle.removeLifecycleListener(listener);
            }

            // Register our listener first
            lifecycle.addLifecycleListener(this);

            // Re-register the old listeners
            for (LifecycleListener listener : listeners) {
                lifecycle.addLifecycleListener(listener);
            }
        }

        // Handle re-entrance
        if (!this.semaphore.tryAcquire()) {
View Full Code Here

    @Override
    public void lifecycleEvent(LifecycleEvent event) {
        String type = event.getType();
        if (Lifecycle.BEFORE_STOP_EVENT.equals(type) || Lifecycle.STOP_EVENT.equals(type) || Lifecycle.AFTER_STOP_EVENT.equals(type)) {
            Lifecycle source = event.getLifecycle();
            boolean removed = activeManagers.remove(source);

            if (removed) {
                source.removeLifecycleListener(this);

                WebLogger.WEB_SSO_LOGGER.tracef("ClusteredSSO: removed stopped manager %s", source);
            }

            // TODO consider getting the sessions and removing any from our sso's
View Full Code Here

      Object[] args = {};
      String[] sig = {};
      Connector[] connectors = (Connector[]) server.invoke(service, "findConnectors", args, sig);
      for (int n = 0; n < connectors.length; n++)
      {
         Lifecycle lc = connectors[n];
         lc.start();
      }
      /*
       * TODO: // Notify listeners that connectors have started processing requests sendNotification(new
       * Notification(TOMCAT_CONNECTORS_STARTED, this, getNextNotificationSequenceNumber()));
       */
 
View Full Code Here

        Class clazz = Class.forName(className);
        LifecycleListener listener =
            (LifecycleListener) clazz.newInstance();

        // Add this LifecycleListener to our associated component
        Lifecycle lifecycle = (Lifecycle) digester.peek();
        lifecycle.addLifecycleListener(listener);

    }
View Full Code Here

        Class clazz = Class.forName(className);
        LifecycleListener listener =
            (LifecycleListener) clazz.newInstance();

        // Add this LifecycleListener to our associated component
        Lifecycle lifecycle = (Lifecycle) digester.peek();
        lifecycle.addLifecycleListener(listener);

    }
View Full Code Here

TOP

Related Classes of org.apache.catalina.Lifecycle

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.