001/* 002 * Licensed to the Apache Software Foundation (ASF) under one 003 * or more contributor license agreements. See the NOTICE file 004 * distributed with this work for additional information 005 * regarding copyright ownership. The ASF licenses this file 006 * to you under the Apache License, Version 2.0 (the 007 * "License"); you may not use this file except in compliance 008 * with the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, 013 * software distributed under the License is distributed on an 014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 015 * KIND, either express or implied. See the License for the 016 * specific language governing permissions and limitations 017 * under the License. 018 * 019 */ 020package org.apache.directory.server.core.jndi; 021 022 023import javax.naming.InitialContext; 024import javax.naming.spi.InitialContextFactory; 025 026import org.apache.directory.server.core.api.DirectoryService; 027 028 029/** 030 * A server-side JNDI provider implementation of {@link InitialContextFactory}. 031 * This class can be utilized via JNDI API in the standard fashion: 032 * <p> 033 * <code> 034 * Hashtable env = new Hashtable(); 035 * env.put( Context.PROVIDER_URL, "ou=system" ); 036 * env.put( 037 * Context.INITIAL_CONTEXT_FACTORY, "org.apache.directory.server.core.jndi.CoreContextFactory" ); 038 * InitialContext initialContext = new InitialContext( env ); 039 * </code> 040 * <p> 041 * Unfortunately, {@link InitialContext} creates a new instance of 042 * {@link InitialContextFactory} implementation everytime it is instantiated, 043 * so this factory maintains only a static, singleton instance of 044 * {@link DirectoryService}, which provides actual implementation. 045 * Please note that you'll also have to maintain any stateful information 046 * as using singleton pattern if you're going to extend this factory. 047 * <p> 048 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> 049 * 050 * @see javax.naming.spi.InitialContextFactory 051 */ 052public abstract class AbstractContextFactory implements InitialContextFactory 053{ 054}