Package com.aspectran.core.context.rule
Class AspectRule
- java.lang.Object
-
- com.aspectran.core.context.rule.AspectRule
-
- All Implemented Interfaces:
BeanReferenceable
public class AspectRule extends java.lang.Object implements BeanReferenceable
An aspect is a class that implements enterprise application concerns that cut across multiple classes, such as transaction management. Aspects can be a bean configured through Aspectran configuration.<aspect id="sampleAspect" order="0" isolated="true"> <joinpoint target="translet"> methods: [ "GET" "POST" "PATCH" "PUT" "DELETE" ] headers: [ "Origin" ] pointcut: { type: "wildcard" +: "/a/[email protected]^method1" +: "/x/[email protected]^method1" -: "/a/b/[email protected]^method1" -: "/x/y/[email protected]^method1" } pointcut: { type: "regexp" include: { translet: "/a/b" bean: "sample.bean1" method: "method1" } exclude: { translet: "/a/b/c" bean: "sample.bean3" method: "method1" } } </joinpoint> <settings> </settings> <advice> </advice> <exception> </exception> <aspect>
-
-
Constructor Summary
Constructors Constructor Description AspectRule()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class<?>
getAdviceBeanClass()
java.lang.String
getAdviceBeanId()
java.util.List<AspectAdviceRule>
getAspectAdviceRuleList()
BeanRefererType
getBeanRefererType()
Returns the Bean Referrer Type.java.lang.String
getDescription()
Gets the description.java.lang.Boolean
getDisabled()
ExceptionRule
getExceptionRule()
java.lang.String[]
getHeaders()
java.lang.String
getId()
java.lang.Boolean
getIsolated()
JoinpointRule
getJoinpointRule()
JoinpointTargetType
getJoinpointTargetType()
MethodType[]
getMethods()
int
getOrder()
Pointcut
getPointcut()
PointcutRule
getPointcutRule()
SettingsAdviceRule
getSettingsAdviceRule()
boolean
isBeanRelevant()
boolean
isDisabled()
boolean
isIsolated()
static AspectRule
newInstance(java.lang.String id, java.lang.String order, java.lang.Boolean isolated, java.lang.Boolean disabled)
void
putExceptionThrownRule(ExceptionThrownRule exceptionThrownRule)
void
setAdviceBeanClass(java.lang.Class<?> adviceBeanClass)
void
setAdviceBeanId(java.lang.String adviceBeanId)
void
setAspectAdviceRuleList(java.util.List<AspectAdviceRule> aspectAdviceRuleList)
void
setBeanRelevant(boolean beanRelevant)
void
setDescription(java.lang.String description)
Sets the description.void
setDisabled(java.lang.Boolean disabled)
void
setExceptionRule(ExceptionRule exceptionRule)
void
setId(java.lang.String id)
void
setIsolated(java.lang.Boolean isolated)
void
setJoinpointRule(JoinpointRule joinpointRule)
void
setOrder(int order)
void
setPointcut(Pointcut pointcut)
void
setSettingsAdviceRule(SettingsAdviceRule settingsAdviceRule)
java.lang.String
toString()
AspectAdviceRule
touchAspectAdviceRule(AspectAdviceType aspectAdviceType)
SettingsAdviceRule
touchSettingsAdviceRule()
static void
updateJoinpoint(AspectRule aspectRule, JoinpointParameters joinpointParameters)
static void
updateJoinpoint(AspectRule aspectRule, java.lang.String target, java.lang.String apon)
-
-
-
Method Detail
-
getId
public java.lang.String getId()
-
setId
public void setId(java.lang.String id)
-
getOrder
public int getOrder()
-
setOrder
public void setOrder(int order)
-
getIsolated
public java.lang.Boolean getIsolated()
-
isIsolated
public boolean isIsolated()
-
setIsolated
public void setIsolated(java.lang.Boolean isolated)
-
getDisabled
public java.lang.Boolean getDisabled()
-
isDisabled
public boolean isDisabled()
-
setDisabled
public void setDisabled(java.lang.Boolean disabled)
-
getJoinpointRule
public JoinpointRule getJoinpointRule()
-
setJoinpointRule
public void setJoinpointRule(JoinpointRule joinpointRule)
-
getJoinpointTargetType
public JoinpointTargetType getJoinpointTargetType()
-
getMethods
public MethodType[] getMethods()
-
getHeaders
public java.lang.String[] getHeaders()
-
getPointcutRule
public PointcutRule getPointcutRule()
-
getPointcut
public Pointcut getPointcut()
-
setPointcut
public void setPointcut(Pointcut pointcut)
-
getAdviceBeanId
public java.lang.String getAdviceBeanId()
-
setAdviceBeanId
public void setAdviceBeanId(java.lang.String adviceBeanId)
-
getAdviceBeanClass
public java.lang.Class<?> getAdviceBeanClass()
-
setAdviceBeanClass
public void setAdviceBeanClass(java.lang.Class<?> adviceBeanClass)
-
getSettingsAdviceRule
public SettingsAdviceRule getSettingsAdviceRule()
-
setSettingsAdviceRule
public void setSettingsAdviceRule(SettingsAdviceRule settingsAdviceRule)
-
touchSettingsAdviceRule
public SettingsAdviceRule touchSettingsAdviceRule()
-
getAspectAdviceRuleList
public java.util.List<AspectAdviceRule> getAspectAdviceRuleList()
-
setAspectAdviceRuleList
public void setAspectAdviceRuleList(java.util.List<AspectAdviceRule> aspectAdviceRuleList)
-
touchAspectAdviceRule
public AspectAdviceRule touchAspectAdviceRule(AspectAdviceType aspectAdviceType)
-
getExceptionRule
public ExceptionRule getExceptionRule()
-
setExceptionRule
public void setExceptionRule(ExceptionRule exceptionRule)
-
putExceptionThrownRule
public void putExceptionThrownRule(ExceptionThrownRule exceptionThrownRule)
-
isBeanRelevant
public boolean isBeanRelevant()
-
setBeanRelevant
public void setBeanRelevant(boolean beanRelevant)
-
getDescription
public java.lang.String getDescription()
Gets the description.- Returns:
- the description
-
setDescription
public void setDescription(java.lang.String description)
Sets the description.- Parameters:
description
- the new description
-
getBeanRefererType
public BeanRefererType getBeanRefererType()
Description copied from interface:BeanReferenceable
Returns the Bean Referrer Type.- Specified by:
getBeanRefererType
in interfaceBeanReferenceable
- Returns:
- the Bean Referrer Type
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
newInstance
public static AspectRule newInstance(java.lang.String id, java.lang.String order, java.lang.Boolean isolated, java.lang.Boolean disabled) throws IllegalRuleException
- Throws:
IllegalRuleException
-
updateJoinpoint
public static void updateJoinpoint(AspectRule aspectRule, java.lang.String target, java.lang.String apon) throws IllegalRuleException
- Throws:
IllegalRuleException
-
updateJoinpoint
public static void updateJoinpoint(AspectRule aspectRule, JoinpointParameters joinpointParameters) throws IllegalRuleException
- Throws:
IllegalRuleException
-
-