private void shutdown(Throwable error) { StreamUtils.safeClose(this); this.error = error; } }
@Override public synchronized void stop(final StopContext context) { StreamUtils.safeClose(client); client = null; }
@Override public void close() throws IOException { StreamUtils.safeClose(stream); } }
@Override public void close() throws IOException { if (!injectedClient) { safeClose(client); } }
@Override public void handleClose(Connection closed, IOException exception) { StreamUtils.safeClose(originalStrategy); }}); }
private void shutdown(Exception error) { StreamUtils.safeClose(this); this.error = error; } }
/** {@inheritDoc} */ @Override public synchronized void stop(StopContext context) { final ProcessControllerClient client = this.client; this.client = null; StreamUtils.safeClose(client); }
/** * The release method is the mechanism by which the tool signals to the DeploymentManager that the tool does not need it to * continue running connected to the platform. The tool may be signaling it wants to run in a disconnected mode or it is * planning to shutdown. When release is called the DeploymentManager may close any J2EE resource connections it had for * deployment configuration and perform other related resource cleanup. It should not accept any new operation requests * (i.e., distribute, start stop, undeploy, redeploy. It should finish any operations that are currently in process. Each * ProgressObject associated with a running operation should be marked as released (see the ProgressObject). */ public void release() { isConnected = false; StreamUtils.safeClose(client); }
private void shutdown(Exception error) { StreamUtils.safeClose(this); this.error = error; } }
@Override public void close() throws IOException { final List<InputStream> streams = getInputStreams(); for(final InputStream stream : streams) { StreamUtils.safeClose(stream); } } }
@Override public void copyStream(final DataOutput output) throws IOException { final FileInputStream is = new FileInputStream(file); try { StreamUtils.copyStream(is, output); is.close(); } finally { StreamUtils.safeClose(is); } }
@Override public void copyStream(final DataOutput output) throws IOException { final FileInputStream is = new FileInputStream(file); try { StreamUtils.copyStream(is, output); is.close(); } finally { StreamUtils.safeClose(is); } }
@Override public void copyStream(final DataOutput output) throws IOException { final FileInputStream is = new FileInputStream(file); try { StreamUtils.copyStream(is, output); is.close(); } finally { StreamUtils.safeClose(is); } }
@Override public void run() { try { responseAttachmentSupport.shutdown(); } finally { StreamUtils.safeClose(client); client = null; stopContext.complete(); } } };
void cleanup() { for (DeploymentActionImpl action : deploymentActions) { if (action.isInternalStream() && action.getContentStream() != null) { StreamUtils.safeClose(action.getContentStream()); } } }
protected void cleanup() { for (DeploymentActionImpl action : deploymentActions) { if (action.isInternalStream() && action.getContentStream() != null) { StreamUtils.safeClose(action.getContentStream()); } } }
public static void main(String[] args) throws Exception { DeploymentUtils utils = null; try { utils = new DeploymentUtils(); utils.addWarDeployment("jaxrs-example.war", true, HelloWorldResource.class.getPackage()); utils.deploy(); performCall(); } finally{ utils.undeploy(); safeClose(utils); } }
@Override protected void sendRequest(final int protocolVersion, final OutputStream outputStream) throws IOException { ByteDataOutput output = null; try { output = new SimpleByteDataOutput(outputStream); output.writeByte(DomainClientProtocol.PARAM_DEPLOYMENT_NAME); output.writeUTF(deploymentName); output.close(); } finally { safeClose(output); } }
@Override void handleRequest(String hostId, DataInput input, ActiveOperation.ResultHandler<Void> resultHandler, ManagementRequestContext<Void> context) throws IOException { domainController.unregisterRemoteHost(hostId, null, true); final FlushableDataOutput os = writeGenericResponseHeader(context); try { os.write(ManagementProtocol.RESPONSE_END); os.close(); resultHandler.done(null); // call stack (AbstractMessageHandler) handles failures } finally { StreamUtils.safeClose(os); } }
protected static void writeResponse(final Channel channel, final ManagementRequestHeader header, final byte param) throws IOException { final ManagementResponseHeader response = ManagementResponseHeader.create(header); final MessageOutputStream output = channel.writeMessage(); try { writeHeader(response, output); output.write(param); output.write(ManagementProtocol.RESPONSE_END); output.close(); } finally { StreamUtils.safeClose(output); } }