File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
fj-core/src/main/java/org/fugerit/java/core/util/filterchain Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 22
33import java .io .InputStream ;
44import java .util .Collection ;
5+ import java .util .HashMap ;
56import java .util .Iterator ;
7+ import java .util .Map ;
68
79import org .fugerit .java .core .cfg .xml .GenericListCatalogConfig ;
810import org .fugerit .java .core .lang .helpers .ClassHelper ;
@@ -17,6 +19,13 @@ public class MiniFilterConfig extends GenericListCatalogConfig<MiniFilterConfigE
1719 */
1820 private static final long serialVersionUID = 286844409632297876L ;
1921
22+ private Map <String , MiniFilterChain > mapChain ;
23+
24+ public MiniFilterConfig () {
25+ super ();
26+ this .mapChain = new HashMap <String , MiniFilterChain >();
27+ }
28+
2029 public static MiniFilterConfig loadConfig ( InputStream is , MiniFilterConfig config ) throws Exception {
2130 Document doc = DOMIO .loadDOMDoc ( is );
2231 Element root = doc .getDocumentElement ();
@@ -39,4 +48,13 @@ public MiniFilterChain getChain( String id ) throws Exception {
3948 return chain ;
4049 }
4150
51+ public MiniFilterChain getChainCache ( String id ) throws Exception {
52+ MiniFilterChain chain = this .mapChain .get ( id );
53+ if ( chain == null ) {
54+ chain = this .getChain ( id );
55+ this .mapChain .put ( id , chain );
56+ }
57+ return chain ;
58+ }
59+
4260}
You can’t perform that action at this time.
0 commit comments