1 23 package com.sun.enterprise.security; 24 25 import java.util.*; 26 import java.io.*; 27 import java.util.logging.*; 28 import javax.naming.Context ; 29 import com.sun.enterprise.util.Utility; 30 import com.sun.enterprise.util.ORBManager; 31 import com.sun.enterprise.Switch; 32 import com.sun.enterprise.security.auth.RemoteObject; 33 import com.sun.enterprise.security.auth.realm.Realm; 34 import com.sun.enterprise.NamingManager; 35 import com.sun.enterprise.naming.NamingManagerImpl; 36 import com.sun.enterprise.security.RealmConfig; 37 import com.sun.logging.*; 38 39 40 46 47 public class RealmManager extends RemoteObject implements IRealmManager{ 48 49 private static Logger _logger=null; 50 static { 51 _logger=LogDomains.getLogger(LogDomains.SECURITY_LOGGER); 52 } 53 54 public static String REALM_MANAGER_NAME = "Realm_Manager"; 56 57 58 64 public RealmManager() { 65 super(); 66 } 67 68 69 75 public void init() 76 throws javax.naming.NamingException , java.rmi.RemoteException { 77 78 RealmConfig.createRealms(); 79 } 80 81 82 85 public void start() throws java.lang.InterruptedException { 86 Object sync = new Object (); 88 synchronized (sync) { 89 sync.wait(); 90 } 91 } 92 93 94 public void refreshRealms(String realmName) 95 throws java.rmi.RemoteException { 96 try{ 97 Realm r = Realm.getInstance(realmName); 98 r.refresh(); 99 }catch (Exception e){ 100 throw new java.rmi.RemoteException (e.toString()); 101 } 102 } 103 104 105 111 public static void main(String [] args) { 112 try { 113 Utility.checkJVMVersion(); 114 ORBManager.getORB() ; 116 117 Switch theSwitch = Switch.getSwitch(); 118 NamingManager nm = new NamingManagerImpl(); 119 theSwitch.setNamingManager(nm); 120 121 RealmManager mgr = new RealmManager(); 122 mgr.init(); mgr.start(); } catch (Exception ex) { 125 _logger.log(Level.SEVERE, 126 "java_security.realm_manager_exception",ex); 127 } 128 } 129 130 131 } 132 133 134 135 | Popular Tags |