1 package com.freemindcafe.apache.cxf.jaxrs.sample8;
3 import java.util.ArrayList;
6 import org.
apache.cxf.interceptor.Interceptor;
7 import org.
apache.cxf.interceptor.LoggingInInterceptor;
8 import org.
apache.cxf.interceptor.LoggingOutInterceptor;
9 import org.
apache.cxf.jaxrs.JAXRSServerFactoryBean;
11 import org.junit.Test;
16 public void test()
throws Exception{
17 JAXRSServerFactoryBean sf =
new JAXRSServerFactoryBean();
19 sf.setServiceBean(ticketsResource);
20 sf.setAddress(
"http://localhost:9000/tickets");
21 final List<Interceptor<? extends Message>> list =
new ArrayList<Interceptor<? extends Message>>();
22 list.add(
new LoggingInInterceptor());
23 list.add(
new LoggingOutInterceptor());
24 sf.setInInterceptors(list);