Methods Summary |
---|
public static javax.security.auth.callback.CallbackHandler | getCallbackHandler()This returns the CallbackHandler for the AppContainer.
return handler;
|
private void | initializeCallbackHandler(java.lang.String callbackHandler, java.lang.ClassLoader loader)Initialize the JAAS login modules.
One login module per realm (default and certificate).
Class handlerClass = null;
handler = null;
try {
if(callbackHandler != null) {
handlerClass = Class.forName(callbackHandler, true, loader);
handler = (CallbackHandler) handlerClass.newInstance();
} else {
handler = new com.sun.enterprise.security.auth.login.LoginCallbackHandler(guiAuth);
}
} catch(Exception e) {
_logger.log(Level.FINE, "Could not instantiate specified " +
"callback handler:" + e.getMessage(), e);
_logger.info("acc.using_default_callback");
handler = new com.sun.enterprise.security.auth.login.LoginCallbackHandler(guiAuth);
}
|
public static javax.naming.InitialContext | initializeNaming(java.util.Properties iiopProperties)Creates the InitialContext, initializes the ORB's transaction service,
and creates and establishes the switch's transaction manager.
InitialContext result = new InitialContext(iiopProperties);
Switch sw = Switch.getSwitch();
InvocationManager im = new InvocationManagerImpl();
sw.setInvocationManager(im);
// Initialize Transaction service. By now the ORB must have
// been created during the new InitialContext() call using
// the ORBManager
PEORBConfigurator.initTransactionService(null, new Properties() );
/* Create the transaction manager and set it in the switch. */
// J2EETransactionManager tm = new J2EETransactionManagerImpl();
J2EETransactionManager tm =
J2EETransactionManagerImpl.createTransactionManager();
sw.setTransactionManager(tm);
/* Create the naming manager and set it in the switch. */
sw.setNamingManager(new NamingManagerImpl(result));
// Create the Injection Manager and set it on the switch.
InjectionManager injectionMgr = new InjectionManagerImpl();
sw.setInjectionManager(injectionMgr);
return result;
|
public void | performUserLogin()
/* Login the user. */
// eager authentication!
boolean doLogin =
Boolean.valueOf(System.getProperty("startup.login", "false")).booleanValue();
if(doLogin) {
_logger.info("acc.init_login");
String loginMech = System.getProperty(
"com.sun.enterprise.loginMech", "password");
if(loginMech.equalsIgnoreCase("ssl")) {
LoginContextDriver.doClientLogin(CERTIFICATE, handler);
} else if(loginMech.equalsIgnoreCase("all")) {
LoginContextDriver.doClientLogin(ALL, handler);
} else {
LoginContextDriver.doClientLogin(USERNAME_PASSWORD, handler);
}
}
|
public void | postInvoke()This is called by the main after the real main of the application
is invoked. Performs cleanup.
nm.unbindObjects(descriptor);
|
public java.lang.String | preInvoke(java.util.Properties props)This is called by main before the actual main of the application
is invoked. It initializes the container and performs login for
the user.
return preInvoke(initializeNaming(props), Thread.currentThread().getContextClassLoader());
|
public java.lang.String | preInvoke(javax.naming.InitialContext ic, java.lang.ClassLoader loader)This is called by main before the actual main of the application
is invoked. It initializes the container and performs login for
the user.
ComponentInvocation ci = new ComponentInvocation(null, this);
sw.getInvocationManager().preInvoke(ci);
// Do security setup
String callbackHandler = descriptor.getCallbackHandler();
_logger.fine("Callback Handler:" + callbackHandler);
initializeCallbackHandler(callbackHandler, loader);
performUserLogin();
String mainClass = descriptor.getMainClassName();
sw.setDescriptorFor(this, descriptor);
nm = Switch.getSwitch().getNamingManager();
nm.bindObjects(descriptor);
return mainClass;
|