Adrian Crum wrote:
> Adam Heath wrote:
>> Adrian Crum wrote:
>>> Adam Heath wrote:
>>>> I discovered that when I split application/framework, that there were
>>>> exceptions printed at startup.  It tries to load a bunch of freemarker
>>>> transforms, but the classes don't exist for that; I'll fix that problem
>>>> by using the META-INF/services framework.
>>> FreeMarkerWorker should only log a warning, not throw an exception.
>>
>> So?  Exceptions are bad, anytime they are printed.  Makes it harder to
>> find real problems.
>>
>> Besides, the config for this resides in framework, while the code
>> resides in applications.  That's bad, and completely fixable.
> 
> That's because there was no common place to put the
> applicationTransforms.properties file in the applications folder.

Each appliation that has a Freemarker transform will add a line to it's
own file in applications/foo/src/META-INF/services/$service_name.  Then,
javax.imageio.spi.ServiceRegistry will be used to find those, and
instante all that are on the classpath.

ps: The above class is for java < 1.6.  In 1.6, it was moved and
reworked into java.util.ServiceLoader.

Reply via email to