Use CDI to load the artifact with the given ID.

@return the loaded artifact; or null if CDI is not enabled for the app.
425763
@Override
    public Object load(String batchId) {

        Object loadedArtifact;

        loadedArtifact = getArtifactById(batchId);

        if (loadedArtifact != null) {
            if (logger.isLoggable(Level.FINEST)) {
                logger.finest("load: batchId: " + batchId
                              + ", artifact: " + loadedArtifact
                              + ", artifact class: " + loadedArtifact.getClass().getCanonicalName());
            }
        }

        return loadedArtifact;
    }
425753
public static Lookup get() {
        if (LOOKUP != null) {
            return LOOKUP;
        }
        synchronized (Lookup.class) {
            // allow for override of the Lookup.class
            String overrideClassName = System.getProperty(Lookup.class.getName());
            ClassLoader l = Thread.currentThread().getContextClassLoader();
            try {
                if (overrideClassName != null && !"".equals(overrideClassName)) {
                    LOOKUP = (Lookup) Class.forName(overrideClassName, true, l).newInstance();
                } else {
                    LOOKUP = new Lookup();
                }
            } catch (Exception e) {
                // ignore
            }
            // ServiceLoader and CDI are used by defaults, important that
            // CDI is used first so that beans are enabled for injection
            CdiLookup cdiLookup = new CdiLookup();
            LOOKUP.lookupProviders.add(cdiLookup);
            ServiceLoaderLookup serviceLoaderLookup = new ServiceLoaderLookup();
            LOOKUP.lookupProviders.add(serviceLoaderLookup);
            // Use ServiceLoader to find other LookupProviders
            Collection<LookupProvider> providers = serviceLoaderLookup
                    .lookupAll(LookupProvider.class);
            LOOKUP.lookupProviders.addAll(providers);
        }

        return LOOKUP;
    }
564743
protected Api getApi(String id) throws IOException {
        Get get = new Get.Builder(getIndexName(), id).type("api").build(); //$NON-NLS-1$
        JestResult result = getClient().execute(get);
        if (result.isSucceeded()) {
            Api api = result.getSourceAsObject(Api.class);
            return api;
        } else {
            return null;
        }
    }
1371841
@Override
    public <T> Lazy<Map<String, T>> load(Class<T> clazz, String... ids) {
        return _session.lazyLoadInternal(clazz, ids, _includes.toArray(new String[0]), null);
    }
883758
public C get(String id){
		C container = this.containerMap.get(id);

		if(container != null && (container.getState()).equals(State.REMOVED)){
			return null;
		}

		return container;
	}
688916
public @Nullable TwinTextItem getItemById(int id) {
        for(int index = getCount()-1; index >= 0; index--) {
            TwinTextItem item = getItem(index);
            if(item.getId() == id)
                return item;
        }
        return null;
    }
753291
public SimonConsolePlugin getPluginById(String id) {
		for (SimonConsolePlugin plugin : plugins) {
			if (plugin.getId().equals(id)) {
				return plugin;
			}
		}
		return null;
	}
469492
protected String resolveArtifactId() {
		if (this.artifactId != null) {
			return this.artifactId;
		}
		if (this.output != null) {
			int i = this.output.lastIndexOf('.');
			return (i != -1) ? this.output.substring(0, i) : this.output;
		}
		return null;
	}
1131003
static public FileId getInstance(String id) throws DaoManagerException {
		if (id!=null && FileConnector.exists(id)){
			return new FileId(id,null);
		} else {
			return null;
		}
	}
1286113
@Override
    public <TResult> TResult load(Class<TResult> clazz, String id) {
        Map<String, TResult> stringObjectMap = _session.loadInternal(clazz, new String[]{ id }, _includes.toArray(new String[0]));
        return stringObjectMap.values().stream().filter(x -> x != null).findFirst().orElse(null);
    }
1297377
public Downloadable getById(String id) {
        for (Downloadable d : Downloadable.all())
            if(d.getId().equals(id))
                return d;
        return null;
    }
1097407
public static String resourceTypeFromResourceId(String id) {
        return (id != null) ? ResourceId.fromString(id).resourceType() : null;
    }
735148
@SuppressWarnings({"TypeParameterUnusedInFormals", "unchecked"})
  private <T> T fetch(final String id) {
    checkNotNull(id);
    checkArgument(!id.isEmpty());
    final T ret = (T) idMap.get(id);
    if (ret == null) {
      throw new EREException(String.format("Lookup failed for id %s.", id));
    }
    return ret;
  }
232227
@Override
    public Cache getCache(String id) {
        Exceptions.checkNotClosed(this.closed.get(), this);

        RocksDBCache result;
        boolean isNew = false;
        synchronized (this.caches) {
            result = this.caches.get(id);
            if (result == null) {
                result = new RocksDBCache(id, this.config, this::cacheClosed);
                this.caches.put(id, result);
                isNew = true;
            }
        }

        if (isNew) {
            result.initialize();
        }

        return result;
    }
948008
public void setArtifactId(final String artifactId) {
        if (artifactId == null && this.artifactId == null) {
            return;
        } else if (artifactId == null) {
            removeChild(this.artifactId);
            this.artifactId = null;
        } else if (this.artifactId == null) {
            this.artifactId = new KeyValueNode<String>(CommonConstants.CS_MAVEN_ARTIFACT_ID_TITLE, artifactId);
            appendChild(this.artifactId, false);
        } else {
            this.artifactId.setValue(artifactId);
        }
    }
1285448
public DbArtifact getArtifact(final String gavc) {
        final DbArtifact artifact = repositoryHandler.getArtifact(gavc);

        if(artifact == null){
            throw new WebApplicationException(Response.status(Response.Status.NOT_FOUND)
                    .entity("Artifact " + gavc + " does not exist.").build());
        }

        return artifact;
    }
897298
@Override
	public IJobXMLSource loadJSL(String id) {

		IJobXMLSource jobXML = loadJobFromDirectory(JOB_XML_PATH, id);

		return jobXML;
	}