001/* 002 * Copyright 2002-2016 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.aop.aspectj.annotation; 018 019import org.springframework.aop.aspectj.AspectInstanceFactory; 020import org.springframework.lang.Nullable; 021 022/** 023 * Subinterface of {@link org.springframework.aop.aspectj.AspectInstanceFactory} 024 * that returns {@link AspectMetadata} associated with AspectJ-annotated classes. 025 * 026 * <p>Ideally, AspectInstanceFactory would include this method itself, but because 027 * AspectMetadata uses Java-5-only {@link org.aspectj.lang.reflect.AjType}, 028 * we need to split out this subinterface. 029 * 030 * @author Rod Johnson 031 * @since 2.0 032 * @see AspectMetadata 033 * @see org.aspectj.lang.reflect.AjType 034 */ 035public interface MetadataAwareAspectInstanceFactory extends AspectInstanceFactory { 036 037 /** 038 * Return the AspectJ AspectMetadata for this factory's aspect. 039 * @return the aspect metadata 040 */ 041 AspectMetadata getAspectMetadata(); 042 043 /** 044 * Return the best possible creation mutex for this factory. 045 * @return the mutex object (may be {@code null} for no mutex to use) 046 * @since 4.3 047 */ 048 @Nullable 049 Object getAspectCreationMutex(); 050 051}