001/*
002 * Copyright 2002-2012 the original author or authors.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *      https://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017package org.springframework.context.weaving;
018
019import org.springframework.beans.factory.Aware;
020import org.springframework.instrument.classloading.LoadTimeWeaver;
021
022/**
023 * Interface to be implemented by any object that wishes to be notified
024 * of the application context's default {@link LoadTimeWeaver}.
025 *
026 * @author Juergen Hoeller
027 * @author Chris Beams
028 * @since 2.5
029 * @see org.springframework.context.ConfigurableApplicationContext#LOAD_TIME_WEAVER_BEAN_NAME
030 */
031public interface LoadTimeWeaverAware extends Aware {
032
033        /**
034         * Set the {@link LoadTimeWeaver} of this object's containing
035         * {@link org.springframework.context.ApplicationContext ApplicationContext}.
036         * <p>Invoked after the population of normal bean properties but before an
037         * initialization callback like
038         * {@link org.springframework.beans.factory.InitializingBean InitializingBean's}
039         * {@link org.springframework.beans.factory.InitializingBean#afterPropertiesSet() afterPropertiesSet()}
040         * or a custom init-method. Invoked after
041         * {@link org.springframework.context.ApplicationContextAware ApplicationContextAware's}
042         * {@link org.springframework.context.ApplicationContextAware#setApplicationContext setApplicationContext(..)}.
043         * <p><b>NOTE:</b> This method will only be called if there actually is a
044         * {@code LoadTimeWeaver} available in the application context. If
045         * there is none, the method will simply not get invoked, assuming that the
046         * implementing object is able to activate its weaving dependency accordingly.
047         * @param loadTimeWeaver the {@code LoadTimeWeaver} instance (never {@code null})
048         * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet
049         * @see org.springframework.context.ApplicationContextAware#setApplicationContext
050         */
051        void setLoadTimeWeaver(LoadTimeWeaver loadTimeWeaver);
052
053}