当前位置: 首页>>代码示例>>Java>>正文


Java ResourceResolver.isLive方法代码示例

本文整理汇总了Java中org.apache.sling.api.resource.ResourceResolver.isLive方法的典型用法代码示例。如果您正苦于以下问题:Java ResourceResolver.isLive方法的具体用法?Java ResourceResolver.isLive怎么用?Java ResourceResolver.isLive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.sling.api.resource.ResourceResolver的用法示例。


在下文中一共展示了ResourceResolver.isLive方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: operate

import org.apache.sling.api.resource.ResourceResolver; //导入方法依赖的package包/类
/**
 * Do some operation on repository (delete or update resource etc) with wrapped impersonated session
 * (automatically opened and closed).
 */
public static void operate(ResourceResolverFactory factory, String userId, OperateCallback callback)
		throws OperateException {
	ResourceResolver resolver = null;
	try {
		resolver = getResourceResolverForUser(factory, userId);
		callback.operate(resolver);
		resolver.commit();
	} catch (Exception e) {
		throw new OperateException(OPERATE_ERROR_MESSAGE, e);
	} finally {
		if (resolver != null && resolver.isLive()) {
			resolver.close();
		}
	}
}
 
开发者ID:Cognifide,项目名称:APM,代码行数:20,代码来源:SlingHelper.java

示例2: resolve

import org.apache.sling.api.resource.ResourceResolver; //导入方法依赖的package包/类
/**
 * Retrieve values from repository with wrapped impersonated session (automatically opened and closed).
 */
@SuppressWarnings("unchecked")
public static <T> T resolve(ResourceResolverFactory factory, String userId, ResolveCallback callback)
		throws ResolveException {
	ResourceResolver resolver = null;
	try {
		resolver = getResourceResolverForUser(factory, userId);
		return (T) callback.resolve(resolver);
	} catch (Exception e) {
		throw new ResolveException(RESOLVE_ERROR_MESSAGE, e);
	} finally {
		if (resolver != null && resolver.isLive()) {
			resolver.close();
		}
	}
}
 
开发者ID:Cognifide,项目名称:APM,代码行数:19,代码来源:SlingHelper.java

示例3: findTag

import org.apache.sling.api.resource.ResourceResolver; //导入方法依赖的package包/类
public Tag findTag(String tagId, Asset asset, Session session) {
	Tag tag = null;
	ResourceResolver resourceResolver = null;

	try {
		resourceResolver = getResourceResolver(session);
		TagManager tagManager = resourceResolver.adaptTo(TagManager.class);
		tag = tagManager.resolve(tagId);
	} finally {
		if (null != resourceResolver && resourceResolver.isLive()) {
			resourceResolver.close();
		}
	}

	return tag;
}
 
开发者ID:Cognifide,项目名称:AEM-Rules-for-SonarQube,代码行数:17,代码来源:ResourceResolverConsumer.java

示例4: findName

import org.apache.sling.api.resource.ResourceResolver; //导入方法依赖的package包/类
public String findName(final String path) {
	String name = "";
	ResourceResolver resourceResolver = null;
	try {
		resourceResolver = resourceResolverProducer.produce();
		name = resourceResolver.getResource(path).getName();
	} finally {
		if (null != resourceResolver && resourceResolver.isLive()) {
			resourceResolver.close();
		}
	}
	return name;
}
 
开发者ID:Cognifide,项目名称:AEM-Rules-for-SonarQube,代码行数:14,代码来源:ResourceResolverConsumer.java


注:本文中的org.apache.sling.api.resource.ResourceResolver.isLive方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。