org.apache.cocoon.auth
Class StandardApplication

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.auth.StandardApplication
All Implemented Interfaces:
Disposable, Configurable, LogEnabled, Serviceable, ThreadSafe, Application
Direct Known Subclasses:
StandardPortalApplication

public class StandardApplication
extends AbstractLogEnabled
implements Application, Configurable, Serviceable, Disposable, ThreadSafe

This is the default implementation for an Application.

Version:
$Id: StandardApplication.html 1304258 2012-03-23 10:09:27Z ilgrosso $

Field Summary
protected  Map attributes
          Attributes.
protected  SecurityHandler handler
          The security handler.
protected static String HANDLER_CONFIG_PREFIX
          This prefix is used to lookup security handlers.
protected  ServiceManager manager
          The service manager.
protected  ApplicationStore store
          Application store.
protected static String STORE_CONFIG_PREFIX
          This prefix is used to lookup application stores.
 
Constructor Summary
StandardApplication()
           
 
Method Summary
 void configure(Configuration conf)
           
protected  void configureAttributes(Configuration conf)
          This method is invoked during configuration of the application.
 void dispose()
           
 ApplicationStore getApplicationStore()
          Return the application store for loading/saving user specific data.
 Object getAttribute(String key)
          Get the value of an application attribute.
 SecurityHandler getSecurityHandler()
          Return the security handler for this application.
 void removeAttribute(String key)
          Remove an application attribute.
 void service(ServiceManager aManager)
           
 void setAttribute(String key, Object value)
          Set an application attribute.
 void userDidLogin(User user, Map context)
          Notify the application about a successful login of a user.
 void userIsAccessing(User user)
          Notify the application about a user using the application in the current request.
 void userWillLogout(User user, Map context)
          Notify the application about a logout of a user.
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HANDLER_CONFIG_PREFIX

protected static final String HANDLER_CONFIG_PREFIX
This prefix is used to lookup security handlers.


STORE_CONFIG_PREFIX

protected static final String STORE_CONFIG_PREFIX
This prefix is used to lookup application stores.


manager

protected ServiceManager manager
The service manager.


handler

protected SecurityHandler handler
The security handler.


attributes

protected final Map attributes
Attributes.


store

protected ApplicationStore store
Application store.

Constructor Detail

StandardApplication

public StandardApplication()
Method Detail

service

public void service(ServiceManager aManager)
             throws ServiceException
Specified by:
service in interface Serviceable
Throws:
ServiceException
See Also:
Serviceable.service(org.apache.avalon.framework.service.ServiceManager)

configure

public void configure(Configuration conf)
               throws ConfigurationException
Specified by:
configure in interface Configurable
Throws:
ConfigurationException
See Also:
Configurable.configure(org.apache.avalon.framework.configuration.Configuration)

configureAttributes

protected void configureAttributes(Configuration conf)
This method is invoked during configuration of the application. The default behaviour is to add all children of the configuration object as key value pairs. The name of the child is the key, and the value of the tag is the value (as a string). Subclasses can override this method, if a different/additional behaviour is wanted.

Parameters:
conf - The application configuration.

dispose

public void dispose()
Specified by:
dispose in interface Disposable
See Also:
Disposable.dispose()

getSecurityHandler

public SecurityHandler getSecurityHandler()
Description copied from interface: Application
Return the security handler for this application.

Specified by:
getSecurityHandler in interface Application
Returns:
The security handler
See Also:
Application.getSecurityHandler()

getApplicationStore

public ApplicationStore getApplicationStore()
Description copied from interface: Application
Return the application store for loading/saving user specific data.

Specified by:
getApplicationStore in interface Application
Returns:
Return the application store or null.
See Also:
Application.getApplicationStore()

setAttribute

public void setAttribute(String key,
                         Object value)
Description copied from interface: Application
Set an application attribute.

Specified by:
setAttribute in interface Application
Parameters:
key - The key of the attribute.
value - The value of the attribute.
See Also:
Application.setAttribute(java.lang.String, java.lang.Object)

removeAttribute

public void removeAttribute(String key)
Description copied from interface: Application
Remove an application attribute.

Specified by:
removeAttribute in interface Application
Parameters:
key - The key of the attribute.
See Also:
Application.removeAttribute(java.lang.String)

getAttribute

public Object getAttribute(String key)
Description copied from interface: Application
Get the value of an application attribute.

Specified by:
getAttribute in interface Application
Parameters:
key - The key of the attribute.
Returns:
The value of the attribute or null.
See Also:
Application.getAttribute(java.lang.String)

userDidLogin

public void userDidLogin(User user,
                         Map context)
Description copied from interface: Application
Notify the application about a successful login of a user.

Specified by:
userDidLogin in interface Application
Parameters:
user - The current user.
context - The context for the login operation.
See Also:
Application.userDidLogin(org.apache.cocoon.auth.User, java.util.Map)

userWillLogout

public void userWillLogout(User user,
                           Map context)
Description copied from interface: Application
Notify the application about a logout of a user.

Specified by:
userWillLogout in interface Application
Parameters:
user - The current user.
context - The context for the logout operation.
See Also:
Application.userWillLogout(org.apache.cocoon.auth.User, java.util.Map)

userIsAccessing

public void userIsAccessing(User user)
Description copied from interface: Application
Notify the application about a user using the application in the current request. This method might be called more than once during one request, so the application should check this. This hook can for example be used by the application to prepare the current object model of the request.

Specified by:
userIsAccessing in interface Application
Parameters:
user - The current user.
See Also:
Application.userIsAccessing(org.apache.cocoon.auth.User)


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.