I have good some news.
Service initialization API is ready. It was theree days of great fun ;).
It's compatibilie with current implementation of services, but it allows
services to participate in differet stages of Turbine initialization,
including enforcing the order of initialization from within the code
(ie. one service requests service broker, that some other service
is initialized earlier to be available for use within this services
initialization method).
It is has very functional abstract (independent of Turbine) implemetation,
so if your class 'implements Service' and you want to use it outside of
Turbine, you extend BaseServiceBroker, override two methods: initMapping()
that creates mapping between service names and implementing classes
and getProperties(String name) that Services use to obtain their properties
from the broker. Then you use YourBroker.initService(String name, Object data)
to send any objects that your service that it needs for early initialization and
then YourBroker.getService(String name) and you are running.
Cool, huh?
Now I was able to make use of ServletConfig inside TurbineWebMacroService init.
Here is a snippet from my Turbine.properties file:
----
# WebMacro configuration
# The location of WebMacro configuration file, relative to webapp root
services.TurbineWebMacroService.properties=/WEB-INF/WebMacro.properties
# The path where WebMacro will look for templates, relative to webapp root
# use your system's path separator to specify multiple paths
services.TurbineWebMacroService.templates=/WEB-INF/templates
# The class that will act as a template provider in webmacro
# we can use default class from WebMacro (template path above is pushed into WebMacro
# configuration mechanism, so that class can pick it up), or some other custom class
services.TurbineWebMacroService.templates.provider=org.webmacro.resource.TemplateProvider
----
And it really works! Even more cool, isn't it? I think it will be great for TDK.
Now I'm woring on patches for people to try. I'm kind of tired and dizzy right now
so please give me an hour or so to finish it...
Rafal
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]