Gary Tully created ARTEMIS-4766:
-----------------------------------

             Summary: gate every newInstance call with a type check on the 
class to ensure we only call static initialisers of the expected type
                 Key: ARTEMIS-4766
                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4766
             Project: ActiveMQ Artemis
          Issue Type: Improvement
          Components: Configuration
    Affects Versions: 2.33.0
            Reporter: Gary Tully


On our extension points, where configuration provides the implementation class 
name, like plugins or transformers, we need to create an instance of the 
configured class at runtime.

We typically know the interface type we are expecting, so we can enforce this 
check before we create in instance, in that way we won't every call static 
initialises on the wrong type in error. In cases where some gadget can be 
injected into our configuration, it will need to be specialised for our 
interfaces to be effective, which creates one additional hurdle to jump over.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to