Code example for Hashtable

Methods: clone, get, put, remove

0
	private static final MockInitialContextFactoryBuilder _builder = new MockInitialContextFactoryBuilder(); 
 
	public static MockInitialContextFactoryBuilder getInstance() { 
		return MockInitialContextFactoryBuilder._builder; 
	} 
 
	public InitialContextFactory createInitialContextFactory(Hashtable<?,?> envmt) 
			throws NamingException { 
		NamingManagerTest.issueIndicatedExceptions(envmt); 
		if (NamingManagerTest.returnNullIndicated(envmt)) { 
			return null; 
		} 
		return new MockInitialContextFactory(envmt); 
	} 
 
	public static class MockInitialContextFactory implements 
			InitialContextFactory { 
		public Context getInitialContext(Hashtable<?, ?> envmt) 
				throws NamingException { 
			NamingManagerTest.issueIndicatedExceptions(envmt); 
			if (NamingManagerTest.returnNullIndicated(envmt)) { 
				return null; 
			} 
			return new MockContext(envmt); 
		} 
 
		public MockInitialContextFactory(Hashtable<?,?> envmt) { 
		} 
 
		public MockInitialContextFactory() { 
		} 
	} 
}