FileDocCategorySizeDatePackage
RealmManager.javaAPI DocGlassfish v2 API4865Fri May 04 22:35:22 BST 2007com.sun.enterprise.security

RealmManager

public class RealmManager extends com.sun.enterprise.security.auth.RemoteObject implements IRealmManager
This class has methods to startup and access the Realm and register it within the current Name Service.
see
IRealmManager the remote interface to access the realm
author
Harpreet Singh

Fields Summary
private static final Logger
_logger
public static final String
REALM_MANAGER_NAME
Constructors Summary
public RealmManager()
Creates a new instance of the Realm Manager. This call expects that an initialized ORB has been set in the ORBManager

see
com.sun.enterprise.util.ORBManager

 

    
                                
      
	super();
    
Methods Summary
public voidinit()
Initializes the Realm Manager Server & binds the name in the Name Service.

exception
A javax.naming.NamingException is thrown if unable to register the Authentication Server.


            RealmConfig.createRealms();
    
public static voidmain(java.lang.String[] args)
Starts up a standalone Realm Manager. It uses the command line arguments to initialize the ORB.

  	try {
	    Utility.checkJVMVersion();
	    // Initialize the ORB if not already started.
	    ORBManager.getORB() ;

	    Switch theSwitch = Switch.getSwitch();
	    NamingManager nm = new NamingManagerImpl();
	    theSwitch.setNamingManager(nm);
	    
	    RealmManager mgr = new RealmManager();
	    mgr.init(); // Initialize the Authentication Service ...
	    mgr.start(); // Start the Server.
        } catch (Exception ex) {
 	    _logger.log(Level.SEVERE,
                        "java_security.realm_manager_exception",ex);
	}
    
public voidrefreshRealms(java.lang.String realmName)

	    try{
		Realm r = Realm.getInstance(realmName);
		r.refresh();
	    }catch (Exception e){
		throw new java.rmi.RemoteException(e.toString());
	    }
    
public voidstart()
Starts the Authentication Server & waits forever for invocations.

	// wait for object invocation
	Object sync = new Object();
	synchronized (sync) { 
	    sync.wait(); 
	}