@SuppressWarnings("unchecked")
	@Override
	public <T> T getResource(String id, Class<T> clazz) {

		ResourceLoader<?> loader = loaders.get(clazz.getName());
		
		T resource = null;
		if (hasResource(id, clazz)) {
			resource = (T) loader.getResource(id);
		} else if (definitionManager.hasElement(id)) {
			ResourceDefinition definition = definitionManager.getElement(id);

			if (loader != null) {
				try {
					resource = (T) loader.loadResource(definition);
				} catch (ResourceException e) {
					e.printStackTrace();
				}
			}
		}

		return resource;
	}