Saturday, December 12, 2009

dmServer plans and osgi services

0 comments
SpringSource dmServer is very nice piece of equipment. One of the major additions to the OSGi arsenal is concept of plans. Plans are deployment descriptors that allow for composition of application assemblies and provided added capabilities like scoping. You can think of scoped plan as a pseudo bundle that shades all included artifacts and creates a concept of a nested classloader. Very similar to jee concept of nesting wars and ejb-jars in ear. This is very useful addition that allows normal use of ORM libraries like hibernate that use TCCL (thread context class loader) and expect all classes to be found by classpath scanning. Scoping also hides services published within a scoped plan. No service gets out from a scope into a global service registry.
This is all nice and dandy, but what if you do want to "jail break" a service from a plan? Well there is a very simple way to do it. As Glyn describes in this thread on SpringSource dmServer forums, it's as simple as adding a service property.

Example:


<service id="publishIntoGlobal" interface="java.lang.CharSequence">
<service-properties>
<beans:entry key="com.springsource.service.scope" value="global" />
</service-properties>
<beans:bean class="java.lang.String">
<beans:constructor-arg value="foo"/>
</beans:bean>
</service>

Friday, December 11, 2009

Is JSR294 Active or Inactive?

0 comments
I was surprised to find out that JSR 294 was marked inactive (here). Is it really inactive? It depends on who you ask. From Alex Buckley email for JSR 294 mail list, 294 is still alive:

The PMO has a new rule: a JSR that doesn't produce an EDR for 18 months is marked inactive. Nothing else happens, just the marker.

Officially, 294's last EDR was December 2007. However, as per the agreement with 277 and 294 EG members in December 2008, 294 was revived ain January 2009.

Materials for an EDR were presented privately to the 294 EG in June 2009. You and BJ sent useful comments. Just about the time I was ready to file the EDR, the Simple Module System proposal showed up. I can only imagine the complaints had I proceeded with the EDR at that time.

So, I will file an EDR this month based on the materials from June, along the following lines:

- Module accessibility is a JLS concept; runtime module is a JVMS concept.

- Module compilation unit is a JLS concept; it defines a module name + version; it is annotatable; its contents are implementation-defined.

- java.* APIs are limited to representing runtime modules and (the runtime form of) module compilation units.

Direct link here