I'm currently implementing a spec, JSR319, which has an agent factory that seems dictate that one should instantiate an agent singleton using a system property to specify the agent's class name; the class is AvailabilityAgentFactory. So, IIUC, this requires that I use Class.forName() to instantiate it.

Now, having attended brother Hargrave's traveling salvation show where he preached about the evils of Class.forName(), I'm obviously a little nervous about my immortal soul. Luckily the spec is still in early draft review. I wonder what to recommend to them.

My current thinking is to ask them to provide a static setAvailabilityAgent to set the singleton instead of instantiating it. This will allow OSGi implementations better control over where the agent gets instantiated.

Thoughts?

It sure would be cool to have a white paper to hand to these Expert Groups on how to behave nicely in an OSGi world.


Regards,
Alan


_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to