Examples of registerDestructionCallback()


Examples of org.springframework.batch.core.scope.context.JobContext.registerDestructionCallback()

   */
  @Override
  public void registerDestructionCallback(String name, Runnable callback) {
    JobContext context = getContext();
    logger.debug(String.format("Registered destruction callback in scope=%s, name=%s", this.getName(), name));
    context.registerDestructionCallback(name, callback);
  }

  /**
   * @see Scope#remove(String)
   */
 
View Full Code Here

Examples of org.springframework.batch.core.scope.context.StepContext.registerDestructionCallback()

   */
  @Override
  public void registerDestructionCallback(String name, Runnable callback) {
    StepContext context = getContext();
    logger.debug(String.format("Registered destruction callback in scope=%s, name=%s", this.getName(), name));
    context.registerDestructionCallback(name, callback);
  }

  /**
   * @see Scope#remove(String)
   */
 
View Full Code Here

Examples of org.springframework.beans.factory.config.Scope.registerDestructionCallback()

        // A bean with a custom scope...
        Scope scope = (Scope) this.scopes.get(mbd.getScope());
        if (scope == null) {
          throw new IllegalStateException("No Scope registered for scope '" + mbd.getScope() + "'");
        }
        scope.registerDestructionCallback(beanName,
            new DisposableBeanAdapter(bean, beanName, mbd, getBeanPostProcessors()));
      }
    }
  }
View Full Code Here

Examples of org.springframework.beans.factory.config.Scope.registerDestructionCallback()

        // A bean with a custom scope...
        Scope scope = this.scopes.get(mbd.getScope());
        if (scope == null) {
          throw new IllegalStateException("No Scope registered for scope '" + mbd.getScope() + "'");
        }
        scope.registerDestructionCallback(beanName,
            new DisposableBeanAdapter(bean, beanName, mbd, getBeanPostProcessors(), acc));
      }
    }
  }
View Full Code Here

Examples of org.springframework.beans.factory.config.Scope.registerDestructionCallback()

        // A bean with a custom scope...
        Scope scope = this.scopes.get(mbd.getScope());
        if (scope == null) {
          throw new IllegalStateException("No Scope registered for scope '" + mbd.getScope() + "'");
        }
        scope.registerDestructionCallback(beanName,
            new DisposableBeanAdapter(bean, beanName, mbd, getBeanPostProcessors(), acc));
      }
    }
  }
View Full Code Here

Examples of org.springframework.beans.factory.config.Scope.registerDestructionCallback()

        // A bean with a custom scope...
        Scope scope = this.scopes.get(mbd.getScope());
        if (scope == null) {
          throw new IllegalStateException("No Scope registered for scope '" + mbd.getScope() + "'");
        }
        scope.registerDestructionCallback(beanName,
            new DisposableBeanAdapter(bean, beanName, mbd, getBeanPostProcessors(), acc));
      }
    }
  }
View Full Code Here

Examples of org.springframework.beans.factory.config.Scope.registerDestructionCallback()

            public Object getObject() throws BeansException {
              beforePrototypeCreation(beanName);
              try {
                Object bean = createBean(beanName, mbd, args);
                if (requiresDestruction(bean, mbd)) {
                  scope.registerDestructionCallback(beanName,
                      new DisposableBeanAdapter(bean, beanName, mbd, getBeanPostProcessors()));
                }
                return bean;
              }
              finally {
View Full Code Here

Examples of org.springframework.beans.factory.config.Scope.registerDestructionCallback()

        // A bean with a custom scope...
        Scope scope = (Scope) this.scopes.get(mbd.getScope());
        if (scope == null) {
          throw new IllegalStateException("No Scope registered for scope '" + mbd.getScope() + "'");
        }
        scope.registerDestructionCallback(beanName,
            new DisposableBeanAdapter(bean, beanName, mbd, getBeanPostProcessors()));
      }
    }
  }
View Full Code Here

Examples of org.springframework.beans.factory.config.Scope.registerDestructionCallback()

        // A bean with a custom scope...
        Scope scope = (Scope) this.scopes.get(mbd.getScope());
        if (scope == null) {
          throw new IllegalStateException("No Scope registered for scope '" + mbd.getScope() + "'");
        }
        scope.registerDestructionCallback(beanName,
            new DisposableBeanAdapter(bean, beanName, mbd, getBeanPostProcessors()));
      }
    }
  }
View Full Code Here

Examples of org.springframework.beans.factory.config.Scope.registerDestructionCallback()

        // A bean with a custom scope...
        Scope scope = this.scopes.get(mbd.getScope());
        if (scope == null) {
          throw new IllegalStateException("No Scope registered for scope '" + mbd.getScope() + "'");
        }
        scope.registerDestructionCallback(beanName,
            new DisposableBeanAdapter(bean, beanName, mbd, getBeanPostProcessors(), acc));
      }
    }
  }
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.