public Bucket getBucket()

in src/main/java/org/apache/sling/nosql/couchbase/client/impl/CouchbaseClientImpl.java [129:145]


    public Bucket getBucket() {
        if (!initialized) {
            synchronized (this) {
                if (!initialized) {
                    try {
                        cluster = CouchbaseEnvironmentSingleton.createCluster(couchbaseHosts);
                        bucket = CouchbaseEnvironmentSingleton.openBucket(cluster, bucketName, bucketPassword);
                        initialized = true;
                    }
                    catch (Throwable ex) {
                        throw new RuntimeException("Unable to connect to couchbase cluster or open couchbase bucket, client '" + clientId + "'.", ex);
                    }
                }
            }
        }
        return bucket;
    }