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


Java ObservationManager类代码示例

本文整理汇总了Java中javax.jcr.observation.ObservationManager的典型用法代码示例。如果您正苦于以下问题:Java ObservationManager类的具体用法?Java ObservationManager怎么用?Java ObservationManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: deactivate

import javax.jcr.observation.ObservationManager; //导入依赖的package包/类
@Deactivate
public void deactivate(final Map<String, String> config) throws RepositoryException {
	try {
		final ObservationManager observationManager = observationSession.getWorkspace().getObservationManager();

		if (observationManager != null) {
			observationManager.removeEventListener(this);
		}
	} finally {
		if (observationSession != null) {
			observationSession.logout();
		}
		if (resolver != null) {
			resolver.close();
		}
	}
}
 
开发者ID:Cognifide,项目名称:AEM-Rules-for-SonarQube,代码行数:18,代码来源:LongSessionEventListener.java

示例2: deactivate

import javax.jcr.observation.ObservationManager; //导入依赖的package包/类
@Deactivate
public void deactivate(final Map<String, String> config) throws RepositoryException {
    try {
        // Get JCR ObservationManager from Workspace
        final ObservationManager observationManager = observationSession.getWorkspace().getObservationManager();

        if (observationManager != null) {
            // Un-register event handler
            observationManager.removeEventListener(this);
        }
    } finally {
        // Good housekeeping; Close your JCR Session when you are done w them!
        if (observationSession != null) {
            observationSession.logout();
        }
    }
}
 
开发者ID:Adobe-Consulting-Services,项目名称:acs-aem-samples,代码行数:18,代码来源:SampleJcrEventListener.java

示例3: addListeners

import javax.jcr.observation.ObservationManager; //导入依赖的package包/类
/**
 * Hook for adding listeners to the newly returned session. We have to treat exceptions manually and can't
 * reply on the template.
 * @param session JCR session
 * @return the listened session
 * @throws javax.jcr.RepositoryException
 */
private Session addListeners(Session session) throws RepositoryException {
    if (getRepository() == null) {
        throw new IllegalArgumentException("repository is required");
    }

    if (eventListeners != null && eventListeners.length > 0) {
        if (!supportsObservation(getRepository())) {
            throw new IllegalArgumentException("repository " + getRepositoryInfo() + " does NOT support Observation; remove Listener definitions");
        }
        Workspace ws = session.getWorkspace();
        ObservationManager manager = ws.getObservationManager();

        for (EventListenerDefinition eventListener : eventListeners) {
            manager.addEventListener(eventListener.getListener(), eventListener.getEventTypes(), eventListener.getAbsPath(), eventListener.isDeep(), eventListener.getUuid(), eventListener.getNodeTypeName(), eventListener.isNoLocal());
        }
    }
    return session;
}
 
开发者ID:dooApp,项目名称:jcromfx,代码行数:26,代码来源:SessionFactoryImpl.java

示例4: addListeners

import javax.jcr.observation.ObservationManager; //导入依赖的package包/类
/**
 * Hook for adding listeners to the newly returned session. We have to treat
 * exceptions manually and can't reply on the template.
 * 
 * @param session
 *            JCR session
 * @return the listened session
 * @throws javax.jcr.RepositoryException
 */
protected Session addListeners(Session session) throws RepositoryException {
	if (eventListeners != null && eventListeners.length > 0) {
		Workspace ws = session.getWorkspace();
		ObservationManager manager = ws.getObservationManager();

		LOG.debug("adding listeners "
				+ Arrays.asList(eventListeners).toString()
				+ " for session " + session);

		for (int i = 0; i < eventListeners.length; i++) {
			manager.addEventListener(eventListeners[i].getListener(),
					eventListeners[i].getEventTypes(),
					eventListeners[i].getAbsPath(),
					eventListeners[i].isDeep(),
					eventListeners[i].getUuid(),
					eventListeners[i].getNodeTypeName(),
					eventListeners[i].isNoLocal());
		}
	}
	return session;
}
 
开发者ID:MyCollab,项目名称:mycollab,代码行数:31,代码来源:JcrSessionFactory.java

示例5: deactivate

import javax.jcr.observation.ObservationManager; //导入依赖的package包/类
@Deactivate
public void deactivate(final Map<String, String> config) throws RepositoryException {
	final ObservationManager observationManager = observationSession.getWorkspace().getObservationManager();

	if (observationManager != null) {
		observationManager.removeEventListener(this);
	}
}
 
开发者ID:Cognifide,项目名称:AEM-Rules-for-SonarQube,代码行数:9,代码来源:LongSessionEventListenerError.java

示例6: activate

import javax.jcr.observation.ObservationManager; //导入依赖的package包/类
@Activate
public void activate(final Map<String, String> config) throws RepositoryException {

    // Get the JCR Session to bind this Event Listener too
    observationSession = repository.loginAdministrative(null);

    // Get JCR ObservationManager from Workspace
    final ObservationManager observationManager  = observationSession.getWorkspace().getObservationManager();

    // Register the JCR Listener

    /** !! This is the KEY element where this listener is registered !! **/
    observationManager.addEventListener(this, events, absPath, isDeep,
            uuids, nodeTypes, noLocal);
}
 
开发者ID:Adobe-Consulting-Services,项目名称:acs-aem-samples,代码行数:16,代码来源:SampleJcrEventListener.java

示例7: getObservationManager

import javax.jcr.observation.ObservationManager; //导入依赖的package包/类
@Override
public ObservationManager getObservationManager() throws UnsupportedRepositoryOperationException, RepositoryException {
    if (observationManager == null) {
        observationManager = new ObservationManagerImpl();
    }
    return observationManager;
}
 
开发者ID:TWCable,项目名称:jackalope,代码行数:8,代码来源:WorkspaceImpl.java

示例8: start

import javax.jcr.observation.ObservationManager; //导入依赖的package包/类
public void start() throws Exception{
	this.ocm = ocmFactory.getOcm();
	ObservationManager observationManager = ocm.getSession().getWorkspace().getObservationManager();
	final String[] types = { "nt:unstructured" };
	observationManager.addEventListener(listener, Event.ALL_TYPES, "/board", true, null, types, false);
	logger.info("Observer Started - listener:" + listener.getClass().getName());
}
 
开发者ID:cheetah100,项目名称:gravity,代码行数:8,代码来源:JcrObserver.java

示例9: activate

import javax.jcr.observation.ObservationManager; //导入依赖的package包/类
@Activate
public void activate(final Map<String, String> config) throws RepositoryException {
	observationSession = repository.loginAdministrative(null);
	final ObservationManager observationManager = observationSession.getWorkspace().getObservationManager();
}
 
开发者ID:Cognifide,项目名称:AEM-Rules-for-SonarQube,代码行数:6,代码来源:LongSessionEventListenerError.java

示例10: activate

import javax.jcr.observation.ObservationManager; //导入依赖的package包/类
@Activate
public void activate(final Map<String, String> config) throws RepositoryException, LoginException {
	observationSession = repository.loginAdministrative(null);
	final ObservationManager observationManager = observationSession.getWorkspace().getObservationManager();
	resolver = resourceResolverFactory.getAdministrativeResourceResolver(null);
}
 
开发者ID:Cognifide,项目名称:AEM-Rules-for-SonarQube,代码行数:7,代码来源:LongSessionEventListener.java

示例11: getObservationManager

import javax.jcr.observation.ObservationManager; //导入依赖的package包/类
public ObservationManager getObservationManager() throws UnsupportedRepositoryOperationException, RepositoryException {

        return observationMngr;
    }
 
开发者ID:wso2,项目名称:carbon-registry,代码行数:5,代码来源:RegistryWorkspace.java


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