Examples of MultiException


Examples of org.eclipse.jetty.util.MultiException

    AccessLog[] oldLoggers = _loggers == null ? null : _loggers.clone();
    if (_server != null)
      _server.getContainer().update(this, oldLoggers, loggers, "loggers", true);
    _loggers = loggers;

    MultiException mex = new MultiException();
    for (int i = 0; oldLoggers != null && i < oldLoggers.length; i++)
    {
      if (oldLoggers[i] != null)
      {
        try
        {
          if (oldLoggers[i] instanceof LifeCycle)
          {
            LifeCycle lifeCycle = (LifeCycle) oldLoggers[i];
            if (lifeCycle.isStarted())
              lifeCycle.stop();
          }
        }
        catch (Throwable e)
        {
          mex.add(e);
        }
      }
    }
    if (isStarted())
      try { doStart(); } catch (Throwable e) { mex.add(e); }
   
    mex.ifExceptionThrowRuntime();
  }
View Full Code Here

Examples of org.eclipse.jetty.util.MultiException

       
  }
 
  protected void doStop() throws Exception
  {
    MultiException mx = new MultiException();
   
    try { super.doStop(); } catch(Exception e) { mx.add(e); }
     
    if (_sipServlets != null)
    {
          for (int i = _sipServlets.length; i-- > 0;)
          {
              try
              {
                _sipServlets[i].stop();
              }
              catch(Exception e)
              {
                  Log.warn(Log.EXCEPTION, e);
                  //mx.add(e);
              }
          }
    }
        mx.ifExceptionThrow()
  }
View Full Code Here

Examples of org.eclipse.jetty.util.MultiException

        }
  }
 
  public void initializeSip() throws Exception
  {
    MultiException mx = new MultiException();

    if (_sipServlets != null)
    {
          // Sort and Initialize servlets
          SipServletHolder[] servlets = (SipServletHolder[]) _sipServlets.clone();
          Arrays.sort(servlets);
          for (int i=0; i<servlets.length; i++)
          {
              try
              {
                  servlets[i].start();
              }
              catch(Exception e)
              {

                Log.debug(Log.EXCEPTION, e);
                  mx.add(e);
              }
          }
          mx.ifExceptionThrow()
    }
  }
View Full Code Here

Examples of org.glassfish.hk2.api.MultiException

          Object addMe;
          try {
              addMe = ReflectionHelper.invoke(annotation, annotationMethod, new Object[0]);
          }
          catch (Throwable th) {
              throw new MultiException(th);
          }
         
          if (addMe == null) continue;
         
          String addMeString;
View Full Code Here

Examples of org.glassfish.hk2.api.MultiException

                @Override
                public Class<?> loadClass(String className) throws MultiException {
                    try {
                        return binderClassLoader.loadClass(className);
                    } catch (ClassNotFoundException e) {
                        throw new MultiException(e);
                    }
                }
            };
        }
        return defaultLoader;
View Full Code Here

Examples of org.mortbay.util.MultiException

     * Called automatically from start if autoInitializeServlet is true.
     */
    public void initialize()
        throws Exception
    {
        MultiException mx = new MultiException();

        // Start filters
        if (_filters!=null)
        {
            for (int i=0;i<_filters.length; i++)
                _filters[i].start();
        }
       
        if (_servlets!=null)
        {
            // Sort and Initialize servlets
            ServletHolder[] servlets = (ServletHolder[])_servlets.clone();
            Arrays.sort(servlets);
            for (int i=0; i<servlets.length; i++)
            {
                try
                {
                    if (servlets[i].getClassName()==null && servlets[i].getForcedPath()!=null)
                    {
                        ServletHolder forced_holder = (ServletHolder)_servletPathMap.match(servlets[i].getForcedPath());
                        if (forced_holder==null || forced_holder.getClassName()==null)
                        {   
                            mx.add(new IllegalStateException("No forced path servlet for "+servlets[i].getForcedPath()));
                            continue;
                        }
                        servlets[i].setClassName(forced_holder.getClassName());
                    }
                   
                    servlets[i].start();
                }
                catch(Throwable e)
                {
                    Log.debug(Log.EXCEPTION,e);
                    mx.add(e);
                }
            }
            mx.ifExceptionThrow()
        }
    }
View Full Code Here

Examples of org.mortbay.util.MultiException

    /* ------------------------------------------------------------ */
    protected void doStart() throws Exception
    {
        Log.info("jetty-"+_version);
        HttpGenerator.setServerVersion(_version);
        MultiException mex=new MultiException();
     
        for (int i=0;_realms !=null && i<_realms.length; i++)
        {
            if (_realms[i] instanceof LifeCycle)
                ((LifeCycle)_realms[i]).start();
        }

        Iterator itor = _dependentLifeCycles.iterator();
        while (itor.hasNext())
        {  
            try
            {
                ((LifeCycle)itor.next()).start();
            }
            catch (Throwable e) {mex.add(e);}
        }
       
        if (_threadPool==null)
        {
            BoundedThreadPool btp=new BoundedThreadPool();
            setThreadPool(btp);
        }
       
        if (_sessionIdManager!=null)
            _sessionIdManager.start();
       
        try
        {
            if (_threadPool instanceof LifeCycle)
                ((LifeCycle)_threadPool).start();
        }
        catch(Throwable e) { mex.add(e);}
       
        try
        {
            super.doStart();
        }
        catch(Throwable e)
        {
            Log.warn("Error starting handlers",e);
        }
       
        if (_connectors!=null)
        {
            for (int i=0;i<_connectors.length;i++)
            {
                try{_connectors[i].start();}
                catch(Throwable e)
                {
                    mex.add(e);
                }
            }
        }
        mex.ifExceptionThrow();
    }
View Full Code Here

Examples of org.mortbay.util.MultiException

    }

    /* ------------------------------------------------------------ */
    protected void doStop() throws Exception
    {
        MultiException mex=new MultiException();
       
        for (int i=0;_realms !=null && i<_realms.length; i++)
        {
            if (_realms[i] instanceof LifeCycle)
                ((LifeCycle)_realms[i]).stop();
        }
       
        if (_graceful>0)
        {
            if (_connectors!=null)
            {
                for (int i=_connectors.length;i-->0;)
                {
                    Log.info("Graceful shutdown {}",_connectors[i]);
                    try{_connectors[i].close();}catch(Throwable e){mex.add(e);}
                }
            }
           
            Handler[] contexts = getChildHandlersByClass(Graceful.class);
            for (int c=0;c<contexts.length;c++)
            {
                Graceful context=(Graceful)contexts[c];
                Log.info("Graceful shutdown {}",context);
                context.setShutdown(true);
            }
            Thread.sleep(_graceful);
        }
       
        if (_connectors!=null)
        {
            for (int i=_connectors.length;i-->0;)
                try{_connectors[i].stop();}catch(Throwable e){mex.add(e);}
        }

        try {super.doStop(); } catch(Throwable e) { mex.add(e);}
       
        if (_sessionIdManager!=null)
            _sessionIdManager.stop();
       
        try
        {
            if (_threadPool instanceof LifeCycle)
                ((LifeCycle)_threadPool).stop();
        }
        catch(Throwable e){mex.add(e);}
       
        if (!_dependentLifeCycles.isEmpty())
        {
            ListIterator itor = _dependentLifeCycles.listIterator(_dependentLifeCycles.size());
            while (itor.hasPrevious())
            {
                try
                {
                    ((LifeCycle)itor.previous()).stop();
                }
                catch (Throwable e) {mex.add(e);}
            }
        }
      
        mex.ifExceptionThrow();
    }
View Full Code Here

Examples of org.mortbay.util.MultiException

    /* ------------------------------------------------------------ */
    protected void doStart() throws Exception
    {
        Log.info("jetty-"+_version);
        HttpGenerator.setServerVersion(_version);
        MultiException mex=new MultiException();
     
        for (int i=0;_realms !=null && i<_realms.length; i++)
        {
            if (_realms[i] instanceof LifeCycle)
                ((LifeCycle)_realms[i]).start();
        }

        Iterator itor = _dependentLifeCycles.iterator();
        while (itor.hasNext())
        {  
            try
            {
                ((LifeCycle)itor.next()).start();
            }
            catch (Throwable e) {mex.add(e);}
        }
       
        if (_threadPool==null)
        {
            QueuedThreadPool tp=new QueuedThreadPool();
            setThreadPool(tp);
        }
       
        if (_sessionIdManager!=null)
            _sessionIdManager.start();
       
        try
        {
            if (_threadPool instanceof LifeCycle)
                ((LifeCycle)_threadPool).start();
        }
        catch(Throwable e) { mex.add(e);}
       
        try
        {
            super.doStart();
        }
        catch(Throwable e)
        {
            Log.warn("Error starting handlers",e);
        }
       
        if (_connectors!=null)
        {
            for (int i=0;i<_connectors.length;i++)
            {
                try{_connectors[i].start();}
                catch(Throwable e)
                {
                    mex.add(e);
                }
            }
        }
        mex.ifExceptionThrow();
    }
View Full Code Here

Examples of org.mortbay.util.MultiException

    }

    /* ------------------------------------------------------------ */
    protected void doStop() throws Exception
    {
        MultiException mex=new MultiException();
       
        for (int i=0;_realms !=null && i<_realms.length; i++)
        {
            if (_realms[i] instanceof LifeCycle)
                ((LifeCycle)_realms[i]).stop();
        }
       
        if (_graceful>0)
        {
            if (_connectors!=null)
            {
                for (int i=_connectors.length;i-->0;)
                {
                    Log.info("Graceful shutdown {}",_connectors[i]);
                    try{_connectors[i].close();}catch(Throwable e){mex.add(e);}
                }
            }
           
            Handler[] contexts = getChildHandlersByClass(Graceful.class);
            for (int c=0;c<contexts.length;c++)
            {
                Graceful context=(Graceful)contexts[c];
                Log.info("Graceful shutdown {}",context);
                context.setShutdown(true);
            }
            Thread.sleep(_graceful);
        }
       
        if (_connectors!=null)
        {
            for (int i=_connectors.length;i-->0;)
                try{_connectors[i].stop();}catch(Throwable e){mex.add(e);}
        }

        try {super.doStop(); } catch(Throwable e) { mex.add(e);}
       
        if (_sessionIdManager!=null)
            _sessionIdManager.stop();
       
        try
        {
            if (_threadPool instanceof LifeCycle)
                ((LifeCycle)_threadPool).stop();
        }
        catch(Throwable e){mex.add(e);}
       
        if (!_dependentLifeCycles.isEmpty())
        {
            ListIterator itor = _dependentLifeCycles.listIterator(_dependentLifeCycles.size());
            while (itor.hasPrevious())
            {
                try
                {
                    ((LifeCycle)itor.previous()).stop();
                }
                catch (Throwable e) {mex.add(e);}
            }
        }
      
        mex.ifExceptionThrow();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.