### Question:
SpringResourceFactory implements ResourceProvider, ApplicationContextAware { public Class<?> getResourceClass() { return type; } SpringResourceFactory();  SpringResourceFactory(String name); Object getInstance(Message m); boolean isSingleton(); void releaseInstance(Message m, Object o); void setApplicationContext(ApplicationContext applicationContext); void setBeanId(String serviceBeanId); ApplicationContext getApplicationContext(); Class<?> getResourceClass(); void setCallPostConstruct(boolean callPostConstruct); boolean isCallPostConstruct(); void setCallPreDestroy(boolean callPreDestroy); boolean isCallPreDestroy(); void setPreDestroyMethodName(String preDestroyMethodName); void setPostConstructMethodName(String postConstructMethodName);  }### Answer:
@Test public void testFactory() throws Exception { ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(new String[] {"/org/apache/cxf/jaxrs/spring/servers2.xml"}); verifyFactory(ctx, "sfactory1", true); verifyFactory(ctx, "sfactory2", false); Object serverBean = ctx.getBean("server1"); assertNotNull(serverBean); JAXRSServerFactoryBean factoryBean = (JAXRSServerFactoryBean)serverBean; List<ClassResourceInfo> list = factoryBean.getServiceFactory().getClassResourceInfo(); assertNotNull(list); assertEquals(4, list.size()); assertSame(BookStoreConstructor.class, list.get(0).getServiceClass()); assertSame(BookStoreConstructor.class, list.get(0).getResourceClass()); assertSame(BookStore.class, list.get(1).getServiceClass()); assertSame(BookStore.class, list.get(1).getResourceClass()); }