gt;>>>
>>>>>>>
>>>>>>>>
>>>>>>>> On Jul 7, 2010, at 1:05 AM, Claus Ibsen wrote:
>>>>>>>>
>>>>>>>>> Hi
>>>>>>>>>
>>>>>>>>> In the patch on the ticket
&g
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
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
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
;> 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
&
t to also inspect and change the child
>>>>> Definitions prior to building.
>>>>>
>>>>> public interface DefinitionAwarePolicy extends Policy {
>>>>>Processor wrap(RouteContext routeContext,
>>>>> ProcessorDefinition processor
eProcessor(RouteContext routeContext) throws
>>>> Exception {
>>>> DelegateProcessor childProcessor = new DelegateProcessor();
>>>>
>>>> Policy policy = resolvePolicy(routeContext);
>>>> ObjectHelper.notNull(po
( policy instanceof Policy ) {
>>> target = policy.wrap(routeContext, childProcessor);
>>> } else {
>>> target = ((DefinitionAwarePolicy)policy).wrap(routeContext,
>>> this, childProcessor);
>>> }
>>>
routeContext,
>> this, childProcessor);
>>}
>>
>>childProcessor.setProcessor( this.createChildProcessor(routeContext,
>> true) );
>>
>> // wrap the target so it becomes a service and we can manage its
>> lifecycle
>>
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;
> }
> --
t;> > this, childProcessor);
>> > }
>> >
>> > childProcessor.setProcessor(
>> this.createChildProcessor(routeContext,
>> > true) );
>> >
>> > // wrap the target so it becomes a service and we c
> > this, childProcessor);
> >}
> >
> >childProcessor.setProcessor(
> this.createChildProcessor(routeContext,
> > true) );
> >
> > // wrap the target so it becomes a service and we can manage its
> > lifecycle
> >
> // 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
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
14 matches
Mail list logo