use of org.apache.cxf.throttling.ThrottlingFeature in project cxf by apache.
the class BookServerThrottled method run.
protected void run() {
JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
sf.setResourceClasses(BookStore.class);
List<Feature> features = new ArrayList<>();
ThrottlingFeature tf = new ThrottlingFeature(new ThrottlingManagerImpl());
features.add(tf);
sf.setFeatures(features);
sf.setResourceProvider(BookStore.class, new SingletonResourceProvider(new BookStore(), true));
sf.setAddress("http://localhost:" + PORT + "/");
server = sf.create();
}
Aggregations