Examples of Watchdog


Examples of com.ecyrd.jspwiki.util.WatchDog

    public void doFilter( ServletRequest  request,
                          ServletResponse response,
                          FilterChain     chain )
        throws ServletException, IOException
    {
        WatchDog w = m_engine.getCurrentWatchDog();
        try
        {
            NDC.push( m_engine.getApplicationName()+":"+((HttpServletRequest)request).getRequestURI() );

            w.enterState("Filtering for URL "+((HttpServletRequest)request).getRequestURI(), 90 );
            HttpServletResponseWrapper responseWrapper;
        
            if( m_useOutputStream )
            {
                log.debug( "Using ByteArrayResponseWrapper" );
                responseWrapper = new ByteArrayResponseWrapper( (HttpServletResponse)response );
            }
            else
            {
                log.debug( "Using MyServletResponseWrapper" );
                responseWrapper = new MyServletResponseWrapper( (HttpServletResponse)response );
               
            }
       
            // fire PAGE_REQUESTED event
            String pagename = DefaultURLConstructor.parsePageFromURL(
                    (HttpServletRequest)request, response.getCharacterEncoding() );
            fireEvent( WikiPageEvent.PAGE_REQUESTED, pagename );

            super.doFilter( request, responseWrapper, chain );

            // The response is now complete. Lets replace the markers now.
       
            // WikiContext is only available after doFilter! (That is after
            //   interpreting the jsp)

            try
            {
                w.enterState( "Delivering response", 30 );
                WikiContext wikiContext = getWikiContext( request );
                String r = filter( wikiContext, responseWrapper );
       
                //String encoding = "UTF-8";
                //if( wikiContext != null ) encoding = wikiContext.getEngine().getContentEncoding();
       
                // Only now write the (real) response to the client.
                // response.setContentLength(r.length());
                // response.setContentType(encoding);
               
                response.getWriter().write(r);
           
                // Clean up the UI messages and loggers
                if( wikiContext != null )
                {
                    wikiContext.getWikiSession().clearMessages();
                }

                // fire PAGE_DELIVERED event
                fireEvent( WikiPageEvent.PAGE_DELIVERED, pagename );

            }
            finally
            {
                w.exitState();
            }
        }
        finally
        {
            w.exitState();
            NDC.pop();
            NDC.remove();
        }
    }
View Full Code Here

Examples of jetbrains.communicator.util.WatchDog

    char buf [] = new char[100000];
    Arrays.fill(buf, 'd');
    myIdeFacade.setReturnedFileText(vFile, new String(buf));

    WatchDog s = new WatchDog("get 100000 bytes file");
    mySelf.getVFile(vFile, myIdeFacade);
    s.stop();

    assertEquals("Should successfully return file text", new String(buf), vFile.getContents() );
  }
View Full Code Here

Examples of jetbrains.communicator.util.WatchDog

        myDispatcher.sendNow(myUser, new MockMessage(date));
      }
      Thread.sleep(SAVE_WAIT_TIMEOUT*2);


      WatchDog watchDog = new WatchDog("Load history");
      LocalMessageDispatcherImpl localMessageDispatcher = createLocalMessageDispatcher();
      LocalMessage[] messages = localMessageDispatcher.getHistory(myUser, yesterday());
      assertEquals(1000, messages.length);

      long diff = watchDog.diff();
      watchDog.watchAndReset("done");
      assertTrue("Too long getting history:" + diff, diff < 1500);

      messages = localMessageDispatcher.getHistory(myUser, null);
      assertEquals(1000, messages.length);

      diff = watchDog.diff();
      watchDog.watchAndReset("again done");
      assertTrue("Too long getting history second time:" + diff, diff < 100);

    } finally {
      logger.setLevel(oldLevel);
    }
View Full Code Here

Examples of org.apache.james.util.watchdog.Watchdog

     */
    protected ConnectionHandler newHandler()
            throws Exception {
        NNTPHandler theHandler = (NNTPHandler)theHandlerPool.get();

        Watchdog theWatchdog = theWatchdogFactory.getWatchdog(theHandler.getWatchdogTarget());

        theHandler.setConfigurationData(theConfigData);
        theHandler.setWatchdog(theWatchdog);
        return theHandler;
    }
View Full Code Here

Examples of org.apache.james.util.watchdog.Watchdog

        SMTPHandler theHandler = (SMTPHandler)theHandlerPool.get();

        if (getLogger().isDebugEnabled()) {
            getLogger().debug("Getting SMTPHandler from pool.");
        }
        Watchdog theWatchdog = theWatchdogFactory.getWatchdog(theHandler.getWatchdogTarget());

        theHandler.setConfigurationData(theConfigData);

        theHandler.setWatchdog(theWatchdog);
        return theHandler;
View Full Code Here

Examples of org.apache.james.util.watchdog.Watchdog

    protected ConnectionHandler newHandler()
            throws Exception
    {
        ImapHandler theHandler = ( ImapHandler ) theHandlerPool.get();

        Watchdog theWatchdog = theWatchdogFactory.getWatchdog( theHandler.getWatchdogTarget() );

        theHandler.setConfigurationData( theConfigData );

        theHandler.setWatchdog( theWatchdog );
View Full Code Here

Examples of org.apache.james.util.watchdog.Watchdog

    protected ConnectionHandler newHandler()
            throws Exception {
        RemoteManagerHandler theHandler = (RemoteManagerHandler)theHandlerPool.get();
        theHandler.enableLogging(getLogger());

        Watchdog theWatchdog = theWatchdogFactory.getWatchdog(theHandler.getWatchdogTarget());

        theHandler.setConfigurationData(theConfigData);
        theHandler.setWatchdog(theWatchdog);
        return theHandler;
    }
View Full Code Here

Examples of org.apache.james.util.watchdog.Watchdog

     */
    protected ConnectionHandler newHandler()
            throws Exception {
        POP3Handler theHandler = (POP3Handler)theHandlerPool.get();

        Watchdog theWatchdog = theWatchdogFactory.getWatchdog(theHandler.getWatchdogTarget());

        theHandler.setConfigurationData(theConfigData);

        theHandler.setWatchdog(theWatchdog);

View Full Code Here

Examples of org.apache.james.util.watchdog.Watchdog

     */
    protected ConnectionHandler newHandler()
            throws Exception {
        NNTPHandler theHandler = (NNTPHandler)theHandlerPool.get();

        Watchdog theWatchdog = theWatchdogFactory.getWatchdog(theHandler.getWatchdogTarget());

        theHandler.setConfigurationData(theConfigData);
        theHandler.setWatchdog(theWatchdog);
        return theHandler;
    }
View Full Code Here

Examples of org.apache.james.util.watchdog.Watchdog

     */
    protected ConnectionHandler newHandler()
            throws Exception {
        POP3Handler theHandler = (POP3Handler)theHandlerPool.get();

        Watchdog theWatchdog = theWatchdogFactory.getWatchdog(theHandler.getWatchdogTarget());

        theHandler.setConfigurationData(theConfigData);

        theHandler.setWatchdog(theWatchdog);

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.