[ 
https://issues.apache.org/jira/browse/WICKET-1847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12634178#action_12634178
 ] 

Igor Vaynberg commented on WICKET-1847:
---------------------------------------

you can do whatever configuration you want in application.init(), why do we 
need to introduce yet another way to configure this?

the two options are there just to provide the most convinient prepackaged 
defaults, but there isnt much use beyound that.

> Custom, user defined, configuration types plus configuration type change 
> during runtime
> ---------------------------------------------------------------------------------------
>
>                 Key: WICKET-1847
>                 URL: https://issues.apache.org/jira/browse/WICKET-1847
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>            Reporter: Bruno Borges
>             Fix For: 1.4-M4, 1.5-M1
>
>         Attachments: patch.diff
>
>
> Currently, there's only two configuration types (DEVELOPMENT, DEPLOYMENT) and 
> both are hardcoded. Because Application.configure() is final, there's no 
> (easy) way to provide customized configurations and no out-of-box API to code 
> these.
> The idea is to give org.apache.wicket.Application a new method called 
> add(IApplicationConfiguration<? extends Application>) and from there, the 
> user can define custom configuration types.
> Wicket's default configuration types will still be there if the user do not 
> replace them (creating configurators with "deployment" or "development" as 
> the name, but still is possible to override).
> There will be also the possibility to change the configuration type easily 
> during runtime with setConfigurationType.
> The default configuration type will still be defined the current way (VM 
> parameter, Filter parameter)
> The configuration is now made during the initializeComponents() because of 
> procedural methods. Calling setConfigurationType(String) with the user 
> defined *hard-coded* getDefaultConfigurationType() during internalInit() 
> would throw an exception because the custom IApplicationConfigurator hasn't 
> been added yet (it is added during init() ... usually).
> This patch also avoids subsequent calls to initializeComponents(), throwing 
> an IllegalStateException. 
> * Issues with this patch
> - There are 6 references pointing to getConigurationType comparing the 
> returned value with Application.DEVELOPMENT to do certain things.
> - The method getConfigurationType() is now final (and of course, 
> implemented). People who wants to change the configuration type, should call 
> setConfigurationType(String). This will recall configure() method to 
> reconfigure the application (runtime configuration type change support)
> The patch does not break those references at all with current 
> implementations, as the two default configuration types still live in there, 
> but it would be better to turn those if conditions to some sort of settings.
> Also, the patch fixes WICKET-1317 for 1.4/1.5 as well.
> ** IMPORTANT NOTE **
> Because of some problem with Eclipse, the provided code formatter didn't work 
> well, so before applying the patch, format the code and confirm the 
> differences with trunk.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to