List of usage examples for org.apache.wicket.util.lang Checks notEmptyShort
public static void notEmptyShort(final String argument, final String name)
From source file:com.github.marting.wicket.datastore.memcached.MemcachedDataStore.java
License:Apache License
/** * Creates MemcachedClient with the provided hostname and port * in the settings// w ww . ja v a 2s . c o m * * @param settings The configuration for the client * @return A MemcachedClient */ private static MemcachedClient createClient(IMemcachedSettings settings) { Args.notNull(settings, "settings"); String host = settings.getHost(); Checks.notEmptyShort(host, "host"); int port = settings.getPort(); Checks.withinRangeShort(1, 65535, port, "port"); try { MemcachedClient memcachedClient = new MemcachedClient(new InetSocketAddress(host, port)); return memcachedClient; } catch (IOException iox) { throw new RuntimeException(iox); } }