> OK, I see your problem. Singletons (and services) have three parts:
>
> First, you need a UNOIDL file containing the singleton's "declaration"
> (i.e., containing a line like "singleton theSentence: XSentence;", as
> your theSentence.idl). From that, javamaker creates a helper class
> (theSentence.class) that allows client code to obtain the singleton
> instance at runtime, *if certain conditions are met.*
>
> Second, there needs to be a "definition" of the singleton (i.e., for
> example a Java class you provide that implements the XSentence
interface
> and also provides code to register the singleton implementation with a
> component context). How the necessary code to register a *service*
> implementation looks like is described in the DevGuide
> (<
http://api.openoffice.org/docs/DevelopersGuide/DevelopersGuide.pdf>),
> sections 4.5.3--4.5.5); however, a description of the necessary code
for
> a *singleton* implementation seems to be missing. [*]
>
> Third (and this is where the "certain conditions" from above are
> provided), a call to theSentence.get(componentContext) will only
succeed
> if componentContext is a component context in which the "definition" of
> the singleton (the Java class you need to provide) has been registered.
> How this registration works depends on the nature of the component
> context:
>
> - If the component context is a binary UNO one from the OOo
installation
> (e.g., obtained from com.sun.star.comp.helper.Bootstrap.bootstrap or
>
>
com.sun.star.comp.helper.Bootstrap.defaultBootstrap_InitialComponentContext
> ),
> the singleton must be registered in the OOo services.rdb (for example
> via regcomp, see the DevGuide for details).
>
> - If the component context is a pure Java UNO one ( e.g., obtained from
> com.sun.star.comp.helper.Bootstrap.createInitialComponentContext), you
> have to register the singleton directly at the component context "by
> hand." Again, how this is done seems not to be well documented. [**]
>
> Please allow me some more time to come back with example code that
sheds
> more light on how [*] and [**] actually work.
>
> -Stephan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
Ok, what I can request to you write now is to make a simple HelloWorld
singleton. e.g. a singleton having a function which when called
increments
a counter inside it and return the value. I think we'll need two files
for
this (something like XSentence.idl and an implementation of XSentence)
Together with all the above, make the Build.sh file which will be used to
package & deploy that component. And put all of this on a wiki. If you
need
any kind of help, let me know although I'm pretty new to openoffice
development.
Thanks