Package org.springframework.util

Examples of org.springframework.util.StopWatch.start()


  public void runTask(Runnable task) {
    StopWatch watch = null;
    if (log.isDebug()) {
      watch = new StopWatch();
      watch.start();
    }   
    threadPool.execute(task);
   
    if (log.isDebug()) watch.stop();
    if (log.isDebug()) log.debug("Current size of queue is: "+queue.size()+". Running last task took (ms): "+watch.getTotalTimeMillis());
View Full Code Here


   */
  public Object invoke() {
    StopWatch sw = null;
    if (logger.isDebugEnabled()) {
      sw = new StopWatch();
      sw.start();
    }
    Object retValue = null;
    if (bean instanceof GroovyObject) {
      retValue = ((GroovyObject) bean).invokeMethod(method.getName(), arguments);
    } else {
View Full Code Here

  }

  @Override
  public Message<?> preSend(Message<?> message, MessageChannel channel) {
    StopWatch stopWatch = new StopWatch();
    stopWatch.start();
    this.stopWatchHolder.set(new StopWatchHolder(stopWatch, message.getPayload().getClass()));
    return super.preSend(message, channel);
  }

  @Override
View Full Code Here

  public class PerformanceMonitorInterceptor implements MethodInterceptor, Serializable {

    public Object invoke(MethodInvocation invocation) throws Throwable {
      String name = invocation.getMethod().getDeclaringClass().getName() + "." + invocation.getMethod().getName();
      StopWatch sw = new StopWatch(name);
      sw.start(name);
      try {
        return invocation.proceed();
      }
      finally {
        sw.stop();
View Full Code Here

  public class PerformanceMonitorInterceptor implements MethodInterceptor, Serializable {

    public Object invoke(MethodInvocation invocation) throws Throwable {
      String name = invocation.getMethod().getDeclaringClass().getName() + "." + invocation.getMethod().getName();
      StopWatch sw = new StopWatch(name);
      sw.start(name);
      try {
        return invocation.proceed();
      }
      finally {
        sw.stop();
View Full Code Here

        long sum = 0;

        for (int i=0; i<100; i++) {
            StopWatch sw = new StopWatch();
            sw.start();
            template.generate(model);
            sw.stop();
            sum += sw.getTotalTimeMillis();
        }
View Full Code Here

  public Object invoke(MethodInvocation invocation) throws Throwable {
    if (this.isEnabled) {
      StopWatch sw = new StopWatch(invocation.getMethod().getName());

      sw.start("invoke");
      try {
        return invocation.proceed();
      }
      finally {
        sw.stop();
View Full Code Here

            catch (InvocationTargetException ignored) {}

            ContactManager remoteContactManager = contactServices.get(beanName);
            System.out.println("Calling ContactManager '" + beanName + "'");

            stopWatch.start(beanName);

            List<Contact> contacts = null;

            for (int i = 0; i < nrOfCalls; i++) {
                contacts = remoteContactManager.getAll();
View Full Code Here

    // Method for use with profiler
    @Test
    public void usingPrototypeDoesNotParsePointcutOnEachCall() {
        StopWatch sw = new StopWatch();
        sw.start();
        for (int i = 0; i < 1000; i++) {
            try {
                SessionRegistry reg = (SessionRegistry) ctx.getBean("sessionRegistryPrototype");
                reg.getAllPrincipals();
                fail("Expected AuthenticationCredentialsNotFoundException");
View Full Code Here

        for (int user=0; user < N_AUTHORITIES/10; user ++) {
            int nAuthorities = user == 0 ? 1 : user*10;
            SecurityContextHolder.getContext().setAuthentication(new UsernamePasswordAuthenticationToken("bob", "bobspassword", createRoles(nAuthorities)));
            session.setAttribute(HttpSessionSecurityContextRepository.SPRING_SECURITY_CONTEXT_KEY, SecurityContextHolder.getContext());
            SecurityContextHolder.clearContext();
            sw.start(Integer.toString(nAuthorities) + " authorities");
            runWithStack(minimalStack);
            System.out.println(sw.shortSummary());
            sw.stop();
        }
        System.out.println(sw.prettyPrint());
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.