org.jboss.dependency.plugins.action
Class AccessControllerContextAction<S extends ControllerContext,T extends ControllerContext>

java.lang.Object
  extended by org.jboss.dependency.plugins.action.AccessControllerContextAction<S,T>
Type Parameters:
S - simple ControllerContext impl
T - full ControllerContext impl
All Implemented Interfaces:
ControllerContextAction
Direct Known Subclasses:
SimpleControllerContextAction

public abstract class AccessControllerContextAction<S extends ControllerContext,T extends ControllerContext>
extends Object
implements ControllerContextAction

Access controller context. It runs action in simple mode if there is no security manager present. While running simple action, you cast the actual context into less specific type.

Author:
Ales Justin

Constructor Summary
AccessControllerContextAction()
           
 
Method Summary
protected abstract  T fullContextCast(ControllerContext context)
          Cast context instance.
 void install(ControllerContext context)
          Install a context
protected abstract  void secureInstallAction(T context)
          Secure call to install action.
protected abstract  void secureUninstallAction(T context)
          Secure call to uninstall action.
protected abstract  S simpleContextCast(ControllerContext context)
          Cast context instance.
protected abstract  void simpleInstallAction(S context)
          Unsecure call to install action.
protected abstract  void simpleUninstallAction(S context)
          Unsecure call to uninstall action.
 void uninstall(ControllerContext context)
          Uninstall a context
protected abstract  boolean validateContext(ControllerContext context)
          Validate context
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccessControllerContextAction

public AccessControllerContextAction()
Method Detail

validateContext

protected abstract boolean validateContext(ControllerContext context)
Validate context

Parameters:
context - context instance to validate
Returns:
false if not able to use privileged action

simpleContextCast

protected abstract S simpleContextCast(ControllerContext context)
Cast context instance. We can throw class cast exception if unable to cast it it S.

Parameters:
context - context to cast
Returns:
casted context

fullContextCast

protected abstract T fullContextCast(ControllerContext context)
Cast context instance. We can throw class cast exception if unable to cast it it T.

Parameters:
context - context to cast
Returns:
casted context

install

public void install(ControllerContext context)
             throws Throwable
Description copied from interface: ControllerContextAction
Install a context

Specified by:
install in interface ControllerContextAction
Parameters:
context - the context
Throws:
Throwable - for any error

simpleInstallAction

protected abstract void simpleInstallAction(S context)
                                     throws Throwable
Unsecure call to install action.

Parameters:
context - the context
Throws:
Throwable - for any error

secureInstallAction

protected abstract void secureInstallAction(T context)
                                     throws Throwable
Secure call to install action.

Parameters:
context - the context
Throws:
Throwable - for any error

uninstall

public void uninstall(ControllerContext context)
Description copied from interface: ControllerContextAction
Uninstall a context

Specified by:
uninstall in interface ControllerContextAction
Parameters:
context - the context

simpleUninstallAction

protected abstract void simpleUninstallAction(S context)
Unsecure call to uninstall action.

Parameters:
context - the context

secureUninstallAction

protected abstract void secureUninstallAction(T context)
Secure call to uninstall action.

Parameters:
context - the context


Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.