/** * This is used to execute the task. It is up to the specific * task implementation to decide what to do when executed. If * the task needs to read or write data then it can attempt * to perform the read or write, if it incomplete the it can * be scheduled for execution with the reactor. */ @Override public void execute() throws IOException{ state.commit(); } }
/** * This is the <code>SelectableChannel</code> which is used to * determine if the operation should be executed. If the channel * is ready for a given I/O event it can be run. For instance if * the operation is used to perform some form of read operation * it can be executed when ready to read data from the channel. * * @return this returns the channel used to govern execution */ public SelectableChannel getChannel() { return state.getChannel(); }
/** * This method is used to determine if the task is ready. This * is executed when the select operation is signalled. When this * is true the the task completes. If not then this will * schedule the task again for the specified select operation. * * @return this returns true when the task has completed */ @Override protected boolean ready() throws IOException { return state.receive(); } }
/** * This method will challenge the client for their certificate. * It does so by performing an SSL renegotiation. Successful * completion of the SSL renegotiation results in the client * providing their certificate, and execution of the task. * * @param completion task to be run on successful challenge */ private void resume(Runnable task) { try { trace.trace(CERTIFICATE_CHALLENGE); delegate.set(task); engine.setNeedClientAuth(true); engine.beginHandshake(); negotiation.resume(); } catch(Exception cause) { trace.trace(ERROR, cause); negotiation.cancel(); } } }
/** * This method is used to determine if the task is ready. This * is executed when the select operation is signalled. When this * is true the the task completes. If not then this will * schedule the task again for the specified select operation. * * @return this returns true when the task has completed */ @Override protected boolean ready() throws IOException { return state.send(); } }
/** * This is used to cancel the operation if it has timed out. This * is typically invoked when it has been waiting in a selector for * an extended duration of time without any active operations on * it. In such a case the reactor must purge the operation to free * the memory and open channels associated with the operation. */ public void cancel() { try { state.cancel(); }catch(Exception cause) { trace.trace(ERROR, cause); } }
/** * This is used to execute the task. It is up to the specific * task implementation to decide what to do when executed. If * the task needs to read or write data then it can attempt * to perform the read or write, if it incomplete the it can * be scheduled for execution with the reactor. */ protected void execute() throws IOException { boolean done = ready(); if(!done) { reactor.process(this, require); } else { state.resume(); } }
/** * This method will challenge the client for their certificate. * It does so by performing an SSL renegotiation. Successful * completion of the SSL renegotiation results in the client * providing their certificate, and execution of the task. * * @param completion task to be run on successful challenge */ private void resume(Runnable task) { try { trace.trace(CERTIFICATE_CHALLENGE); delegate.set(task); engine.setNeedClientAuth(true); engine.beginHandshake(); negotiation.resume(); } catch(Exception cause) { trace.trace(ERROR, cause); negotiation.cancel(); } } }
/** * This method is used to determine if the task is ready. This * is executed when the select operation is signaled. When this * is true the the task completes. If not then this will * schedule the task again for the specified select operation. * * @return this returns true when the task has completed */ @Override protected boolean ready() throws IOException { return state.send(); } }
/** * This is used to cancel the operation if it has timed out. This * is typically invoked when it has been waiting in a selector for * an extended duration of time without any active operations on * it. In such a case the reactor must purge the operation to free * the memory and open channels associated with the operation. */ public void cancel() { try { state.cancel(); }catch(Exception cause) { trace.trace(ERROR, cause); } }
/** * This is used to execute the task. It is up to the specific * task implementation to decide what to do when executed. If * the task needs to read or write data then it can attempt * to perform the read or write, if it incomplete the it can * be scheduled for execution with the reactor. */ protected void execute() throws IOException { boolean done = ready(); if(!done) { reactor.process(this, require); } else { state.resume(); } }
/** * This method will challenge the client for their certificate. * It does so by performing an SSL renegotiation. Successful * completion of the SSL renegotiation results in the client * providing their certificate, and execution of the task. * * @param completion task to be run on successful challenge */ private void resume(Runnable task) { try { trace.trace(CERTIFICATE_CHALLENGE); delegate.set(task); engine.setNeedClientAuth(true); engine.beginHandshake(); negotiation.resume(); } catch(Exception cause) { trace.trace(ERROR, cause); negotiation.cancel(); } } }
/** * This is the <code>SelectableChannel</code> which is used to * determine if the operation should be executed. If the channel * is ready for a given I/O event it can be run. For instance if * the operation is used to perform some form of read operation * it can be executed when ready to read data from the channel. * * @return this returns the channel used to govern execution */ public SelectableChannel getChannel() { return state.getChannel(); }
/** * This is used to execute the task. It is up to the specific * task implementation to decide what to do when executed. If * the task needs to read or write data then it can attempt * to perform the read or write, if it incomplete the it can * be scheduled for execution with the reactor. */ @Override public void execute() throws IOException{ state.commit(); } }
/** * This method is used to determine if the task is ready. This * is executed when the select operation is signalled. When this * is true the the task completes. If not then this will * schedule the task again for the specified select operation. * * @return this returns true when the task has completed */ @Override protected boolean ready() throws IOException { return state.send(); } }
/** * This method is used to determine if the task is ready. This * is executed when the select operation is signalled. When this * is true the the task completes. If not then this will * schedule the task again for the specified select operation. * * @return this returns true when the task has completed */ @Override protected boolean ready() throws IOException { return state.receive(); } }
/** * This is used to cancel the operation if it has timed out. This * is typically invoked when it has been waiting in a selector for * an extended duration of time without any active operations on * it. In such a case the reactor must purge the operation to free * the memory and open channels associated with the operation. */ public void cancel() { try { state.cancel(); }catch(Exception cause) { trace.trace(ERROR, cause); } }
/** * This is used to execute the task. It is up to the specific * task implementation to decide what to do when executed. If * the task needs to read or write data then it can attempt * to perform the read or write, if it incomplete the it can * be scheduled for execution with the reactor. */ protected void execute() throws IOException { boolean done = ready(); if(!done) { reactor.process(this, require); } else { state.resume(); } }
/** * This is the <code>SelectableChannel</code> which is used to * determine if the operation should be executed. If the channel * is ready for a given I/O event it can be run. For instance if * the operation is used to perform some form of read operation * it can be executed when ready to read data from the channel. * * @return this returns the channel used to govern execution */ public SelectableChannel getChannel() { return state.getChannel(); }
/** * This is used to execute the task. It is up to the specific * task implementation to decide what to do when executed. If * the task needs to read or write data then it can attempt * to perform the read or write, if it incomplete the it can * be scheduled for execution with the reactor. */ @Override public void execute() throws IOException{ state.commit(); } }