Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » Provide Service Config Properties from Plug-in
Provide Service Config Properties from Plug-in [message #889923] Wed, 20 June 2012 09:17 Go to next message
Philippe Jacot is currently offline Philippe Jacot
Messages: 3
Registered: June 2012
Junior Member
We want to run a Scout Application in another RCP Application (Lotus Notes). As we are not managing the LN installations on the targeted Workstations, we have no easy way to change the applications config.ini file.

Is there a possiblity to provide the service properties from our Plug-ins?

Thanks for your responses & best regards
Philippe
Re: Provide Service Config Properties from Plug-in [message #889933 is a reply to message #889923] Wed, 20 June 2012 09:48 Go to previous messageGo to next message
Ivan Motsch is currently offline Ivan Motsch
Messages: 100
Registered: March 2010
Senior Member
In such a scenario it is typical that the LN manages the config.ini itself.
However, for this scenario there is an eclipse concept using externalized config.ini contributions. Also eclipse scout supports the use of multiple contributing config ini files.

See ConfigIniUtility javadoc for more details.

Basically you would require the LN installation to simply add one line:
external.configuration.area=[url | file | ${variable}]


If that is not feasible, you may override all services with special settings and rewrite the initializeService method.
I assume that would be an effort....

...so if there is sufficient interest and support, eclipse scout might add a more generalized method of configuring services.

Proposed change could be as follows

Current code (pseudo code):
class AbstractService{
 void initializeService() {
  ServiceUtility.injectConfigProperties(this);
 }
}


Proposed change (pseudo code):
class AbstractService{
 void initializeService() {
  //do not directly call ServiceUtility, but rather use a new extension point
  //default behaviour would be same as before
  ServiceUtility.initializeService(this);
 }
}


ServiceUtility.initializeService would use a new extension point "serviceInitializerFactory" with an interface
interface IServiceInitializerFactory{
  IServiceInitializer createInstance(IService rawService);
}


for every new service all contributing factories may provide such a new
IServiceInitializer (or null).
Now it might be that multiple initializers set values on the new service, or one initializer wants to exclusively do the setup.
Therefore we need to know the priority and concurrency level of the multiple initializers.

interface IServiceInitializer{
 /**
  * @return the run order of the initializer, the default ininitalizer has order 0
  */ 
 double getRunOrder();

 /**
  * @return one of then ServiceInitializerResult enums.
  * ServiceInitializerResult.CONINUE lets the following initializer do their job
  * ServiceInitializerResult.STOP breaks up and ignores the following initializers.
  */ 
 ServiceInitializerResult initializeService(IService service);
}


There is always a default initializer that accepts all services, has runOrder 0
and does the (current) code:
class DefaultServiceInitializer{
 double getRunOrder(){
  return 0;
 }

 ServiceInitializerResult initializeService(IService service){
  ServiceUtility.injectConfigProperties(service);
  return ServiceInitializerResult.CONINUE;
 }
}

Re: Provide Service Config Properties from Plug-in [message #889934 is a reply to message #889923] Wed, 20 June 2012 09:49 Go to previous messageGo to next message
Ivan Motsch is currently offline Ivan Motsch
Messages: 100
Registered: March 2010
Senior Member
If you require a change to eclipse scout, proposed in the previous post or something different, please create a bugzilla ticket and include this conversation so that others may follow.
Re: Provide Service Config Properties from Plug-in [message #889951 is a reply to message #889934] Wed, 20 June 2012 11:36 Go to previous messageGo to next message
Philippe Jacot is currently offline Philippe Jacot
Messages: 3
Registered: June 2012
Junior Member
Hi Ivan
Thanks for your quick reply.

Overriding the initialization method of all Services seems rather cumbersome and I expect it would lead to tricky errors when some services are forgotten. The external configuration file requires us to have some kind of installation other than providing an update site which I'd like to avoid if possible.

The proposed change sounds reasonable to me and I expect it would solve our problem as we could retrieve the properties from a plug-in or some configuration. Therefore I've created Bug 383083 (Sorry, I am not allowed to post a link to it) which contains your proposal for an additional extension point.

Best regards
Philippe
Re: Provide Service Config Properties from Plug-in [message #890023 is a reply to message #889951] Wed, 20 June 2012 15:54 Go to previous message
Jeremie Bresson is currently offline Jeremie Bresson
Messages: 756
Registered: October 2011
Senior Member
https://bugs.eclipse.org/bugs/show_bug.cgi?id=383083
Previous Topic:Table with dynamic number of columns
Next Topic:Widget showcase
Goto Forum:
  


Current Time: Mon Oct 20 18:17:34 GMT 2014

Powered by FUDForum. Page generated in 0.10981 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software