oracle.com/javase/tutorial/sound/SPI-intro.html">SPI Mechanism introduced in Java 6), and are constructed using a zero-arg constructor. The {@link #setBRJS setBRJS()} method is used in lieu of a parameterized constructor, and is invoked before any non-
identifier methods(see below).
Because plug-ins form part of the model, yet use the model to initialize themselves, an untenable circular dependency exists. To overcome this problem, each concrete plug-in instance is wrapped inside a virtual proxy that delays plug-in initialization until somebody attempts to actually use the plug-in. Since code interested in interacting with a subset of the plug-ins will often need to query all of them to locate the ones it needs, certain identifier-methods are proxied through before the object's {@link #setBRJS setBRJS()} method has been invoked, which plug-in authors must be aware of.
Another consequence of wrapping all plug-ins in a virtual proxy is that the instanceof
operator and the Object.getClass()
method do not work as expected. The {@link #instanceOf instanceOf()} and {@link #getPluginClass} methods are provided to overcome these deficiencies.