commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Christensen <stnch...@xmission.com>
Subject [pipeline] branches and emit
Date Wed, 13 Sep 2006 03:29:59 GMT
Hi Kris,

I'm planning to have a number of branches and sub-branches on a pipeline.
At the end of a branch pipeline, I'd like to emit objects to another 
pipeline branch.

e.g. my config file might look like (I'm leaving out the factories /
listeners to make the example simpler):

<pipeline>
    ...
    stages
    ...
    <stage className="...BranchRouterStage"
	toBranches="branch1"/>

    <branch>
        <pipeline key="branch1">
	    ...
	    stages
	    ...
	    <stage className="...BranchRouterStage"
		toBranches="branch1.subbranch"/>

	    <branch>
		<pipeline key="branch1.subbranch">
		</pipeline>
	    </branch>
	</pipeline>
    </branch>
    <branch>
        <pipeline key="branch2">

	    ...
	    stages
	    ...
	</pipeline>
    </branch>
	
</pipeline>

At the moment, BaseStage.emit(branch,obj) uses
StageContext.getBranchFeeder() to find a named branch, but it only finds
branches of the current context. 

In the above example, stages of the main branch can emit objects to
'branch1' and 'branch2' and stages of 'branch1' can emit objects to
'branch1.subbranch'. But, stages within 'branch1' can't emit objects
to 'branch2'.

At the moment, I think I can make it work as is (define the pipeline
such that the stages have access to the right branches)... but it seems
like it might be useful to allow stages to emit an object to any branch
pipeline.

How would you recommend making a change like that to commons-pipeline?
Would it make more sense to keep a Map of branch-keys to Pipelines at
the root level (I guess that would mean all branch-keys would have to be
globally unique). Or, should I traverse the tree of branch-pipelines to
find the named branch-pipline?

-Steve


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message