cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Unico Hommes" <>
Subject RE: cvs commit: cocoon-2.1/src/blocks/slide/java/org/apache/cocoon/components/source/impl
Date Wed, 03 Dec 2003 16:23:01 GMT

> -----Original Message-----
> From: Joerg Heinicke [] 
> Sent: woensdag 3 december 2003 16:21
> To:
> Subject: Re: cvs commit: 
> cocoon-2.1/src/blocks/slide/java/org/apache/cocoon/components/
> source/impl
> On 03.12.2003 14:48, Unico Hommes wrote:
> >>>>I am thinking JDO. What's the reason for this?
> >>>
> >>
> >>I'm not that familiar with Java or the Avalon lifecycles, 
> but here is 
> >>my analysis from
> >>
> >>
> >>Make it possible to include also the OJB block by default without 
> >>breaking Cocoon. This is a really important issue as it breaks our 
> >>suggested build system workflow using 
>! You can 
> >>not include blocks when they are excluded in
> >>
> >>AFAIU the reason for the problem is factory = new OjbStorePMF(); in 
> >>the
> >>initialize() method in Isn't it possible 
> to do lazy 
> >>initializing when accessing factory the first time? I guess 
> this has 
> >>to be done in getPersistenceManager().
> > 
> > Yes, you are right. I got it working now. I had to change 
> the factory 
> > instance variable's type to Object but it works. I hope 
> this will also 
> > work for other JVM's than the one I tested it on. Should I 
> commit it?
> Why is the change to Object needed? 
> Is this class 
> instantiated on start up even if it's not Initializable?

Yes, that's ECM creating an instance and going through the static
lifecycle stages.

> Everything that's better than now should be committed. What 
> are the potential issues with other JVMs? 

I was concerned about the method <code>PersistentManager
getPersistenceManager();</code>. If JVM's are allowed to resolve all of
class's symbolic references during the linking process, this might
result in an exception. I looked at the JVM specification with a
collegue and found the following

"Resolution is the process of checking symbolic references from
Terminator to other classes and interfaces, by loading the other classes
and interfaces that are mentioned and checking that the references are

The resolution step is optional at the time of initial linkage. An
implementation may resolve a symbolic reference from a class or
interface that is being linked very early, even to the point of
resolving all symbolic references from the classes and interfaces that
are further referenced, recursively. (This resolution may result in
errors from further loading and linking steps.) This implementation
choice represents one extreme and is similar to the kind of static
linkage that has been done for many years in simple implementations of
the C language.

An implementation may instead choose to resolve a symbolic reference
only when it is actively used; consistent use of this strategy for all
symbolic references would represent the "laziest" form of resolution. In
this case, if Terminator had several symbolic references to another
class, the references might be resolved one at a time-perhaps not at
all, if these references were never used during execution of the

The only requirement on when resolution is performed is that any errors
detected during resolution must be thrown at a point in the program
where some action is taken by the program that might, directly or
indirectly, require linkage to the class or interface involved in the
error. In the "static" example implementation choice described earlier,
loading and linking errors could occur before the program is executed if
they involved a class or interface mentioned in the class Terminator or
any of the further, recursively referenced classes and interfaces. In a
system that implemented the "laziest" resolution, these errors would be
thrown only when a symbolic reference is actively used."

So I think this says that a JVM is allowed to raise an error upon
<code>new JdoPMFImpl();</code> :-(

Of course we could just comment out the JdoPMF component xconf
declaration and require users to uncomment it when they want to use JDO



View raw message