public void destroyObject(RestS3Service hc) throws ServiceException { hc.shutdown(); }
public void destroyObject(RestS3Service hc) throws ServiceException { hc.shutdown(); }
@Override public void close() throws IOException { try { input.close(); } finally { try { service.shutdown(); } catch (ServiceException error) { throw new IOException(String.format( "Can't shut down [%s] service!", service), error); } } }
public void close() throws ServiceException, IOException, InterruptedException { int z = 0; while (this.activeObjects.size() > 0) { Thread.sleep(1); z++; if (z > 30000) throw new IOException( "Unable to close s3 pool because close command timed out after 30 seconds"); } alock.lock(); try { for (RestS3Service s : this.passiveObjects) { s.shutdown(); } this.passiveObjects.clear(); } finally { alock.unlock(); } }
public void returnObject(RestS3Service hc) throws IOException { alock.lock(); try { this.activeObjects.remove(hc); } catch (Exception e) { SDFSLogger.getLog().error("Unable to get object out of pool ", e); throw new IOException(e.toString()); } finally { alock.unlock(); } try { if (this.passiveObjects.size() <= this.poolSize) this.passiveObjects.put(hc); else hc.shutdown(); } catch (Exception e) { SDFSLogger.getLog().error("Unable to get object out of pool ", e); throw new IOException(e.toString()); } finally { } }
service.shutdown();
@Override public boolean isInStorage() { try { RestS3Service service = null; try { service = new RestS3Service(new AWSCredentials(getAccess(), getSecret())); service.getObjectDetails(getBucket(), getPath()); return true; } finally { if (service != null) { service.shutdown(); } } } catch (ServiceException error) { return false; } }