Closed rayyee closed 11 years ago
Did you install the VigilanceExtension
? Because then it should throw an error. It is automatically included in the MVCSBundle
Thx creynders, I install the MVCSBundle
.
Because the 'processClassOrInstance' is instance, so the key is different.
Don`t execute overwriteMapping
const mapping:IViewProcessorMapping = _mappings[processClassOrInstance];
return mapping
? overwriteMapping(mapping, processClassOrInstance)
: createMapping(processClassOrInstance);
I think if you want to avoid this problem, can map getQualifiedClassName(processClassOrInstance)
.
But I do not know will not cause other problems?
Could you post your own code? I find it a bit confusing, since this:
viewProcessorMapper.mapMatcher( new TypeMatcher().anyOf( IAssetsInjection ) ).toProcess( InitializeViewProcessor );
viewProcessorMapper.mapMatcher( new TypeMatcher().anyOf( IAssetsInjection ) ).toProcess( InitializeViewProcessor );
definitely throws an overwrite mapping error. But apparently you want to map the same matchers to two different processor instances? Or?
Because I accidentally wrote.
Sorry, the error code is:
viewProcessorMapper.mapMatcher( new TypeMatcher().anyOf( IAssetsInjection ) ).toProcess( new InitializeViewProcessor );
viewProcessorMapper.mapMatcher( new TypeMatcher().anyOf( IAssetsInjection ) ).toProcess( new InitializeViewProcessor );
And because I want to prevent the wrong result map of two instance, so I hope to throw error.
Hi. We can't throw an error based on getQualifiedClassName
as it is perfectly valid to map two processors of the same class. For example, the instances may take configuration:
map...toProcess(new SomeProcessor(5));
map...toProcess(new SomeProcessor(6));
Thx, darscan.
new SomeProcessor(5);
new SomeProcessor(6);
Yes, I can pass parameters to distinguish between two processor. But I think the developers need to pay attention to this situation.
Thanks very much.
I mapMatcher and toProcess twice. then my processor execute twice. why not throw error? I found ViewProcessorMapper.toProcess(processClassOrInstance:*), if processClassOrInstance is instance, the _mappings maped 2 instance.
code:
viewProcessorMapper.mapMatcher( new TypeMatcher().anyOf( IAssetsInjection ) ).toProcess( InitializeViewProcessor ); viewProcessorMapper.mapMatcher( new TypeMatcher().anyOf( IAssetsInjection ) ).toProcess( InitializeViewProcessor );
then
InitializeViewProcessor.process... InitializeViewProcessor.process...
I need help! Thx.