Mapping of Singletons

From Apache OpenOffice Wiki
< Documentation‎ | DevGuide
Revision as of 08:06, 13 May 2009 by OOoWikiBot (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search



A new-style singleton of the form

 singleton Name: XIfc;

is mapped to a public Java class with the same name. The class has a single method

 public static XIfc get(com.sun.star.uno.XComponentContext context) { ... }

The semantics of such a singleton getter method in Java are as follows:

  • If no singleton instance could be obtained, the singleton getter fails by throwing a com.sun.star.uno.DeploymentException. The net effect is that a singleton getter either returns the requested non-null singleton instance, or throws an exception; a singleton getter will never return a null instance.

Old-style singletons are not mapped into the Java language binding.

Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages