KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mmbase > bridge > LocalContext


1 /*
2
3 This software is OSI Certified Open Source Software.
4 OSI Certified is a certification mark of the Open Source Initiative.
5
6 The license (Mozilla version 1.0) can be read at the MMBase site.
7 See http://www.MMBase.org/license
8
9 */

10
11 package org.mmbase.bridge;
12 import org.mmbase.bridge.implementation.BasicCloudContext;
13
14 /**
15  * The collection of clouds, and modules within a Java Virtual Machine.
16  *
17  * @author Rob Vermeulen
18  * @author Pierre van Rooden
19  * @version $Id: LocalContext.java,v 1.5 2005/06/07 12:02:37 michiel Exp $
20  */

21 public final class LocalContext extends BasicCloudContext {
22
23     // singleton CloudContext
24
private static CloudContext thisContext;
25
26     /**
27      * Constructor to call from the MMBase class
28      * (private, so cannot be reached from a script)
29      */

30     private LocalContext() {
31         super();
32     }
33
34     /**
35      * Called from the script to retrieve the current CloudContext
36      * @return current CloudContext
37      */

38     public static CloudContext getCloudContext() {
39         if (thisContext == null) thisContext = new LocalContext();
40         return thisContext;
41     }
42
43 }
44
Popular Tags