Re: Using Policy to alter Definitions before building

2010-07-07 Thread Claus Ibsen
gt;>>> >>>>>>> >>>>>>>> >>>>>>>> On Jul 7, 2010, at 1:05 AM, Claus Ibsen wrote: >>>>>>>> >>>>>>>>> Hi >>>>>>>>> >>>>>>>>> In the patch on the ticket &g

Re: Using Policy to alter Definitions before building

2010-07-07 Thread Hadrian Zbarcea
s passed into the wrap is just a dummy delegate. >>>>>>>> This breaks the contract that its the actual processor being wrapped. >>>>>>>> So now there is a different in semantic between the regular wrap and >>>>>>>> the new wrap with the definition. This is real

Re: Using Policy to alter Definitions before building

2010-07-07 Thread Claus Ibsen
efinition. This is really not good. >>>>>>> >>>>>>> I am inclined to vote -1 on this and look for the alternative solution >>>>>>> with the ProcessorCreater API >>>>>>> >>>>>>> >>>>>>&g

Re: Using Policy to alter Definitions before building

2010-07-07 Thread Hadrian Zbarcea
gt;>>>>>> change/augment the child definitions before they are built. My current >>>>>>> use >>>>>>> case for this is so I can augment the DataFormats, with additional >>>>>>> configurations. Additionally this Policy a

Re: Using Policy to alter Definitions before building

2010-07-07 Thread Claus Ibsen
;> achieve, here is a change that while a little clunky (due api >>>>>> compatability) >>>>>> should achieve the job. This allows the wrap to still call the child >>>>>> Process, via the delegate, but to also inspect and change the child &

Re: Using Policy to alter Definitions before building

2010-07-07 Thread Hadrian Zbarcea
t to also inspect and change the child >>>>> Definitions prior to building. >>>>> >>>>> public interface DefinitionAwarePolicy extends Policy { >>>>>Processor wrap(RouteContext routeContext, >>>>> ProcessorDefinition processor

Re: Using Policy to alter Definitions before building

2010-07-06 Thread Claus Ibsen
eProcessor(RouteContext routeContext) throws >>>> Exception { >>>>        DelegateProcessor childProcessor = new DelegateProcessor(); >>>> >>>>        Policy policy = resolvePolicy(routeContext); >>>>        ObjectHelper.notNull(po

Re: Using Policy to alter Definitions before building

2010-07-06 Thread Claus Ibsen
( policy instanceof Policy ) { >>>            target = policy.wrap(routeContext, childProcessor); >>>        } else { >>>            target = ((DefinitionAwarePolicy)policy).wrap(routeContext, >>> this, childProcessor); >>>        } >>>

Re: Using Policy to alter Definitions before building

2010-07-06 Thread Hadrian Zbarcea
routeContext, >> this, childProcessor); >>} >> >>childProcessor.setProcessor( this.createChildProcessor(routeContext, >> true) ); >> >> // wrap the target so it becomes a service and we can manage its >> lifecycle >>

Re: Using Policy to alter Definitions before building

2010-07-06 Thread Claus Ibsen
   childProcessor.setProcessor( this.createChildProcessor(routeContext, > true) ); > >        // wrap the target so it becomes a service and we can manage its > lifecycle >        WrapProcessor wrap = new WrapProcessor(target, childProcessor); >        return wrap; >    } > --

Re: Using Policy to alter Definitions before building

2010-07-05 Thread Claus Ibsen
t;> > this, childProcessor); >> >        } >> > >> >        childProcessor.setProcessor( >> this.createChildProcessor(routeContext, >> > true) ); >> > >> >        // wrap the target so it becomes a service and we c

Re: Using Policy to alter Definitions before building

2010-07-05 Thread Mark Proctor
> > this, childProcessor); > >} > > > >childProcessor.setProcessor( > this.createChildProcessor(routeContext, > > true) ); > > > > // wrap the target so it becomes a service and we can manage its > > lifecycle > >

Re: Using Policy to alter Definitions before building

2010-07-05 Thread Claus Ibsen
>        // wrap the target so it becomes a service and we can manage its > lifecycle >        WrapProcessor wrap = new WrapProcessor(target, childProcessor); >        return wrap; >    } > -- > View this message in context: > http://camel.465427.n5.nabble.com/Using-Policy

Using Policy to alter Definitions before building

2010-07-05 Thread Mark Proctor
r(routeContext, true) ); // wrap the target so it becomes a service and we can manage its lifecycle WrapProcessor wrap = new WrapProcessor(target, childProcessor); return wrap; } -- View this message in context: http://camel.465427.n5.nabble.com/Using-Policy-to-alter-Definit