001    /*
002     * (c) 2003-2005, 2009, 2010 ThoughtWorks Ltd
003     * All rights reserved.
004     *
005     * The software in this package is published under the terms of the BSD
006     * style license a copy of which has been included with this distribution in
007     * the LICENSE.txt file.
008     * 
009     * Created on 11-May-2004
010     */
011    package com.thoughtworks.proxy.toys.hotswap;
012    
013    /**
014     * Interface implemented by all proxy instances created by {@link HotSwappingInvoker}.
015     *
016     * @author Aslak Hellesøy
017     * @since 0.1
018     */
019    public interface Swappable {
020        /**
021         * Swaps the subject behind the proxy with a new instance.
022         *
023         * @param newSubject the new subject the proxy will delegate to.
024         * @return the old subject
025         * @since 0.1
026         */
027        Object hotswap(Object newSubject);
028    }