final List<InetSocketAddress> isaLocations = AddrUtil.getAddresses(locations.getValue());
this.cache = SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<MemcachedClient>()
{
public MemcachedClient run() throws IOException
{
ObjectParameter op = params.getObjectParam(CONNECTION_FACTORY_CREATOR);
if (op == null || op.getObject() == null)
{
LOG.debug("No connection factory creator has been defined, "
+ "so we will use the BinaryConnectionFactory by default");
return new MemcachedClient(new BinaryConnectionFactory(), isaLocations);
}
else if (!(op.getObject() instanceof ConnectionFactoryCreator))
{
throw new IllegalArgumentException("The parameter '" + CONNECTION_FACTORY_CREATOR
+ "' must refer to a ConnectionFactoryCreator.");
}
else
{
return new MemcachedClient(((ConnectionFactoryCreator)op.getObject()).create(), isaLocations);
}
}
});
ValueParam vp = params.getValueParam(DEFAULT_EXPIRATION_TIMEOUT);