    All Packages    This Package  Previous  Next

# Interface sqlj.runtime.profile.util.ProfileIOContext

public interface interface ProfileIOContext

A profile IO context describes the information needed to read, load, customize, and write a serialized profile.

See Also:
  CustomizerHarness

##

PIO_ERROR
  Constant passed to `close` indicating that an error occured during profile customization.
PIO_MODIFIED
  Constant passed to `close` indicating that the profile (or jar file) was modified, and therefore does not need to be updated.
PIO_UNMODIFIED
  Constant passed to `close` indicating that the profile (or jar file) was not modified, and therefore does not need to be updated.

##

close(int)
  Closes any resources associated with this ProfileIOContext, renaming or removing resources as appropriate.
getErrorLog()
  Return an error log into which customization messages are added.
getInputStream()
  Returns an input stream from which the serialized profile can be read.
getLoader()
  Return the profile loader instance to use in instantiating the profile contained in the input stream.
getOutputStream()
  Returns an output stream into which a customized version of the serialized profile can be written.

##

PIO_UNMODIFIED

     public static final int PIO_UNMODIFIED

  Constant passed to `close` indicating that the profile (or jar file) was not modified, and therefore does not need to be updated. Any data written to the stream returned by `getOutputStream` may be discarded.

  See Also:
    close

PIO_MODIFIED

     public static final int PIO_MODIFIED

  Constant passed to `close` indicating that the profile (or jar file) was modified, and therefore does not need to be updated. Data written to the stream returned by `getOutputStream` should be recorded and saved.

  See Also:
    close

PIO_ERROR

     public static final int PIO_ERROR

  Constant passed to `close` indicating that an error occured during profile customization. Any data written to the stream returned by `getOutputStream` should be disregarded.

  See Also:
    close

##

getInputStream

     public abstract InputStream getInputStream() throws IOException

  Returns an input stream from which the serialized profile can be read. Each time this method is called, a new stream containing an unread profile should be returned. The stream is closed by the caller.

  Throws: IOException
    if an error occurs creating the input stream.

getOutputStream

     public abstract OutputStream getOutputStream() throws IOException

  Returns an output stream into which a customized version of the serialized profile can be written. Typically, this will represent the same logical stream as was read by getInputStream. Each time this method is called, a new stream should be returned. The stream is closed by the caller.

  Throws: IOException
    if an error occurs creating the output stream.

getErrorLog

     public abstract ErrorLog getErrorLog()

  Return an error log into which customization messages are added.

getLoader

     public abstract Loader getLoader()

  Return the profile loader instance to use in instantiating the profile contained in the input stream. Returns null if the default profile loader is to be used.

  See Also:
    instantiate

close

     public abstract void close(int status) throws IOException

  Closes any resources associated with this ProfileIOContext, renaming or removing resources as appropriate. The passed status indicates whether or not the profile was successfully written to the output stream returned by `getOutputStream`. This method is always called after getInputStream is called, and before a subsequent call to getInputStream is made.

  Parameters:
    status - one of the PIO_* constants
  Throws: IOException
    if this IOContext cannot be closed
  See Also:
    PIO_ERROR, PIO_UNMODIFIED, PIO_MODIFIED

    All Packages    This Package  Previous  Next