/** * Suspend the {@link Response}. Suspending a {@link Response} will * tell the underlying container to avoid recycling objects associated with * the current instance, and also to avoid commiting response. */ public void suspend(){ suspend(Long.MAX_VALUE); }
/** * Suspend the {@link Response}. Suspending a {@link Response} will * tell the underlying container to avoid recycling objects associated with * the current instance, and also to avoid commiting response. */ public void suspend(){ suspend(Long.MAX_VALUE); }
/** * Suspend the {@link Response}. Suspending a {@link Response} will * tell the underlying container to avoid recycling objects associated with * the current instance, and also to avoid commiting response. * * @param timeout The maximum amount of time, in milliseconds, * a {@link Response} can be suspended. When the timeout expires (because * nothing has been written or because the {@link Response#resume()} * or {@link Response#cancel()}), the {@link Response} will be automatically * resumed and commited. Usage of any methods of a {@link Response} that * times out will throw an {@link IllegalStateException}. * */ public void suspend(long timeout){ suspend(timeout,null,null); }
/** * Suspend the {@link Response}. Suspending a {@link Response} will * tell the underlying container to avoid recycling objects associated with * the current instance, and also to avoid commiting response. * * @param timeout The maximum amount of time, in milliseconds, * a {@link Response} can be suspended. When the timeout expires (because * nothing has been written or because the {@link Response#resume()} * or {@link Response#cancel()}), the {@link Response} will be automatically * resumed and commited. Usage of any methods of a {@link Response} that * times out will throw an {@link IllegalStateException}. * */ public void suspend(long timeout){ suspend(timeout,null,null); }
/** * Suspend the {@link Response}. Suspending a {@link Response} will * tell the underlying container to avoid recycling objects associated with * the current instance, and also to avoid commiting response. When the * {@link Response#resume()} is invoked, the container will make sure {@link CompletionHandler#resumed} * is invoked with the original <tt>attachement</tt>. When the * {@link Response#cancel()} is invoked, the container will make sure {@link CompletionHandler#cancelled} * is invoked with the original <tt>attachement</tt>. If the timeout expires, the * {@link CompletionHandler#cancelled} is invoked with the original <tt>attachement</tt> and * the {@link Response} commited. * * @param timeout The maximum amount of time, in milliseconds, * a {@link Response} can be suspended. When the timeout expires (because * nothing has been written or because the {@link Response#resume()} * or {@link Response#cancel()}), the {@link Response} will be automatically * resumed and commited. Usage of any methods of a {@link Response} that * times out will throw an {@link IllegalStateException}. * @param attachment Any Object that will be passed back to the {@link CompletionHandler} * @param competionHandler a {@link CompletionHandler} */ public void suspend(long timeout,A attachment, CompletionHandler<? super A> competionHandler){ suspend(timeout, attachment, competionHandler, null); }
/** * Suspend the {@link Response}. Suspending a {@link Response} will * tell the underlying container to avoid recycling objects associated with * the current instance, and also to avoid commiting response. When the * {@link Response#resume()} is invoked, the container will make sure {@link CompletionHandler#resumed} * is invoked with the original <tt>attachement</tt>. When the * {@link Response#cancel()} is invoked, the container will make sure {@link CompletionHandler#cancelled} * is invoked with the original <tt>attachement</tt>. If the timeout expires, the * {@link CompletionHandler#cancelled} is invoked with the original <tt>attachement</tt> and * the {@link Response} commited. * * @param timeout The maximum amount of time, in milliseconds, * a {@link Response} can be suspended. When the timeout expires (because * nothing has been written or because the {@link Response#resume()} * or {@link Response#cancel()}), the {@link Respons} will be automatically * resumed and commited. Usage of any methods of a {@link Response} that * times out will throw an {@link IllegalStateException}. * @param attachment Any Object that will be passed back to the {@link CompletionHandler} * @param competionHandler a {@link CompletionHandler} */ public void suspend(long timeout,A attachment, CompletionHandler<? super A> competionHandler){ ra = new ResponseAttachment(timeout,attachment, competionHandler,this); suspend(timeout, attachment, competionHandler, ra); }
/** * Suspend the {@link GrizzlyResponse}. Suspending a {@link GrizzlyResponse} will * tell the underlying container to avoid recycling objects associated with * the current instance, and also to avoid commiting response. When the * {@link GrizzlyResponse#resume()} is invoked, the container will * make sure {@link CompletionHandler#resumed} * is invoked with the original <tt>attachement</tt>. When the * {@link GrizzlyResponse#cancel()} is invoked, the container will * make sure {@link CompletionHandler#cancelled} * is invoked with the original <tt>attachement</tt>. If the timeout expires, the * {@link CompletionHandler#cancelled} is invoked with the original <tt>attachement</tt> and * the {@link Response} commited. * * @param timeout The maximum amount of time, in milliseconds, * a {@link GrizzlyResponse} can be suspended. When the timeout expires (because * nothing has been written or because the {@link GrizzlyResponse#resume()} * or {@link GrizzlyResponse#cancel()}), the {@link GrizzlyResponse} will be automatically * resumed and commited. Usage of any methods of a {@link Response} that * times out will throw an {@link IllegalStateException}. * @param attachment Any Object that will be passed back to the {@link CompletionHandler} * @param competionHandler a {@link CompletionHandler} */ public void suspend(long timeout,A attachment, CompletionHandler<? super A> competionHandler){ checkResponse(); response.suspend(timeout, attachment, competionHandler, new GrizzlyResponseAttachment(timeout, attachment, competionHandler, this)); }
/** * Suspend the {@link GrizzlyResponse}. Suspending a {@link GrizzlyResponse} will * tell the underlying container to avoid recycling objects associated with * the current instance, and also to avoid commiting response. When the * {@link GrizzlyResponse#resume()} is invoked, the container will * make sure {@link CompletionHandler#resumed} * is invoked with the original <tt>attachement</tt>. When the * {@link GrizzlyResponse#cancel()} is invoked, the container will * make sure {@link CompletionHandler#cancelled} * is invoked with the original <tt>attachement</tt>. If the timeout expires, the * {@link CompletionHandler#cancelled} is invoked with the original <tt>attachement</tt> and * the {@link Response} commited. * * @param timeout The maximum amount of time, in milliseconds, * a {@link GrizzlyResponse} can be suspended. When the timeout expires (because * nothing has been written or because the {@link GrizzlyResponse#resume()} * or {@link GrizzlyResponse#cancel()}), the {@link GrizzlyResponse} will be automatically * resumed and commited. Usage of any methods of a {@link Response} that * times out will throw an {@link IllegalStateException}. * @param attachment Any Object that will be passed back to the {@link CompletionHandler} * @param competionHandler a {@link CompletionHandler} */ public void suspend(long timeout,A attachment, CompletionHandler<? super A> competionHandler){ checkResponse(); response.suspend(timeout, attachment, competionHandler, new GrizzlyResponseAttachment(timeout, attachment, competionHandler, this)); }