Examples of JAXRSServerFactoryBean


Examples of org.apache.cxf.jaxrs.JAXRSServerFactoryBean

    }
   
    @Test
    public void testNameBindings() {
        Application app = new TestApplication();
        JAXRSServerFactoryBean bean = ResourceUtils.createApplication(app, true, true);
        ClassResourceInfo cri = bean.getServiceFactory().getClassResourceInfo().get(0);
        List<String> names = cri.getNameBindings();
        assertEquals(Collections.singletonList(CustomNameBinding.class.getName()), names);
    }
View Full Code Here

Examples of org.apache.cxf.jaxrs.JAXRSServerFactoryBean

    @BeforeClass
    public static void initService() throws Exception {

        ClientServerOAuthTest.initService();
        JAXRSServerFactoryBean sf3 = (JAXRSServerFactoryBean)ctx.getBean("oauthServerExt");
        s3 = sf3.create();

    }
View Full Code Here

Examples of org.apache.cxf.jaxrs.JAXRSServerFactoryBean

    protected static Server s;

    @BeforeClass
    public static void initService() throws Exception {

        JAXRSServerFactoryBean sf = (JAXRSServerFactoryBean)ctx.getBean("oauthServer");
        s = sf.create();

        JAXRSServerFactoryBean sf2 = (JAXRSServerFactoryBean)ctx.getBean("oauthClient");
        s2 = sf2.create();


    }
View Full Code Here

Examples of org.apache.cxf.jaxrs.JAXRSServerFactoryBean

    @BeforeClass
    public static void initService() throws Exception {

        ClientServerOAuthTest.initService();
        JAXRSServerFactoryBean sf3 = (JAXRSServerFactoryBean)ctx.getBean("resourceServer");
        s3 = sf3.create();

    }
View Full Code Here

Examples of org.apache.cxf.jaxrs.JAXRSServerFactoryBean

*/
public class PersonServiceStarter {
   
    @SuppressWarnings("rawtypes")
    public void startRestService() {
        JAXRSServerFactoryBean factory = new JAXRSServerFactoryBean();
        factory.setAddress("http://localhost:8282/person");
        factory.setResourceClasses(PersonServiceImpl.class);
        factory.setResourceProvider(new SingletonResourceProvider(new PersonServiceImpl()));
        factory.setProvider(new JAXBElementProvider());
        Server server = factory.create();
        server.start();
    }
View Full Code Here

Examples of org.apache.cxf.jaxrs.JAXRSServerFactoryBean

    private static Server server;

    @BeforeClass
    public static void startServer() {
        PersonService personService = new PersonServiceImpl();;
        JAXRSServerFactoryBean factory = new JAXRSServerFactoryBean();
        factory.setAddress(PERSONSERVICE_TESTURL);
        factory.setServiceBean(personService);
        server = factory.create();
        server.start();
    }
View Full Code Here

Examples of org.apache.cxf.jaxrs.JAXRSServerFactoryBean

            factory.getProperties().put(FaultListener.class.getName(), new NullFaultListener());
        }
    }
   
    protected JAXRSServerFactoryBean newJAXRSServerFactoryBean() {
        return new JAXRSServerFactoryBean();
    }
View Full Code Here

Examples of org.apache.cxf.jaxrs.JAXRSServerFactoryBean

        }
    }


    public JAXRSServerFactoryBean createJAXRSServerFactoryBean() {
        JAXRSServerFactoryBean answer = newJAXRSServerFactoryBean();
        setupJAXRSServerFactoryBean(answer);
        return answer;
    }
View Full Code Here

Examples of org.apache.cxf.jaxrs.JAXRSServerFactoryBean

        CxfRsEndpoint endpoint = (CxfRsEndpoint)component.createEndpoint(endpointUri);
        JSONProvider<?> jsonProvider = new JSONProvider<Object>();
        jsonProvider.setDropRootElement(true);
        jsonProvider.setSupportUnwrapped(true);
        endpoint.setProvider(jsonProvider);
        JAXRSServerFactoryBean sfb = endpoint.createJAXRSServerFactoryBean();
        assertEquals("Get a wrong proider size", 1, sfb.getProviders().size());
        JAXRSClientFactoryBean cfb = endpoint.createJAXRSClientFactoryBean();
        assertEquals("Get a wrong proider size", 1, cfb.getProviders().size());
    }
View Full Code Here

Examples of org.apache.cxf.jaxrs.JAXRSServerFactoryBean

    @Override public void deployEJB(String fullContext, BeanContext beanContext) {
        deploy(beanContext.getBeanClass(), fullContext, null, null, null, new OpenEJBEJBInvoker(beanContext));
    }

    private void deploy(Class<?> clazz, String address, ResourceProvider rp, Object serviceBean, Application app, Invoker invoker) {
        JAXRSServerFactoryBean factory = new JAXRSServerFactoryBean();
        factory.setResourceClasses(clazz);
        factory.setDestinationFactory(transportFactory);
        factory.setBus(transportFactory.getBus());
        factory.setAddress(address);
        factory.setProviders(createProviderList(nameForProviders(clazz), clazz.getClassLoader()));
        if (rp != null) {
            factory.setResourceProvider(rp);
        }
        if (app != null) {
            factory.setApplication(app);
        }
        if (invoker != null) {
            factory.setInvoker(invoker);
        }
        if (serviceBean != null) {
            factory.setServiceBean(serviceBean);
        } else {
            factory.setServiceClass(clazz);
        }

        server = factory.create();
        destination = (AbstractHTTPDestination) server.getDestination();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.