public final class EJBSecurityManager extends Object implements SecurityManager
| Constructor and Description |
|---|
EJBSecurityManager(EjbDescriptor ejbDescriptor,
InvocationManager invMgr,
EJBSecurityManagerFactory fact) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
authorize(ComponentInvocation compInv)
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) |
Principal |
getCallerPrincipal()
This method returns the Client Principal who initiated the current
Invocation.
|
static String |
getContextID(EjbDescriptor ejbDesc) |
Subject |
getCurrentSubject()
This will return the subject associated with the current call.
|
boolean |
getUsesCallerIdentity() |
Object |
invoke(Method beanClassMethod,
boolean isLocal,
Object o,
Object[] oa)
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 eDescriptor) |
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 obj,
Object[] oa)
Runs a business method of an EJB within the bean's policy context.
|
public EJBSecurityManager(EjbDescriptor ejbDescriptor, InvocationManager invMgr, EJBSecurityManagerFactory fact) throws Exception
Exceptionpublic boolean getUsesCallerIdentity()
public void loadPolicyConfiguration(EjbDescriptor eDescriptor) throws Exception
Exceptionpublic static String getContextID(EjbDescriptor ejbDesc)
public boolean authorize(ComponentInvocation compInv)
authorize in interface SecurityManagercompInv - invocation object that contains all the details of the
invocation.public void preInvoke(ComponentInvocation inv)
preInvoke in interface SecurityManagerpublic void postInvoke(ComponentInvocation inv)
postInvoke in interface SecurityManagerpublic boolean isCallerInRole(String role)
isCallerInRole in interface SecurityManagerrole - role name in the form of java.lang.Stringpublic Principal getCallerPrincipal()
getCallerPrincipal in interface SecurityManagerpublic void destroy()
SecurityManagerdestroy in interface SecurityManagerpublic Subject getCurrentSubject()
getCurrentSubject in interface SecurityManagerpublic Object doAsPrivileged(PrivilegedExceptionAction pea) throws Throwable
doAsPrivileged in interface SecurityManagerThrowablepublic Object runMethod(Method beanClassMethod, Object obj, Object[] oa) throws Throwable
beanClassMethod - the EJB business methodobj - the EJB bean instanceoa - parameters passed to beanClassMethodInvocationTargetException - if the underlying method throws an exceptionThrowable - other throwables in other casespublic Object invoke(Method beanClassMethod, boolean isLocal, Object o, Object[] oa) throws Throwable
invoke in interface SecurityManagerbeanClassMethod, - the bean class method to be invokedisLocal, - true if this invocation is through the local EJB viewo - the object on which this method is to be
invoked in this case the ejb,oa - 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 SecurityManagerCopyright © 2017. All rights reserved.