public class AsyncDocumentRequestHandlerImpl
- Object
- DefaultDocumentRequestHandler
- AsyncDocumentRequestHandlerImpl
ImplementsAsyncDocumentRequestHandler, DocumentRequestHandler
Implementation of the HTML components document request handler to allow simple
HTML support in CodenameOne.
Fields
protected static final Object LOCK |
Constructors
public AsyncDocumentRequestHandlerImpl() |
Methods
public void resourceRequestedAsync(DocumentInfo docInfo, IOCallback callback) | This method is called by HTMLComponent when a resource is requested asynchronously. |
public InputStream resourceRequested(DocumentInfo docInfo) | Implementations should return the document in the requested url as an InputStream This is triggered only for the main document requested and not for its resources. |
protected ConnectionRequest createConnectionRequest(DocumentInfo docInfo, IOCallback callback, Object[] response) |
Inherited methods
Field details
LOCK
protected static final Object LOCKConstructor details
AsyncDocumentRequestHandlerImpl
public AsyncDocumentRequestHandlerImpl()Method details
resourceRequestedAsync
public void resourceRequestedAsync(DocumentInfo docInfo, IOCallback callback)This method is called by HTMLComponent when a resource is requested asynchronously.
This method should return immediately and start a process of fetching the requested resource on another thread.
When the resource was fetched, the HTMLComponent.streamReady should be called.
Parameters
docInfoDocumentInfo- A DocumentInfo object representing the requested URL and its attributes
callbackIOCallback- The HTMLComponent that should be called back when the stream was fetched.
resourceRequested
public InputStream resourceRequested(DocumentInfo docInfo)Implementations should return the document in the requested url as an InputStream
This is triggered only for the main document requested and not for its resources.
Parameters
docInfoDocumentInfo- A DocumentInfo object representing the requested URL and its attributes
Returns
the document at the URL as an InputStream
createConnectionRequest
protected ConnectionRequest createConnectionRequest(DocumentInfo docInfo, IOCallback callback, Object[] response)