cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Max Larsson <max.lars...@abz-informatik.com>
Subject AbstractEnvirnoment (Call a pipline from another Thread)
Date Thu, 04 Aug 2005 13:09:34 GMT
Hi,

i developing a transformer which start a buncch of child
threads. This child threads shall request a pipline and
manipulate the sax events before they are collected from
the parent thread for streaming into the pipline of the
main thread.

My problem lies within the child thread a request to pipeline.
I made the follwoing code to construct a envirnoment:

 > AbstractEnvironment env	= new BackgroundEnvironment( 
getLogger(),context );
 > Processor processor = (Processor)manager.lookup( Processor.ROLE );
 > Object key = CocoonComponentManager.startProcessing( env );
 > CocoonComponentManager.enterEnvironment( env,new 
WrapperComponentManager( manager ),processor );

If a now call the follwoing code (the consumer is SaxBuffer) it fails
with a Nullpointer exception:

 > SourceUtil.toSAX( resource,consumer,null,false );

But if i make the follwing the request works(?):

 > InputStream in = resource.getInputStream();
 > while( in.available() > 0 )
 >   System.err.print( (char)in.read() );

I track the NP done to that the  producer is null during construction
of the pipeline. But why does it behave so, or better what have i done
wrong (i guess in construction my envirnoment)?

regards

Max


Mime
View raw message