com.alipay.hessian
Class NameBlackListFilter

java.lang.Object
  extended by com.alipay.hessian.NameBlackListFilter
All Implemented Interfaces:
ClassNameFilter
Direct Known Subclasses:
InternalNameBlackListFilter

public class NameBlackListFilter
extends Object
implements ClassNameFilter

名字黑名单过滤器


Field Summary
protected  List<String> blackPrefixList
          黑名单 包名前缀
protected  ConcurrentMap<String,Boolean> resultOfInBlackList
          类名是否在黑名单中结果缓存。
 
Constructor Summary
NameBlackListFilter(List<String> blackPrefixList)
          指定黑名单前缀
NameBlackListFilter(List<String> blackPrefixList, int maxCacheSize)
          指定黑名单前缀和缓存大小
 
Method Summary
protected  void buildCache(int maxCacheSize)
          初始化缓存
 int order()
          排序,从小到大排序,越小越前面
 String resolve(String className)
          决定类名,例如进行过滤,转换,等等。
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

blackPrefixList

protected List<String> blackPrefixList
黑名单 包名前缀


resultOfInBlackList

protected ConcurrentMap<String,Boolean> resultOfInBlackList
类名是否在黑名单中结果缓存。{className:true/false}

Constructor Detail

NameBlackListFilter

public NameBlackListFilter(List<String> blackPrefixList)
指定黑名单前缀

Parameters:
blackPrefixList - 黑名单前缀

NameBlackListFilter

public NameBlackListFilter(List<String> blackPrefixList,
                           int maxCacheSize)
指定黑名单前缀和缓存大小

Parameters:
blackPrefixList - 黑名单前缀
maxCacheSize - 最大缓存大小
Method Detail

buildCache

protected void buildCache(int maxCacheSize)
初始化缓存

Parameters:
maxCacheSize - 最大缓存

order

public int order()
Description copied from interface: ClassNameFilter
排序,从小到大排序,越小越前面

Specified by:
order in interface ClassNameFilter
Returns:
顺序

resolve

public String resolve(String className)
               throws IOException
Description copied from interface: ClassNameFilter
决定类名,例如进行过滤,转换,等等。

Specified by:
resolve in interface ClassNameFilter
Parameters:
className - 类名
Returns:
类名
Throws:
IOException


Copyright © 2008–2018 Ant Financial. All rights reserved.