KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > repository > RepositoryInitContextFactory


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23 package com.sun.enterprise.repository;
24
25 import java.util.Hashtable JavaDoc;
26 import java.util.Enumeration JavaDoc;
27 import javax.naming.Context JavaDoc;
28 import javax.naming.spi.InitialContextFactory JavaDoc;
29 // IASRI 4660742 START
30
import java.util.logging.*;
31 import com.sun.logging.*;
32 // IASRI 4660742 END
33

34 /**
35  * @author Harish Prabandham
36  */

37 public class RepositoryInitContextFactory implements InitialContextFactory JavaDoc {
38 // IASRI 4660742 START
39
private static Logger _logger=null;
40     static{
41        _logger=LogDomains.getLogger(LogDomains.ROOT_LOGGER);
42         }
43 // IASRI 4660742 END
44

45     public Context JavaDoc getInitialContext(Hashtable JavaDoc env) {
46         return new RepositoryContext(env);
47     }
48
49     public static void print(Hashtable JavaDoc env)
50     {
51 // IASRI 4660742 System.out.println("RepositoryContextFactory[");
52
// START OF IASRI 4660742
53
_logger.log(Level.FINE,"RepositoryContextFactory[");
54 // END OF IASRI 4660742
55
for(Enumeration JavaDoc e = env.keys(); e.hasMoreElements(); )
56         {
57             String JavaDoc key = (String JavaDoc) e.nextElement();
58             Object JavaDoc value = env.get(key);
59
60 // IASRI 4660742 System.out.println("(" + key + " , " + value + ")" );
61
// START OF IASRI 4660742
62
_logger.log(Level.FINE,"(" + key + " , " + value + ")");
63 // END OF IASRI 4660742
64
}
65 // IASRI 4660742 System.out.println("]");
66
// START OF IASRI 4660742
67
_logger.log(Level.FINE,"]");
68 // END OF IASRI 4660742
69
}
70 }
71
Popular Tags