com.boylesoftware.cb2
Interface AuthenticationListener

All Known Implementing Classes:
UserBLO

public interface AuthenticationListener

BLOs can implement this interface if they want to be notified about user logins and logouts. When a BLO container is notified about a user login or logout through its processUserLogin and processUserLogout methods it goes through all its BLOs that implement this interface and calls appropriate methods on them.

The BLO container starts a transaction when it calls methods of this interface. If you have multiple BLOs implementing the interface, all BLOs are called within one single transaction.

When a BLO container is being destroyed, usually because the corresponding user session finishes or the whole application goes down, and there is a user authenticated for the session, the container "forces" user logout and notifies all authentication listeners about it first, and only then goes down.

Since it does not correspond to any user session, the Shared BLO Container does not get notified about user login/logout events. It means that there is little sense in implementing this interface by a shared BLO.

Warning! Because of internal library resources access synchronization, never call getUserPrincipal on the BLO container from any of this interface's methods! It will stall the whole application.

Version:
$Id: AuthenticationListener.java,v 1.2 2004/04/16 21:43:27 levahim Exp $
Author:
Lev Himmelfarb

Method Summary
 void processUserLogin(java.security.Principal principal)
          Notify the BLO about a user login event.
 void processUserLogout()
          Notify the BLO about a user logout event.
 

Method Detail

processUserLogin

public void processUserLogin(java.security.Principal principal)
                      throws BLException
Notify the BLO about a user login event.

Parameters:
principal - the logged in principal.
Throws:
BLException - if an error happened and the user cannot be logged in.

processUserLogout

public void processUserLogout()
                       throws BLException
Notify the BLO about a user logout event.

Throws:
BLException - if an error happened and the user cannot be logged out.


Copyright © 2002,2003,2004 - Boyle Software, Inc.