javax.naming.event.NamespaceChangeListener Java Examples

The following examples show how to use javax.naming.event.NamespaceChangeListener. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JndiServiceImpl.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void addListener(String jndiName, NamespaceChangeListener listener) {
	final InitialContext initialContext = buildInitialContext();
	final Name name = parseName( jndiName, initialContext );
	try {
		( (EventContext) initialContext ).addNamingListener( name, EventContext.OBJECT_SCOPE, listener );
	}
	catch (Exception e) {
		throw new JndiException( "Unable to bind listener to namespace [" + name + "]", e );
	}
	finally {
		cleanUp( initialContext );
	}
}
 
Example #2
Source File: JndiService.java    From lams with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Adds the specified listener to the given {@literal JNDI} namespace.
 *
 * @param jndiName The {@literal JNDI} namespace
 * @param listener The listener
 */
public void addListener(String jndiName, NamespaceChangeListener listener);