Package com.teamdev.jxbrowser.net
Interface UrlRequestJob
public interface UrlRequestJob
Represents the url request job for a URL request. Allows you to override the response data for
the URL request.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
An identifier of theUrlRequestJob
.static interface
The options needed to initializeUrlRequestJob
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
complete()
Notifies the engine that all the response data chunks are written and the request should be completed.void
fail()
Notifies the engine that an error occurred during writing the response data and the request should be failed.id()
Returns the identifier of this URL request job.void
write
(byte[] data) Appends a chunk of the response data to the URL request.
-
Method Details
-
id
UrlRequestJob.Id id()Returns the identifier of this URL request job. -
write
void write(byte[] data) Appends a chunk of the response data to the URL request. This method may be called multiple times to append several chunks. When all the chunks are written either thecomplete()
orfail()
method must be called to indicate that the request is completed or failed.- Parameters:
data
- the response data bytes- Throws:
ObjectClosedException
- when the URL request is already completed or failed
-
complete
void complete()Notifies the engine that all the response data chunks are written and the request should be completed.- Throws:
ObjectClosedException
- when the URL request is already completed or failed
-
fail
void fail()Notifies the engine that an error occurred during writing the response data and the request should be failed.- Throws:
ObjectClosedException
- when the URL request is already completed or failed
-