Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import org.hibernate.jpa.boot.spi.PersistenceUnitDescriptor;
import org.hibernate.jpa.boot.spi.PersistenceXmlParser;
import org.mycore.common.config.MCRConfiguration2;
import org.mycore.common.config.MCRInstanceName;
import org.mycore.common.config.instantiator.MCRInstanceName;
import org.mycore.common.events.MCRStartupHandler.AutoExecutable;
import org.mycore.resource.MCRResourceResolver;
import org.mycore.resource.provider.MCRResourceProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ private void expandClassifications(MCRObject mcrObject) {

public static final class Factory implements Supplier<MCRBasicObjectExpander> {

@MCRInstance(name = CLASSIFICATION_MAPPER_KEY, valueClass = MCRClassificationMapper.class, required = false,
sentinel = @MCRSentinel)
@MCRSentinel
@MCRInstance(name = CLASSIFICATION_MAPPER_KEY, valueClass = MCRClassificationMapper.class, required = false)
public MCRClassificationMapper classificationMapper;

@Override
Expand Down
12 changes: 5 additions & 7 deletions mycore-base/src/main/java/org/mycore/common/MCRClassTools.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,18 @@ public static Object loadClassFromURL(File file, String className)

/**
* Loads a class via default ClassLoader or <code>Thread.currentThread().getContextClassLoader()</code>.
* @param classname Name of class
* @param className Name of class
* @param <T> Type of Class
* @return the initialized class
* @throws ClassNotFoundException if both ClassLoader cannot load the Class
*/
public static <T> Class<? extends T> forName(String classname) throws ClassNotFoundException {
@SuppressWarnings("unchecked")
Class<? extends T> forName;
@SuppressWarnings("unchecked")
public static <T> Class<? extends T> forName(String className) throws ClassNotFoundException {
try {
forName = (Class<? extends T>) Class.forName(classname);
return (Class<? extends T>) Class.forName(className);
} catch (ClassNotFoundException cnfe) {
forName = (Class<? extends T>) Class.forName(classname, true, extendedClassLoader);
return (Class<? extends T>) Class.forName(className, true, extendedClassLoader);
}
return forName;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ public GsonBuilder createGsonBuilder() {

public static class Factory implements Supplier<MCRJSONManager> {

@MCRInstanceMap(name = TYPE_ADAPTERS_KEY, valueClass = MCRJSONTypeAdapter.class, required = false,
sentinel = @MCRSentinel)
@MCRSentinel
@MCRInstanceMap(name = TYPE_ADAPTERS_KEY, valueClass = MCRJSONTypeAdapter.class, required = false)
public Map<String, MCRJSONTypeAdapter<?>> typeAdapters;

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ public static String getSpecification(String schema, String userId) {

public static class Factory implements Supplier<MCRUserInformationResolver> {

@MCRInstanceMap(name = PROVIDERS_KEY, valueClass = MCRUserInformationProvider.class, sentinel = @MCRSentinel)
@MCRSentinel
@MCRInstanceMap(name = PROVIDERS_KEY, valueClass = MCRUserInformationProvider.class)
public Map<String, MCRUserInformationProvider> providers;

@Override
Expand Down
Loading
Loading