All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.brijframework.resources.context.ResourceContext Maven / Gradle / Ivy

The newest version!
package org.brijframework.resources.context;

import org.brijframework.context.impl.module.AbstractModuleContext;
import org.brijframework.resources.container.ResourceContainer;
import org.brijframework.util.factories.ReflectionFactory;
import org.brijframework.util.reflect.InstanceUtil;


public class ResourceContext extends AbstractModuleContext{
	
	@SuppressWarnings("unchecked")
	@Override
	public void init() {
		try {
			ReflectionFactory.getFactory().getExternalClassList().forEach(cls->{
				if(ResourceContainer.class.isAssignableFrom(cls) && InstanceUtil.isAssignable(cls)) {
					register((Class) cls);
				}
			});
		} catch (Exception e) {
			e.printStackTrace();
		}
		try {
			ReflectionFactory.getFactory().getInternalClassList().forEach(cls->{
				if(ResourceContainer.class.isAssignableFrom(cls) && InstanceUtil.isAssignable(cls)) {
					register((Class) cls);
				}
			});
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy