Package org.jboss.seam.rest.client

Examples of org.jboss.seam.rest.client.RestClient


    /**
     * Producer method for proxied JAX-RS interfaces - REST Clients This method is not registered as a producer method by
     * default. It is registered by {@link RestClientExtension} only if there is an appropriate injection point.
     */
    public Object produceRestClient(InjectionPoint ip, ClientExecutor executor) {
        RestClient qualifier = AnnotationInspector.getAnnotation(ip.getAnnotated(), RestClient.class, manager);

        if (qualifier == null || !(ip.getType() instanceof Class<?>)) {
            // this should never happen
            throw new IllegalStateException("@RestClient injection point " + ip.getMember() + " is not valid.");
        }

        Class<?> clazz = (Class<?>) ip.getType();
        String url = interpolator.interpolate(qualifier.value());
        return ProxyFactory.create(clazz, url, executor);
    }
View Full Code Here


     * Produces ClientRequest instances.
     */
    @Produces
    @RestClient("")
    public ClientRequest produceClientRequest(InjectionPoint ip, ClientExecutor executor) {
        RestClient qualifier = AnnotationInspector.getAnnotation(ip.getAnnotated(), RestClient.class, manager);

        if (qualifier == null) {
            // this should never happen
            throw new IllegalStateException("@RestClient injection point " + ip.getMember() + " is not valid.");
        }

        String url = interpolator.interpolate(qualifier.value());

        return new ClientRequest(url, executor);
    }
View Full Code Here

TOP

Related Classes of org.jboss.seam.rest.client.RestClient

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.