Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.mozilla.jrex.io
Interface JRexStreamListener

All Known Implementing Classes:
  JRexStreamListenerImpl

public interface JRexStreamListener

JRexStreamListener interface is java counter part of nsIStreamListener.

Version:
  1.0
Author:
  C.N.Medappa

Method Summary
`boolean` | `onDataAvailable(String requestURI, int requestStatus, boolean isRequestPending, Object ctxt, JRexInputStream in, int off, int len)` Called when the next chunk of data (corresponding to the request) may be read without blocking the calling thread.
`boolean` | `onStartRequest(String requestURI, int requestStatus, boolean isRequestPending, Object ctxt, Hashtable conInfo)` Called to signify the beginning of an asynchronous request.
`void` | `onStopRequest(String requestURI, int requestStatus, boolean isRequestPending, Object ctxt, int statusCode)` Called to signify the end of an asynchronous request.

Method Detail

### onStartRequest

    public boolean onStartRequest(String requestURI,
                                  int requestStatus,
                                  boolean isRequestPending,
                                  Object ctxt,
                                  Hashtable conInfo)

  Called to signify the beginning of an asynchronous request.

  Parameters:
    `requestURI` - request URI corresponding to the source of the data
    `requestStatus` - request Status corresponding to the source of the data
    `isRequestPending` - request pending corresponding to the source of the data
    `ctxt` - user defined context
    `conInfo` - List additional information for request, E.g. the response headers for the corresponding http transaction.
  Returns:
    boolean return `false` to cancel the request.

### onStopRequest

    public void onStopRequest(String requestURI,
                              int requestStatus,
                              boolean isRequestPending,
                              Object ctxt,
                              int statusCode)

  Called to signify the end of an asynchronous request. This call is always preceded by a call to onStartRequest.

  Parameters:
    `requestURI` - request URI corresponding to the source of the data
    `requestStatus` - request Status corresponding to the source of the data
    `isRequestPending` - request pending corresponding to the source of the data
    `ctxt` - user defined context
    `statusCode` - reason for stopping, NS_OK if successful.

### onDataAvailable

    public boolean onDataAvailable(String requestURI,
                                   int requestStatus,
                                   boolean isRequestPending,
                                   Object ctxt,
                                   JRexInputStream in,
                                   int off,
                                   int len)

  Called when the next chunk of data (corresponding to the request) may be read without blocking the calling thread. The onDataAvailable impl must read exactly |len| bytes of data before returning.

  Parameters:
    `requestURI` - request URI corresponding to the source of the data
    `requestStatus` - request Status corresponding to the source of the data
    `isRequestPending` - request pending corresponding to the source of the data
    `ctxt` - user defined context
    `in` - input stream containing the data chunk
    `off` - current stream position
    `len` - number of bytes available in the stream
  Returns:
    return `false` to cancel the request.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004 C.N.Medappa. All Rights Reserved.