Subclassed deployers would have called setName in the constructor of the subclass.
Now an user who wants to have something like:
<bean name="specialdeployer" class="subclassOfAbsParsDeplWithOut"> <property name="name">sec-config.xml"</property> </bean>
will see the IllegalArgumentException because of a setName call when the ctr of "specialdeployer" would have called setName with a standard name of metadata file.
Just a doubt.
I think I can just remove that check.
Then it's up to the user to figure out that he over wrote deployer's name.
I do not think having multiple names for metadata files such as web.xml, web-2.xml, special.xml is harmful because we can have deployments with any of these 3 xmls being served by this deployer.
That is why, addName is a good addition to the deployer.
If you remove that check, then you will probably have to do addName yourself if you want the feature of single deployer taking care of multiple metadata files.
addName doesn't make sense if you ask me,
since you still need do a bunch of stuff before it's usable.
e.g. map file to output
Perhaps only in MultipleVFSParsingDeployer,
but more like MultipleVFSParsingDeployer::addMapping(String, Class).
Since you are removing the explicit check (name !=null) in the setName, it should be fine. Since many of the deployers in AS5 extend the AbstractPDwithoutput, this issue is a tricky thing.