001/* 002 * Copyright 2002-2007 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.config; 018 019import org.springframework.beans.factory.config.BeanDefinition; 020import org.springframework.beans.factory.config.BeanReference; 021import org.springframework.beans.factory.parsing.CompositeComponentDefinition; 022 023/** 024 * {@link org.springframework.beans.factory.parsing.ComponentDefinition} 025 * that holds an aspect definition, including its nested pointcuts. 026 * 027 * @author Rob Harrop 028 * @author Juergen Hoeller 029 * @since 2.0 030 * @see #getNestedComponents() 031 * @see PointcutComponentDefinition 032 */ 033public class AspectComponentDefinition extends CompositeComponentDefinition { 034 035 private final BeanDefinition[] beanDefinitions; 036 037 private final BeanReference[] beanReferences; 038 039 040 public AspectComponentDefinition( 041 String aspectName, BeanDefinition[] beanDefinitions, BeanReference[] beanReferences, Object source) { 042 043 super(aspectName, source); 044 this.beanDefinitions = (beanDefinitions != null ? beanDefinitions : new BeanDefinition[0]); 045 this.beanReferences = (beanReferences != null ? beanReferences : new BeanReference[0]); 046 } 047 048 049 @Override 050 public BeanDefinition[] getBeanDefinitions() { 051 return this.beanDefinitions; 052 } 053 054 @Override 055 public BeanReference[] getBeanReferences() { 056 return this.beanReferences; 057 } 058 059}