Skip to content

Instantly share code, notes, and snippets.

@theotherian
theotherian / ClientFactory.java
Last active July 23, 2020 11:21
configuring Jersey 2 client
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import org.apache.http.HttpHost;
import org.apache.http.conn.routing.HttpRoute;
import org.apache.http.impl.conn.PoolingClientConnectionManager;
import org.glassfish.jersey.apache.connector.ApacheClientProperties;
import org.glassfish.jersey.apache.connector.ApacheConnector;
import org.glassfish.jersey.client.ClientConfig;
import org.glassfish.jersey.client.ClientProperties;
@theotherian
theotherian / Jersey 2.0 client with generics
Last active December 20, 2015 22:18
Jersey 2.0 client with generics
It's easy to use Generics with Jersey 2.0 client
@theotherian
theotherian / ByteBuffer side effects
Created August 11, 2013 03:12
Bits.class is scary
Using ByteBuffer instances to allocate memory can be dodgy
There are two dependencies that Jersey 2.0 has for adapting its application to a Servlet instance.
An example of creating an in-memory HSQLDB server
Don't mix eager or subselect joins with max results; the by product is pretty nasty.
Subselects can select all entities in the associated table, and potentially issue an additional select for each parent, while joins often load duplicate entities due to the max results being applied to the row and not the parent.
@theotherian
theotherian / Maven Archetypes Part 3
Created July 9, 2013 04:59
Maven Archetype how tos Part 3
Files for creating a Maven Archtype - part 3
Files for creating Maven archetypes - part 2
XML for pom files to declare a dependency on Thread Local DNS
Files for creating Maven Archetypes - part 1