Package org.jboss.resteasy.client

Examples of org.jboss.resteasy.client.ClientRequestFactory


{
    public static void main(String args[]) throws Exception
    {
        final String searchTerm = "dolphin";

        ClientRequestFactory client = initializeRequests();

        // apply for api key at - http://www.flickr.com/services/api/keys/apply
        FlickrResponse photos = client.get(photoSearchUrl,
                FlickrResponse.class, args[0], "text", searchTerm);

        JFrame frame = new JFrame(searchTerm + " photos");
        frame.setLayout(new GridLayout(2, photos.photos.size() / 2));

        for (Photo photo : photos.photos)
        {
            JLabel image = new JLabel(client.get(photoUrlTemplate,
                    ImageIcon.class, photo.server, photo.id, photo.secret));
            image.setBorder(BorderFactory.createTitledBorder(photo.title));
            frame.add(image);
        }
View Full Code Here


    {
        ResteasyProviderFactory instance = ResteasyProviderFactory.getInstance();
        RegisterBuiltin.register(instance);
        instance.registerProvider(ImageIconMessageBodyReader.class);

        ClientRequestFactory client = new ClientRequestFactory();
        client.getPrefixInterceptors().registerInterceptor(new LoggingExecutionInterceptor());
        return client;
    }
View Full Code Here

   @Test
   public void testClientResponse() throws Exception
   {
      URI base = new URI(generateBaseUrl());
      testClient(new ClientRequestFactory(base));

      // uncomment this to test urlConnection executor. This has some hiccups
      // now

//       testClient(new ClientRequestFactory(new URLConnectionClientExecutor(), base));
View Full Code Here

        InMemoryClientExecutor executor =
                new InMemoryClientExecutor(dispatcher);
        executor.setBaseUri(MOCK_BASE_URI);
        clientRequestFactory =
                new ClientRequestFactory(executor, MOCK_BASE_URI);

    }
View Full Code Here

TOP

Related Classes of org.jboss.resteasy.client.ClientRequestFactory

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.