001
014
015 package com.liferay.portal.spring.aop;
016
017
020 public class ChainableMethodAdviceInjector {
021
022 public void afterPropertiesSet() {
023 if (_injectCondition) {
024 if (_newChainableMethodAdvice == null) {
025 throw new IllegalArgumentException(
026 "New ChainableMethodAdvice is null");
027 }
028
029 if (_parentChainableMethodAdvice == null) {
030 throw new IllegalArgumentException(
031 "Parent ChainableMethodAdvice is null");
032 }
033
034 _newChainableMethodAdvice.nextMethodInterceptor =
035 _parentChainableMethodAdvice.nextMethodInterceptor;
036 _parentChainableMethodAdvice.nextMethodInterceptor =
037 _newChainableMethodAdvice;
038 }
039 }
040
041 public void setInjectCondition(boolean injectCondition) {
042 _injectCondition = injectCondition;
043 }
044
045 public void setNewChainableMethodAdvice(
046 ChainableMethodAdvice newChainableMethodAdvice) {
047 _newChainableMethodAdvice = newChainableMethodAdvice;
048 }
049
050 public void setParentChainableMethodAdvice(
051 ChainableMethodAdvice parentChainableMethodAdvice) {
052 _parentChainableMethodAdvice = parentChainableMethodAdvice;
053 }
054
055 private boolean _injectCondition;
056
057 private ChainableMethodAdvice _newChainableMethodAdvice;
058
059 private ChainableMethodAdvice _parentChainableMethodAdvice;
060
061 }