public final class EJBSecurityManager extends Object implements SecurityManager
| Constructor and Description |
|---|
EJBSecurityManager(EjbDescriptor ejbDescriptor,
InvocationManager invocationManager,
EJBSecurityManagerFactory fact) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
authorize(ComponentInvocation componentInvocation)
This method is called by the EJB container to decide whether or not a method specified in the Invocation should be
allowed.
|
void |
destroy()
Call this method to clean up all the bookeeping data-structures in the SM.
|
Object |
doAsPrivileged(PrivilegedExceptionAction pea)
This method is used by SecurityUtil runMethod to run the action as the subject encapsulated in the cuurent
SecurityContext.
|
Principal |
getCallerPrincipal()
This method returns the Client Principal who initiated the current Invocation.
|
static String |
getContextID(EjbDescriptor ejbDescriptor) |
Subject |
getCurrentSubject()
This will return the subject associated with the current call.
|
boolean |
getUsesCallerIdentity() |
Object |
invoke(Method beanClassMethod,
boolean isLocal,
Object beanObject,
Object[] parameters)
This method is similiar to the runMethod, except it keeps the semantics same as the one in reflection.
|
boolean |
isCallerInRole(String role)
This method returns a boolean value indicating whether or not the caller is in the specified role.
|
void |
loadPolicyConfiguration(EjbDescriptor ejbDescriptor) |
void |
postInvoke(ComponentInvocation inv)
This method is used by Message Driven Bean Container to remove the run-as identity information that was set up using
the preSetRunAsIdentity method
|
void |
preInvoke(ComponentInvocation inv)
This method is used by MDB Container - Invocation Manager to setup the run-as identity information.
|
void |
resetPolicyContext()
Purge ThreadLocals held by javax.security.jacc.PolicyContext
|
Object |
runMethod(Method beanClassMethod,
Object beanObject,
Object[] parameters)
Runs a business method of an EJB within the bean's policy context.
|
public EJBSecurityManager(EjbDescriptor ejbDescriptor, InvocationManager invocationManager, EJBSecurityManagerFactory fact) throws Exception
Exceptionpublic static String getContextID(EjbDescriptor ejbDescriptor)
public void preInvoke(ComponentInvocation inv)
preInvoke in interface SecurityManagerpublic void postInvoke(ComponentInvocation inv)
postInvoke in interface SecurityManagerpublic boolean getUsesCallerIdentity()
public void loadPolicyConfiguration(EjbDescriptor ejbDescriptor) throws Exception
Exceptionpublic boolean authorize(ComponentInvocation componentInvocation)
authorize in interface SecurityManagercomponentInvocation - invocation object that contains all the details of the invocation.public boolean isCallerInRole(String role)
isCallerInRole in interface SecurityManagerrole - role name in the form of java.lang.Stringpublic Object invoke(Method beanClassMethod, boolean isLocal, Object beanObject, Object[] parameters) throws Throwable
invoke in interface SecurityManagerbeanClassMethod, - the bean class method to be invokedisLocal, - true if this invocation is through the local EJB viewbeanObject - the object on which this method is to be invoked in this case the ejb,parameters - the parameters for the method,c, - the container instance can be a null value, where in the container will be queried to find its security
manager.Throwablepublic void resetPolicyContext()
SecurityManagerresetPolicyContext in interface SecurityManagerpublic Principal getCallerPrincipal()
getCallerPrincipal in interface SecurityManagerpublic void destroy()
SecurityManagerdestroy in interface SecurityManagerpublic Subject getCurrentSubject()
getCurrentSubject in interface SecurityManagerpublic Object doAsPrivileged(PrivilegedExceptionAction pea) throws Throwable
SecurityManagerdoAsPrivileged in interface SecurityManagerThrowablepublic Object runMethod(Method beanClassMethod, Object beanObject, Object[] parameters) throws Throwable
beanClassMethod - the EJB business methodbeanObject - the EJB bean instanceparameters - parameters passed to beanClassMethodInvocationTargetException - if the underlying method throws an exceptionThrowable - other throwables in other casesCopyright © 2019. All rights reserved.