This method explicit instantiates the singleton. For use outside a CDI environment.

@return The singleton
18814
public static synchronized ElasticsearchClient getSingleton() {
        if (singleton == null) {
            singleton = new ElasticsearchClient();
            try {
                singleton.init();
            } catch (Exception e) {
                log.log(Level.SEVERE, "Failed to initialise Elasticsearch client", e);
            }
        }
        return singleton;
    }
615759
public B getInstance()
            throws BackendInitializationException, BackendNewInstanceException {
        B backend = backendSpec.newBackendInstance();
        backend.initialize(this);
        return backend;
    }
1056071
static BlockCanaryInternals getInstance() {
        if (sInstance == null) {
            synchronized (BlockCanaryInternals.class) {
                if (sInstance == null) {
                    sInstance = new BlockCanaryInternals();
                }
            }
        }
        return sInstance;
    }
508430
public static synchronized ContextHolder getInstance() {

        if (INSTANCE == null) {
            Properties props = new Properties();
            try {
                props.load(new ClassPathResource("/cudafunctions.properties", ContextHolder.class.getClassLoader()).getInputStream());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }

            INSTANCE = new ContextHolder();
            INSTANCE.configure();


            //set the properties to be accessible globally
            for (String pair : props.stringPropertyNames())
                System.getProperties().put(pair, props.getProperty(pair));


        }


        return INSTANCE;
    }
1327528
public static RecurrenceUtil getInstance() {

    if (instance == null) {
      synchronized (RecurrenceUtilImpl.class) {
        if (instance == null) {
          RecurrenceUtilImpl impl = new RecurrenceUtilImpl();
          impl.initialize();
          instance = impl;
        }
      }
    }
    return instance;
  }
138249
public static function getInstance()
    {
        if (self::$instance == null)
        {
            $c = __CLASS__;
            self::$instance = new $c;
        }

        return self::$instance;
    }
1212673
def getInstance(cls, *args):
        '''
        
        '''
        if not cls.__singleton:
            cls.__singleton = Config(*args)
        return cls.__singleton
656300
protected Object createMyInstance() throws IOException {
        // would like to uninherit from AbstractFactoryBean (but it's final!)
        if (!isSingleton()) {
            throw new RuntimeException("ReloadablePropertiesFactoryBean only works as singleton");
        }

        // set listener
        reloadableProperties = new ReloadablePropertiesImpl();
        if (preListeners != null) {
            reloadableProperties.setListeners(preListeners);
        }

        // reload
        reload(true);

        // add for monitor
        ReloadConfigurationMonitor.addReconfigurableBean((ReconfigurableBean) reloadableProperties);

        return reloadableProperties;
    }
1186311
public T copy() {
        T copy = Instantiator.of(type).instantiate();
        return copyInto(copy);
    }
1309880
public static PojoDescriptorBuilderFactory getInstance() {

    PojoDescriptorBuilderFactory instance = AbstractPojoDescriptorBuilderFactory.getInstance();
    if (instance == null) {
      synchronized (PojoDescriptorBuilderFactoryImpl.class) {
        if (instance == null) {
          PojoDescriptorBuilderFactoryImpl impl = new PojoDescriptorBuilderFactoryImpl();
          instance = impl;
          setInstance(impl);
          impl.initialize();
        }
      }
    }
    return instance;
  }
948823
public static IAuditManager getInstance() {
        IAuditManager result = auditManager;
        if(result == null) {
            synchronized (AuditManager.class) {
                result = auditManager;
                if(result == null) {
                    Context.init();
                    auditManager = result = new AuditManager();
                }
            }
        }
        return result;
    }
430914
public static GoogleConnector getInstance() {
        if (instance == null) {
            try {
                instance = new GoogleConnector();
            } catch (Exception e) {
                throw new RuntimeException("The GoogleConnector could not be instanced!", e);
            }
        }
        return instance;
    }
1126027
public static CommandProcessor getInstance() {
        if (null == instance) {
            synchronized (CommandProcessor.class) {
                if (null == instance) {
                    instance = new CommandProcessor();
                }
            }
        }
        return instance;
    }
161316
def singleton(cls):
    '''
    
    '''

    cls.__new_original__ = cls.__new__

    @wraps(cls.__new__)
    def singleton_new(cls, *args, **kw):
        it = cls.__dict__.get('__it__')
        if it is not None:
            return it

        cls.__it__ = it = cls.__new_original__(cls, *args, **kw)
        it.__init_original__(*args, **kw)
        return it

    cls.__new__ = singleton_new
    cls.__init_original__ = cls.__init__
    cls.__init__ = object.__init__

    return cls
1051126
public static synchronized DataUsageExtension instance() {
                if (SINGLETON == null) {
                        SINGLETON = new DataUsageExtension();
                        XFactory factory = XFactoryRegistry.instance().currentDefault();
                        ATTR_DATA = factory.createAttributeLiteral(KEY_DATA, "", SINGLETON);
                        SINGLETON.eventAttributes.add((XAttribute) ATTR_DATA.clone());
                        // register mapping aliases
                        for (Map.Entry<String, String> mapping : EXTENSION_DESCRIPTIONS.entrySet()) {
                                XGlobalAttributeNameMap.instance().registerMapping(mapping.getKey(), KEY_DATA, mapping.getValue());
                        }
                }
                return SINGLETON;
        }
1240630
final public static function instance() {
        $c = get_called_class();
       
        if( ! isset( self::$instances[$c] ) )
        {
            self::$instances[$c] = new $c;
        }
       
        return self::$instances[$c];
    }
469874
public static ComponentManager getInstance() throws SshException {
		synchronized (ComponentManager.class) {
			if (instance == null) {
				instance = new JCEComponentManager();
				instance.init();
			}
			return instance;
		}
	}