XCC/J 3.2-9

com.marklogic.xcc.examples
Class OutputStreamInserter.DocBuilder

java.lang.Object
  extended bycom.marklogic.xcc.examples.OutputStreamInserter.DocBuilder
All Implemented Interfaces:
Runnable
Enclosing class:
OutputStreamInserter

public static class OutputStreamInserter.DocBuilder
extends Object
implements Runnable

A simple dummy content generator which writes to an OutputStream. This is a brain-dead example that simply generates dummy content. A real implementation might be fetching rows from an SQL database or some other transient source. You should only use this approach if you don't have a better option. If the data can be written to a temp file or provided as a standard InputStream then one of the provided implementations in ContentFactory should be used. Note also that inserting content this way is not eligible for automatic error recovery and you can get in trouble if you don't manage threads properly.


Constructor Summary
OutputStreamInserter.DocBuilder(OutputStream out, int lines)
          Initialize this instance.
 
Method Summary
 void run()
          Entry point when the new Thread starts.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OutputStreamInserter.DocBuilder

public OutputStreamInserter.DocBuilder(OutputStream out,
                                       int lines)
Initialize this instance.

Parameters:
out - An OutputStream to which content should be written.
lines - How many lines to generate.
Method Detail

run

public void run()
Entry point when the new Thread starts. This is where your real business logic would go, ulitmately writing data to the OutputStream.

Specified by:
run in interface Runnable

XCC/J 3.2-9

Copyright © 2003-2008 Mark Logic Corporation, All Rights Reserved.

Complete online documentation for MarkLogic Server, XQuery and related components may be found at developer.marklogic.com