PreEmptive Protection - DashO v8.2 User Guide

Projects using the Spring Framework

Spring bean support in PreEmptive Protection - DashO is provided primarily by the Spring Bean special class. It is configured with the class name (or name pattern) and optional entry points (e.g. init, destroy, and factory methods). During processing, the property methods (get*(), is*(), and set*(*)), public constructors, and configured entry points, will be followed to determine unused methods. The class, configured entry points, property methods and non-property methods can be configured to be renamed.

DashO will scan the Spring XML files during each build and will update any class references in the XML if DashO has renamed the corresponding Java class. It will update direct class references as well as class names listed in parameters or argument types. It will also update bean property names and entry point method names if DashO renamed them. Abstract beans (E.G. bean definitions without classes) will also have related property names and method names updated as it is assumed they are related to the renamed beans.

To get the most benefit out of DashO's Spring support, we suggest starting your project by using the New Project Wizard, and then making individual adjustments to the special classes as needed.

The New Project Wizard will identify Spring XML files, scan them for bean class references and configure Spring Bean special classes. When the New Project Wizard finds a bean definition in a Spring XML file, it:

  • Creates a new Spring Bean special class for the identified class.

  • Looks for configured init-method or destroy-method attributes in the XML and adds them to the special class as entry points. If no init-method or destroy-method attribute was found, it will check for default-init-method or default-destroy-method attributes, respectively, and instead adds them to the special class as entry points.

  • Looks for a configured factory-method directly on the bean and adds it to the special class as an entry point.

  • Looks for configured lookup-method or replaced-method elements and adds them to the special class as entry points.

  • Looks for constant values referenced using util:constant static-field or the org.springframework.beans.factory.config.FieldRetrievingFactoryBean bean.

Please take a look at the SpringBean sample project as it provides examples of DashO’s support.

Note: If you use the factory-bean attribute, you will need to manually add the corresponding factory-method as an entry point on the appropriate class.
If you use replaced-method functionality, you may need to specify the signature using the arg-type elements so the correct method will be identified after renaming.
If you use the FieldRetrievingFactoryBean the targetObject attribute is not supported.

PreEmptive Protection - DashO Version 8.2.0. Copyright © 2017 PreEmptive Solutions, LLC