Package javax.ws.rs.ext

Examples of javax.ws.rs.ext.RuntimeDelegate


  private static Server server;

  @BeforeClass
  public static void initialize() throws Exception {
    PersonApplication application = new PersonApplication();
    RuntimeDelegate delegate = RuntimeDelegate.getInstance();

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


public class Main {

    protected Main() throws Exception {
        PersonApplication application = new PersonApplication();
        RuntimeDelegate delegate = RuntimeDelegate.getInstance();

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

import org.apache.cxf.jaxrs.provider.jsonp.JsonpPostStreamInterceptor;

public class Main {

    protected Main() throws Exception {
      RuntimeDelegate delegate = RuntimeDelegate.getInstance();    
        JAXRSServerFactoryBean bean = delegate.createEndpoint(new MyApplication(),
            JAXRSServerFactoryBean.class);
       
//        List<Object> providerList = new ArrayList<Object>();
//        providerList.add(new org.codehaus.jackson.jaxrs.JacksonJsonProvider());
//        bean.setProviders(providerList);
View Full Code Here

   public RuntimeDelegate getOriginal() {
      return original;
   }

   public static final void assertNotStringBeanRuntimeDelegate() {
      RuntimeDelegate delegate = RuntimeDelegate.getInstance();
      assertNotStringBeanRuntimeDelegate(delegate);
   }
View Full Code Here

  protected void flushHeaders() throws IOException {
    if (headersFlushed)
      return;

    headersFlushed = true;
    RuntimeDelegate delegate = RuntimeDelegate.getInstance();

    for (String key : headers.keySet()) {
      List<Object> objs = headers.get(key);
      for (Object obj : objs) {
        String value;
        RuntimeDelegate.HeaderDelegate headerDelegate = delegate
            .createHeaderDelegate(obj.getClass());
        if (headerDelegate != null) {
          value = headerDelegate.toString(obj);
        } else {
          value = obj.toString();
View Full Code Here

         synchronized (RD_LOCK)
         {
            result = instance;
            if (result == null)
            { // Second check (with locking)
               RuntimeDelegate runtimeDelegate = RuntimeDelegate.getInstance();
               if (runtimeDelegate instanceof ResteasyProviderFactory)
               {
                  instance = result = (ResteasyProviderFactory) runtimeDelegate;
               }
               else
View Full Code Here

   @Test
   public void testEmptyHeaderString()
   {

      RuntimeDelegate original = RuntimeDelegate.getInstance();
      RuntimeDelegate
              .setInstance(new NullStringBeanRuntimeDelegate(original));
      try {
         Response abortWith = Response.ok().header("header1", new StringBean("aa"))
                 .build();
View Full Code Here

   }

   @Test
   public void getStringHeadersUsingHeaderDelegateTest()
   {
      RuntimeDelegate original = RuntimeDelegate.getInstance();
      RuntimeDelegate.setInstance(new StringBeanRuntimeDelegate(original));
      try {
         StringBuilder builder = new StringBuilder("s1");
         StringBuffer buffer = new StringBuffer("s2");
         StringBean bean = new StringBean("s3");
View Full Code Here

      }

      @GET
      @Path("entitybodyresponsetest")
      public Response entityResponseTest() {
         RuntimeDelegate rd = RuntimeDelegate.getInstance();
         Response.ResponseBuilder rb = rd.createResponseBuilder();
         String rwe = "hello";
         Response build = rb.entity(rwe).build();
         return build;
      }
View Full Code Here

      }

      @GET
      @Path("nullEntityResponse")
      public Response nullEntityResponse() {
         RuntimeDelegate rd = RuntimeDelegate.getInstance();
         Response.ResponseBuilder rb = rd.createResponseBuilder();
         return rb.entity(null).build();
      }
View Full Code Here

TOP

Related Classes of javax.ws.rs.ext.RuntimeDelegate

Copyright © 2018 www.massapicom. 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.