java - Equivalent for ResourceFilterFactory in jersey 2 -


i have filter factory class made 2 factory classes , cache implementation . how implement equivalent implementation resourcefilterfactory in jersey 2 ?

my class definition

public class corsresourcefilterfactory implements resourcefilterfactory { 

i have create method implements cache functionality based on whether method type options or not .

 public list<resourcefilter> create(abstractmethod am) {     //getting origin , methods , headers , credentials          if (am.isannotationpresent(options.class)) {             filters = collections.<resourcefilter>singletonlist(new corsoptionsfilter(o, m, h, c));         } else {             filters = collections.<resourcefilter>singletonlist(new corssimplefilter(o, h, c));         }          filtercache.put(am, filters);         return filters;     } } 

the individual filter constructor definition follows :

 public corsoptionsfilter(collection<string> o, collection<string> m,             collection<string> h, boolean c) {             } public corssimplefilter(collection<string> o,             collection<string> h, boolean c) {     } 


Comments