/************************************************
 * Copyright (c) Shen Li. All rights reserved.  *
 * http://joyaop.sourceforge.net                *
 * -------------------------------------------- *
 * Distributable under LGPL license.            *
 * See terms of license at gnu.org.             *
 ************************************************/
package net.sf.joyaop.impl;

import net.sf.cglib.proxy.Callback;
import net.sf.joyaop.framework.AspectizedClass;

import java.util.Collections;

/**
 * @author Shen Li
 */
class OriginalClassCallbackFactory extends CallbackFactory {
    private final Callback cachedCallback;

    public OriginalClassCallbackFactory(AspectizedClass aspectizedClass) {
        this.cachedCallback = new CallbackImpl(
                Collections.EMPTY_LIST, null,
                needThreadLocalInvocation(aspectizedClass.getOriginalClass()));
    }

    public Callback getCallback(RuntimeAspectInstanceFactory factory) {
        return cachedCallback;
    }
}