| Constructor and Description |
|---|
CtSph() |
| Modifier and Type | Method and Description |
|---|---|
Entry |
entry(Method method)
Create a protected method.
|
Entry |
entry(Method method,
EntryType type)
Create a protected method.
|
Entry |
entry(Method method,
EntryType type,
int count)
Create a protected method.
|
Entry |
entry(Method method,
EntryType type,
int count,
Object... args)
Create a protected resource.
|
Entry |
entry(Method method,
int count)
Create a protected method.
|
Entry |
entry(ResourceWrapper resourceWrapper,
int count,
Object... args)
Do all
Rules checking about the resource. |
Entry |
entry(String name)
Create a protected resource.
|
Entry |
entry(String name,
EntryType type)
Create a protected resource.
|
Entry |
entry(String name,
EntryType type,
int count)
Create a protected resource.
|
Entry |
entry(String name,
EntryType type,
int count,
Object... args)
Create a protected resource.
|
Entry |
entry(String name,
int count)
Create a protected resource.
|
public Entry entry(ResourceWrapper resourceWrapper, int count, Object... args) throws BlockException
Rules checking about the resource.
Each distinct resource will use a ProcessorSlot to do rules checking. Same resource will use
same ProcessorSlot globally.
Note that total ProcessorSlot count must not exceed Constants.MAX_SLOT_CHAIN_SIZE,
otherwise no rules checking will do. In this condition, all requests will pass directly, with no checking
or exception.
resourceWrapper - resource namecount - tokens neededargs - arguments of user method callEntry represents this callBlockException - if any rule's threshold is exceededpublic Entry entry(String name) throws BlockException
Sphentry in interface Sphname - the unique name of the protected resourceBlockException - if the block criteria is metpublic Entry entry(Method method) throws BlockException
Sphentry in interface Sphmethod - the protected methodBlockException - if the block criteria is metpublic Entry entry(Method method, EntryType type) throws BlockException
Sphentry in interface Sphmethod - the protected methodtype - the resource is an inbound or an outbound method. This is used
to mark whether it can be blocked when the system is unstableBlockException - if the block criteria is metpublic Entry entry(String name, EntryType type) throws BlockException
Sphentry in interface Sphname - the unique name for the protected resourcetype - the resource is an inbound or an outbound method. This is used
to mark whether it can be blocked when the system is unstableBlockException - if the block criteria is metpublic Entry entry(Method method, EntryType type, int count) throws BlockException
Sphentry in interface Sphmethod - the protected methodtype - the resource is an inbound or an outbound method. This is used
to mark whether it can be blocked when the system is unstablecount - the count that the resource requiresBlockException - if the block criteria is metpublic Entry entry(String name, EntryType type, int count) throws BlockException
Sphentry in interface Sphname - the unique name for the protected resourcetype - the resource is an inbound or an outbound method. This is used
to mark whether it can be blocked when the system is unstablecount - the count that the resource requiresBlockException - if the block criteria is metpublic Entry entry(Method method, int count) throws BlockException
Sphentry in interface Sphmethod - the protected methodcount - the count that the resource requiresBlockException - if the block criteria is metpublic Entry entry(String name, int count) throws BlockException
Sphentry in interface Sphname - the unique string for the resourcecount - the count that the resource requiresBlockException - if the block criteria is metpublic Entry entry(Method method, EntryType type, int count, Object... args) throws BlockException
Sphentry in interface Sphmethod - the protected methodtype - the resource is an inbound or an outbound method. This is used
to mark whether it can be blocked when the system is unstablecount - the count that the resource requiresargs - the parameters of the method. It can also be counted by setting
hot parameter ruleBlockException - if the block criteria is metpublic Entry entry(String name, EntryType type, int count, Object... args) throws BlockException
Sphentry in interface Sphname - the unique name for the protected resourcetype - the resource is an inbound or an outbound method. This is used
to mark whether it can be blocked when the system is unstablecount - the count that the resource requiresargs - the parameters of the method. It can also be counted by setting
hot parameter ruleBlockException - if the block criteria is metCopyright © 2018 Alibaba Group. All rights reserved.