Examples of RuntimeDelegate


Examples of javax.ws.rs.ext.RuntimeDelegate

    private static Server server;
   
    protected ApplicationServer() throws Exception {
        PersonApplication application = new PersonApplication();
        RuntimeDelegate delegate = RuntimeDelegate.getInstance();

        JAXRSServerFactoryBean bean = delegate.createEndpoint(application, JAXRSServerFactoryBean.class);
        bean.setAddress("http://localhost:8080/services" + bean.getAddress());
        server = bean.create();
        server.start();
    }
View Full Code Here

Examples of javax.ws.rs.ext.RuntimeDelegate

*/
public class ApplicationServer {

    protected ApplicationServer() throws Exception {
        AttachmentApplication application = new AttachmentApplication();
        RuntimeDelegate delegate = RuntimeDelegate.getInstance();

        JAXRSServerFactoryBean bean = delegate.createEndpoint(application, JAXRSServerFactoryBean.class);
        bean.setAddress("http://localhost:8080/services" + bean.getAddress());
        bean.create().start();
    }
View Full Code Here

Examples of javax.ws.rs.ext.RuntimeDelegate

      oauthServer.stop();
      oauthServer.destroy();
    }
   
    private static Server startApplication(Application app) {
      RuntimeDelegate delegate = RuntimeDelegate.getInstance();
        JAXRSServerFactoryBean bean = delegate.createEndpoint(app, JAXRSServerFactoryBean.class);
       
       
       
        bean.setAddress("http://localhost:8080" + bean.getAddress());
        bean.setStart(false);
View Full Code Here

Examples of javax.ws.rs.ext.RuntimeDelegate

      oauthServer.stop();
      oauthServer.destroy();
    }
   
    private static Server startApplication(Application app) {
      RuntimeDelegate delegate = RuntimeDelegate.getInstance();
        JAXRSServerFactoryBean bean = delegate.createEndpoint(app, JAXRSServerFactoryBean.class);
       
       
       
        bean.setAddress("http://localhost:8080" + bean.getAddress());
        bean.setStart(false);
View Full Code Here

Examples of javax.ws.rs.ext.RuntimeDelegate

        // initialization of this instance, RuntimeDelegate.getInstance() is invoked which causes a method
        // call to com.sun.ws.rs.ext.RuntimeDelegateImpl (see EntityTagMatchHeaderDelegate).
        // Other frameworks face similar issues using JAX-RS, see for example this URL for the exact same
        // problem in the Restlet framework: http://www.mail-archive.com/discuss@restlet.tigris.org/msg07539.html
        // The nasty fix is to set some dummy RuntimeDelegate first, then set the Wink RuntimeDelegateImpl
        RuntimeDelegate.setInstance(new RuntimeDelegate() {
            @Override
            public <T> T createEndpoint(Application arg0, Class<T> arg1) throws IllegalArgumentException,
                UnsupportedOperationException {
                return null;
            }
View Full Code Here

Examples of javax.ws.rs.ext.RuntimeDelegate

        // initialization of this instance, RuntimeDelegate.getInstance() is invoked which causes a method
        // call to com.sun.ws.rs.ext.RuntimeDelegateImpl (see EntityTagMatchHeaderDelegate).
        // Other frameworks face similar issues using JAX-RS, see for example this URL for the exact same
        // problem in the Restlet framework: http://www.mail-archive.com/discuss@restlet.tigris.org/msg07539.html
        // The nasty fix is to set some dummy RuntimeDelegate first, then set the Wink RuntimeDelegateImpl
        RuntimeDelegate.setInstance(new RuntimeDelegate() {
            @Override
            public <T> T createEndpoint(Application arg0, Class<T> arg1) throws IllegalArgumentException,
                UnsupportedOperationException {
                return null;
            }
View Full Code Here

Examples of javax.ws.rs.ext.RuntimeDelegate

*/
public class RuntimeDelegateImplTest {

    @Test
    public void testCreateEndpoint() {
        RuntimeDelegate delegate = RuntimeDelegate.getInstance();
        try {
            delegate.createEndpoint((Application) null, com.sun.net.httpserver.HttpHandler.class);
            fail("IllegalArgumentException should be thrown");
        } catch (IllegalArgumentException iae) {
            // ok - should be thrown
        } catch (Exception e) {
            fail("IllegalArgumentException should be thrown");
View Full Code Here

Examples of javax.ws.rs.ext.RuntimeDelegate

public class RuntimeDelegateImplTest extends Assert {

    @Test
    public void testRuntimeDelegate() throws Exception {
        RuntimeDelegate rd = RuntimeDelegate.getInstance();
        assertSame(rd.getClass(), RuntimeDelegateImpl.class);
    }
View Full Code Here

Examples of javax.ws.rs.ext.RuntimeDelegate

public class RuntimeDelegateImplTest extends Assert {

    @Test
    public void testRuntimeDelegate() throws Exception {
        RuntimeDelegate rd = RuntimeDelegate.getInstance();
        assertSame(rd.getClass(), RuntimeDelegateImpl.class);
    }
View Full Code Here

Examples of javax.ws.rs.ext.RuntimeDelegate

public class NewCookieHeaderDelegateTest {

    @Test
    public void testParseNewCookie() {
        RuntimeDelegate rd = RuntimeDelegate.getInstance();
        HeaderDelegate<NewCookie> newCookieHeaderDelegate =
            rd.createHeaderDelegate(NewCookie.class);
        if (newCookieHeaderDelegate == null) {
            fail("NewCookie header delegate is not regestered in RuntimeDelegateImpl");
        }

        NewCookie expectedNewCookie =
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.