class StepScope extends BatchScopeSupport {

	private static final String TARGET_NAME_PREFIX = "scopedTarget.";

	private final Log logger = LogFactory.getLog(getClass());

	private final Object mutex = new Object();

	/**
	 * Context key for clients to use for conversation identifier.
	 */
	public static final String ID_KEY = "STEP_IDENTIFIER";

	public StepScope() {
		super();
		setName("step");
	}

	/**
	 * This will be used to resolve expressions in step-scoped beans.
	 */
	@Override
	public Object resolveContextualObject(String key) {
		StepContext context = getContext();
		// TODO: support for attributes as well maybe (setters not exposed yet
		// so not urgent).
		return new BeanWrapperImpl(context).getPropertyValue(key);
	}

	/**
	 * @see Scope#get(String, ObjectFactory)
	 */
	@Override
	public Object get(String name, ObjectFactory<?> objectFactory) {
		StepContext context = getContext();
		Object scopedObject = context.getAttribute(name);

		if (scopedObject == null) {

			synchronized (mutex) {
				scopedObject = context.getAttribute(name);
				if (scopedObject == null) {

					if (logger.isDebugEnabled()) {
						logger.debug(String.format("Creating object in scope=%s, name=%s", this.getName(), name));
					}

					scopedObject = objectFactory.getObject();
					context.setAttribute(name, scopedObject);

				}

			}

		}
		return scopedObject;
	}

	/**
	 * @see Scope#getConversationId()
	 */
	@Override
	public String getConversationId() {
		StepContext context = getContext();
		return context.getId();
	}

	/**
	 * @see Scope#registerDestructionCallback(String, Runnable)
	 */
	@Override
	public void registerDestructionCallback(String name, Runnable callback) {<FILL_FUNCTION_BODY>}

	/**
	 * @see Scope#remove(String)
	 */
	@Override
	public Object remove(String name) {
		StepContext context = getContext();
		if (logger.isDebugEnabled()) {
			logger.debug(String.format("Removing from scope=%s, name=%s", this.getName(), name));
		}
		return context.removeAttribute(name);
	}

	/**
	 * Get an attribute accessor in the form of a {@link StepContext} that can be used to
	 * store scoped bean instances.
	 * @return the current step context which we can use as a scope storage medium
	 */
	private StepContext getContext() {
		StepContext context = StepSynchronizationManager.getContext();
		if (context == null) {
			throw new IllegalStateException("No context holder available for step scope");
		}
		return context;
	}

	@Override
	public String getTargetNamePrefix() {
		return TARGET_NAME_PREFIX;
	}

}

		StepContext context = getContext();
		if (logger.isDebugEnabled()) {
			logger.debug(String.format("Registered destruction callback in scope=%s, name=%s", this.getName(), name));
		}
		context.registerDestructionCallback(name, callback);
	
<methods>public non-sealed void <init>() ,public java.lang.String getName() ,public int getOrder() ,public abstract java.lang.String getTargetNamePrefix() ,public void postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory) throws org.springframework.beans.BeansException,public void setAutoProxy(boolean) ,public void setName(java.lang.String) ,public void setOrder(int) ,public void setProxyTargetClass(boolean) <variables>private boolean autoProxy,private java.lang.String name,private int order,private boolean proxyTargetClass