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


Java NamingEvent类代码示例

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


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

示例1: objectAdded

import javax.naming.event.NamingEvent; //导入依赖的package包/类
/**
 * Handler for new policy entries in the directory.
 *
 * @param namingEvent the new entry event that occurred
 */
public void objectAdded(NamingEvent namingEvent) {
   Map<String, Set<Role>> newRoles = new HashMap<>();

   try {
      processSearchResult(newRoles, (SearchResult) namingEvent.getNewBinding());
      for (Map.Entry<String, Set<Role>> entry : newRoles.entrySet()) {
         Set<Role> existingRoles = securityRepository.getMatch(entry.getKey());
         for (Role role : entry.getValue()) {
            existingRoles.add(role);
         }
      }
   } catch (NamingException e) {
      ActiveMQServerLogger.LOGGER.failedToProcessEvent(e);
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:21,代码来源:LegacyLDAPSecuritySettingPlugin.java

示例2: getJNDIChangeType

import javax.naming.event.NamingEvent; //导入依赖的package包/类
/**
 * get JNDI defined change type value which is different with
 * <code>getChangeType()</code>
 * 
 * @return JNDI defined change type value
 */
public int getJNDIChangeType() {
    switch (changeType) {
    case ADD:
        return NamingEvent.OBJECT_ADDED;
    case DELETE:
        return NamingEvent.OBJECT_REMOVED;
    case MODIFY:
        return NamingEvent.OBJECT_CHANGED;
    case MODIFY_DN:
        return NamingEvent.OBJECT_RENAMED;
    default:
        // never reach
        return -1;
    }

}
 
开发者ID:shannah,项目名称:cn1,代码行数:23,代码来源:ECNotificationControl.java

示例3: objectRemoved

import javax.naming.event.NamingEvent; //导入依赖的package包/类
@Override
public void objectRemoved(NamingEvent evt) {
	final String jndiName = evt.getOldBinding().getName();
          LOG.factoryUnboundFromName( jndiName );

	final String uuid = nameUuidXref.remove( jndiName );
	if ( uuid == null ) {
		// serious problem... but not sure what to do yet
	}
	sessionFactoryMap.remove( uuid );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:12,代码来源:SessionFactoryRegistry.java

示例4: objectRenamed

import javax.naming.event.NamingEvent; //导入依赖的package包/类
@Override
public void objectRenamed(NamingEvent evt) {
	final String oldJndiName = evt.getOldBinding().getName();
	final String newJndiName = evt.getNewBinding().getName();

	LOG.factoryJndiRename( oldJndiName, newJndiName );

	final String uuid = nameUuidXref.remove( oldJndiName );
	nameUuidXref.put( newJndiName, uuid );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:11,代码来源:SessionFactoryRegistry.java

示例5: objectRemoved

import javax.naming.event.NamingEvent; //导入依赖的package包/类
public void objectRemoved(NamingEvent evt) {
	String name = evt.getOldBinding().getName();
	log.info("A factory was unbound from name: " + name);
	Object instance = NAMED_INSTANCES.remove(name);
	Iterator iter = INSTANCES.values().iterator();
	while ( iter.hasNext() ) {
		if ( iter.next()==instance ) iter.remove();
	}
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:10,代码来源:SessionFactoryObjectFactory.java

示例6: objectAdded

import javax.naming.event.NamingEvent; //导入依赖的package包/类
@Override
public void objectAdded(NamingEvent evt) {
    // This test is a hack to work around the fact that Apache DS 2.0 seems to trigger notifications
    // for the entire sub-tree even when one-level is the selected search scope.
    if (permissionType != null) {
        SimpleCachedLDAPAuthorizationMap.this.objectAdded(evt, destinationType, permissionType);
    }
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:9,代码来源:SimpleCachedLDAPAuthorizationMap.java

示例7: objectRemoved

import javax.naming.event.NamingEvent; //导入依赖的package包/类
@Override
public void objectRemoved(NamingEvent evt) {
    // This test is a hack to work around the fact that Apache DS 2.0 seems to trigger notifications
    // for the entire sub-tree even when one-level is the selected search scope.
    if (permissionType != null) {
        SimpleCachedLDAPAuthorizationMap.this.objectRemoved(evt, destinationType, permissionType);
    }
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:9,代码来源:SimpleCachedLDAPAuthorizationMap.java

示例8: objectChanged

import javax.naming.event.NamingEvent; //导入依赖的package包/类
@Override
public void objectChanged(NamingEvent evt) {
    // This test is a hack to work around the fact that Apache DS 2.0 seems to trigger notifications
    // for the entire sub-tree even when one-level is the selected search scope.
    if (permissionType != null) {
        SimpleCachedLDAPAuthorizationMap.this.objectChanged(evt, destinationType, permissionType);
    }
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:9,代码来源:SimpleCachedLDAPAuthorizationMap.java

示例9: objectAdded

import javax.naming.event.NamingEvent; //导入依赖的package包/类
/**
 * invoked when an entry has been added during a persistent search
 */
public void objectAdded(NamingEvent event) {
    LOG.debug("entry added");
    try {
        addConnector((SearchResult) event.getNewBinding());
    } catch (Exception err) {
        LOG.error("ERR: caught unexpected exception", err);
    }
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:12,代码来源:LdapNetworkConnector.java

示例10: objectRemoved

import javax.naming.event.NamingEvent; //导入依赖的package包/类
/**
 * invoked when an entry has been removed during a persistent search
 */
public void objectRemoved(NamingEvent event) {
    LOG.debug("entry removed");
    try {
        removeConnector((SearchResult) event.getOldBinding());
    } catch (Exception err) {
        LOG.error("ERR: caught unexpected exception", err);
    }
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:12,代码来源:LdapNetworkConnector.java

示例11: objectRenamed

import javax.naming.event.NamingEvent; //导入依赖的package包/类
/**
 * invoked when an entry has been renamed during a persistent search
 */
public void objectRenamed(NamingEvent event) {
    LOG.debug("entry renamed");
    // XXX: getNameInNamespace method does not seem to work properly,
    // but getName seems to provide the result we want
    String uuidOld = event.getOldBinding().getName();
    String uuidNew = event.getNewBinding().getName();
    URI connectorURI = uuidMap.remove(uuidOld);
    uuidMap.put(uuidNew, connectorURI);
    LOG.debug("connector reference renamed for URI [{}], Old UUID [{}], New UUID [{}]", new Object[]{ connectorURI, uuidOld, uuidNew });
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:14,代码来源:LdapNetworkConnector.java

示例12: objectChanged

import javax.naming.event.NamingEvent; //导入依赖的package包/类
/**
 * invoked when an entry has been changed during a persistent search
 */
public void objectChanged(NamingEvent event) {
    LOG.debug("entry changed");
    try {
        SearchResult result = (SearchResult) event.getNewBinding();
        removeConnector(result);
        addConnector(result);
    } catch (Exception err) {
        LOG.error("ERR: caught unexpected exception", err);
    }
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:14,代码来源:LdapNetworkConnector.java

示例13: testConstructorAndGetters_Null_EventContext

import javax.naming.event.NamingEvent; //导入依赖的package包/类
public void testConstructorAndGetters_Null_EventContext() {
    log.setMethod("testConstructorAndGetters_Null_EventContext()");

    try {
        new NamingEvent(null, NamingEvent.OBJECT_CHANGED, binding1, binding2, "anything");
        fail("IllegalArgumentException expected");
    } catch (IllegalArgumentException e) {
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:10,代码来源:NamingEventTest.java

示例14: rebind

import javax.naming.event.NamingEvent; //导入依赖的package包/类
public void rebind(String name, Object obj, Attributes attrs)
    throws NamingException {
    Binding bind = new Binding(name, obj);
    attributes.put(name, attrs);
    fire(name, NamingEvent.OBJECT_CHANGED, bind, (Binding) bindings.put(
        name, bind), null);
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:8,代码来源:EventDirCtx.java

示例15: rename

import javax.naming.event.NamingEvent; //导入依赖的package包/类
public void rename(String name1, String name2) throws NamingException {
    Binding old = (Binding) bindings.remove(name1);
    if (old == null) {
        throw new NameNotFoundException(name1);
    }

    Binding newBd = new Binding(name2, old.getObject());
    bindings.put(name2, newBd);
    fire(name1, NamingEvent.OBJECT_RENAMED, newBd, old, null);
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:11,代码来源:EventDirCtx.java


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