Package javax.ws.rs.ext

Examples of javax.ws.rs.ext.RuntimeDelegate$HeaderDelegate


        return this;
    }

    @Override
    public Builder header(String name, Object value) {
        RuntimeDelegate rd = HttpUtils.getOtherRuntimeDelegate();
        doSetHeader(rd, name, value);
        return this;
    }
View Full Code Here


        return this;
    }
   
    @Override
    public Builder headers(MultivaluedMap<String, Object> headers) {
        RuntimeDelegate rd = HttpUtils.getOtherRuntimeDelegate();
        for (Map.Entry<String, List<Object>> entry : headers.entrySet()) {
            for (Object value : entry.getValue()) {
                doSetHeader(rd, entry.getKey(), value);
            }
        }
View Full Code Here

        Map<String, List<Object>> headers = CastUtils.cast((Map<?, ?>)m.get(Message.PROTOCOL_HEADERS));
        return new MetadataMap<String, Object>(headers, false, false, true);
    }
   
    public static void convertHeaderValuesToString(Map<String, List<Object>> headers, boolean delegateOnly) {
        RuntimeDelegate rd = getOtherRuntimeDelegate();
        if (rd == null && delegateOnly) {
            return;
        }
        for (Map.Entry<String, List<Object>> entry : headers.entrySet()) {
            List<Object> values = entry.getValue();
View Full Code Here

*/
public class TestMediaTypeGuesser {

  @Before
  public void setUp() {
    RuntimeDelegate.setInstance(new RuntimeDelegate() {

      @Override
      public UriBuilder createUriBuilder() {
        throw new UnsupportedOperationException("Not supported yet.");
      }
View Full Code Here

    private static final String ANSI_C_ASCTIME_DATE         = "Sun Nov 6 08:49:37 1994";

    @Test
    public void testParseHeaderDelegate() throws ParseException {

        RuntimeDelegate rd = RuntimeDelegate.getInstance();
        HeaderDelegate<Date> dateHeaderDelegate = rd.createHeaderDelegate(Date.class);
        if (dateHeaderDelegate == null) {
            fail("Date header delegate is not regestered in RuntimeDelegateImpl");
        }

        SimpleDateFormat dateFormat = new SimpleDateFormat(RFC1123_DATE_FORMAT_PATTERN, Locale.US);
View Full Code Here

    }

    @Test
    public void testSerializeHeaderDelegate() throws ParseException {

        RuntimeDelegate rd = RuntimeDelegate.getInstance();
        HeaderDelegate<Date> dateHeaderDelegate = rd.createHeaderDelegate(Date.class);
        if (dateHeaderDelegate == null) {
            fail("Date header delegate is not regestered in RuntimeDelegateImpl");
        }

        // HTTP1.1 clients and servers MUST only generate the RFC 1123 format
View Full Code Here

        bundleContext.addBundleListener(this);
        registerExistingBundles();

        // Register RuntimeDelegate.
        final Bundle jerseyServerBundle = getJerseyServerBundle(bundleContext);
        RuntimeDelegate runtimeDelegate = null;

        try {
            if (jerseyServerBundle == null) {
                LOGGER.config("jersey-client bundle registers JAX-RS RuntimeDelegate");
                runtimeDelegate = (RuntimeDelegate) getClass().getClassLoader().
View Full Code Here

*
* @author Paul.Sandoz@Sun.Com
*/
public class RuntimeDelegateTest extends TestCase {
    public void testRuntimeDelegateImpl() {
        RuntimeDelegate rd = RuntimeDelegate.getInstance();
        assertEquals(RuntimeDelegateImpl.class, rd.getClass());
    }
View Full Code Here

    }

    private static List<String> iterableToList(final Iterable<?> values) {
        final LinkedList<String> linkedList = new LinkedList<String>();

        final RuntimeDelegate rd = RuntimeDelegate.getInstance();
        for (Object element : values) {
            linkedList.add(HeaderUtils.asString(element, rd));
        }

        return linkedList;
View Full Code Here

    public static List<String> asStringList(final List<Object> headerValues, final RuntimeDelegate rd) {
        if (headerValues == null || headerValues.isEmpty()) {
            return Collections.emptyList();
        }

        final RuntimeDelegate delegate;
        if (rd == null) {
            delegate = RuntimeDelegate.getInstance();
        } else {
            delegate = rd;
        }
View Full Code Here

TOP

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

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.