/** * Chooses the object that locks the loading of the extension instances. */ protected Object getLoadLock() { return jenkins.lookup.setIfNull(Lock.class,new Lock()); }
/** * Retrieves the currently active singleton instance of {@link ConfidentialStore}. */ public static @Nonnull ConfidentialStore get() { if (TEST!=null) return TEST.get(); Jenkins j = Jenkins.getInstance(); Lookup lookup = j.lookup; ConfidentialStore cs = lookup.get(ConfidentialStore.class); if (cs==null) { try { Iterator<ConfidentialStore> it = ServiceLoader.load(ConfidentialStore.class, ConfidentialStore.class.getClassLoader()).iterator(); if (it.hasNext()) { cs = it.next(); } } catch (ServiceConfigurationError e) { LOGGER.log(Level.WARNING, "Failed to list up ConfidentialStore implementations",e); // fall through } if (cs==null) try { cs = new DefaultConfidentialStore(); } catch (Exception e) { // if it's still null, bail out throw new Error(e); } cs = lookup.setIfNull(ConfidentialStore.class,cs); } return cs; }
/** * Chooses the object that locks the loading of the extension instances. */ protected Object getLoadLock() { return jenkins.lookup.setIfNull(Lock.class,new Lock()); }
/** * Chooses the object that locks the loading of the extension instances. */ protected Object getLoadLock() { return hudson.lookup.setIfNull(Lock.class, new Lock()); }
/** * Chooses the object that locks the loading of the extension instances. */ protected Object getLoadLock() { return hudson.lookup.setIfNull(Lock.class,new Lock()); }
/** * Chooses the object that locks the loading of the extension instances. */ protected Object getLoadLock() { return hudson.lookup.setIfNull(Lock.class,new Lock()); }
/** * Chooses the object that locks the loading of the extension instances. */ protected Object getLoadLock() { return hudson.lookup.setIfNull(Lock.class,new Lock()); }
/** * Retrieves the currently active singleton instance of {@link ConfidentialStore}. */ public static @Nonnull ConfidentialStore get() { if (TEST!=null) return TEST.get(); Jenkins j = Jenkins.getInstance(); Lookup lookup = j.lookup; ConfidentialStore cs = lookup.get(ConfidentialStore.class); if (cs==null) { try { List<ConfidentialStore> r = (List) Service.loadInstances(ConfidentialStore.class.getClassLoader(), ConfidentialStore.class); if (!r.isEmpty()) cs = r.get(0); } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to list up ConfidentialStore implementations",e); // fall through } if (cs==null) try { cs = new DefaultConfidentialStore(); } catch (Exception e) { // if it's still null, bail out throw new Error(e); } cs = lookup.setIfNull(ConfidentialStore.class,cs); } return cs; }