New property to eclipse scout service extension point

There is an interesting change request for the org.eclipse.scout.service Plug-In

The extension point “services” that is used to declaratively add osgi services and factories shall provide an additional checkbox “Create service immediately” which is checked by default.
This atttribute is used to control the moment when the service instance is effectively created.
true creates the service instance immediately when the extension point loads.
false does not create the service instance on extension point load. It creates the service instance lazy on the first usage of the service.

This can be useful if a service is for example listening for client notifications (to come up from the server) to perform some actions.
Consider a CTI service handling telephony events that come up from the server-side.

Example for the com.myapp.server.core Plug-In:
old plugin.xml entries:
<?xml version="1.0" encoding="UTF-8"?>
<plugin>
<extension point="org.eclipse.scout.service.services">
<service class="org.eclipse.scout.rt.server.services.common.ping.PingService"/>
<service class="com.myapp.server.core.services.process.FoodStoreService" factory="org.eclipse.scout.rt.server.services.ServerServiceFactory"/>
</extension>
</plugin>

new plugin.xml entries:
<?xml version="1.0" encoding="UTF-8"?>
<plugin>
<extension point="org.eclipse.scout.service.services">
<service class="org.eclipse.scout.rt.server.services.common.ping.PingService" createImmediately="false"/>
<service class="com.myapp.server.core.services.process.FoodStoreService" factory="org.eclipse.scout.rt.server.services.ServerServiceFactory" createImmediately="true"/>
</extension>
</plugin>

Datum
Kategorie