public static synchronized ContentResource getContentResource()

in src/main/java/org/apache/cxf/cwiki/SiteExporter.java [220:243]


    public static synchronized ContentResource getContentResource() {
        if (contentResource == null) {
            FailoverFeature failover = new FailoverFeature();
            RetryStrategy rs = new RetryStrategy();
            rs.setMaxNumberOfRetries(25);
            List<String> alternateAddresses = new ArrayList<String>();
            alternateAddresses.add(REST_API);
            rs.setAlternateAddresses(alternateAddresses);
            failover.setStrategy(rs);
            JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
            bean.setAddress(REST_API);
            
            bean.setServiceClass(ContentResource.class);
            List<Feature> features = new ArrayList<Feature>();
            
            
            features.add(failover);
            bean.setFeatures(features);
            bean.setUsername(userName);
            bean.setPassword(password);
            contentResource = bean.create(ContentResource.class);
        }
        return contentResource;
    }