1 Reply Latest reply on Jul 17, 2007 9:19 AM by Gavin King

    uninstall component by overriding the installed attribute

    Dan Allen Master

      I was doing some playing around with defining components in seam, using the components.xml to provide overrides, when I came across behavior I did not expect. What I am trying to do is use the components.xml file to effectively "uninstall" a component, or to put it in other terms, prevent the component from being installed.

      Consider the case where you have a component (defined with the @Name annotation) that you want to prevent from loading, perhaps in a unit test or another conditional runtime scenario. You may think that you can do:

      <component name="componentA" class="ComponentA" installed="false" precedence="50" />

      However, this doesn't work because it is interpreted as meaning that you do not want to install this particular component definition. You are not overriding the installed flag on the lower precedence component.

      I wonder if there is some other way of "disabling" a component that is installed by default. Perhaps a third value, never, could be added to the installed attribute. This value would mean that you don't want to install this component and you don't want to install the original component either.

      Thoughts? Am I crazy for wanting to do this?