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
Exception
public static String getContextID(EjbDescriptor ejbDescriptor)
public void preInvoke(ComponentInvocation inv)
preInvoke
in interface SecurityManager
public void postInvoke(ComponentInvocation inv)
postInvoke
in interface SecurityManager
public boolean getUsesCallerIdentity()
public void loadPolicyConfiguration(EjbDescriptor ejbDescriptor) throws Exception
Exception
public boolean authorize(ComponentInvocation componentInvocation)
authorize
in interface SecurityManager
componentInvocation
- invocation object that contains all the details of the invocation.public boolean isCallerInRole(String role)
isCallerInRole
in interface SecurityManager
role
- role name in the form of java.lang.Stringpublic Object invoke(Method beanClassMethod, boolean isLocal, Object beanObject, Object[] parameters) throws Throwable
invoke
in interface SecurityManager
beanClassMethod,
- 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.Throwable
public void resetPolicyContext()
SecurityManager
resetPolicyContext
in interface SecurityManager
public Principal getCallerPrincipal()
getCallerPrincipal
in interface SecurityManager
public void destroy()
SecurityManager
destroy
in interface SecurityManager
public Subject getCurrentSubject()
getCurrentSubject
in interface SecurityManager
public Object doAsPrivileged(PrivilegedExceptionAction pea) throws Throwable
SecurityManager
doAsPrivileged
in interface SecurityManager
Throwable
public 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 © 2021. All rights reserved.