Package org.apache.webbeans.spi
Interface SecurityService
-
public interface SecurityService
The SecurityService SPI provides support for all kinds of JavaEE related security mechanism.
There are by default 2 basically different implementations provided by OpenWebBeans. One version performs all underlying class invocations via
AccessController.doPrivileged(java.security.PrivilegedAction<T>)
which is intended for use in Java EE servers. The 2nd version directly invokes the underlying Class methods without any AccessControler and is intended for scenarios where no Java security mechanism needs to be used. Since OpenWebBeans (as any other DI framework) is heavily based on reflection, using the simple NoSecurityService leads to a way better application performance.
-
-
Method Summary
-
-
-
Method Detail
-
getCurrentPrincipal
Principal getCurrentPrincipal()
Gets the current caller identity. Note that it must be a contextual (proxy) instance to respect the scope of the enclosing bean.- Returns:
- current caller identity or
null
if none provided.
-
doPrivilegedGetDeclaredConstructor
<T> Constructor<T> doPrivilegedGetDeclaredConstructor(Class<T> clazz, Class<?>... parameterTypes)
- See Also:
Class.getDeclaredConstructor(Class[])
-
doPrivilegedGetConstructor
<T> Constructor<T> doPrivilegedGetConstructor(Class<T> clazz, Class<?>... parameterTypes)
- See Also:
Class.getDeclaredConstructor(Class[])
-
doPrivilegedGetDeclaredConstructors
<T> Constructor<?>[] doPrivilegedGetDeclaredConstructors(Class<T> clazz)
- See Also:
Class.getDeclaredConstructors()
-
doPrivilegedGetDeclaredMethod
<T> Method doPrivilegedGetDeclaredMethod(Class<T> clazz, String name, Class<?>... parameterTypes)
- See Also:
Class.getDeclaredMethod(String, Class[])
-
doPrivilegedGetDeclaredMethods
<T> Method[] doPrivilegedGetDeclaredMethods(Class<T> clazz)
- See Also:
Class.getDeclaredMethods()
-
doPrivilegedGetDeclaredField
<T> Field doPrivilegedGetDeclaredField(Class<T> clazz, String name)
- See Also:
Class.getDeclaredField(String)
-
doPrivilegedGetDeclaredFields
<T> Field[] doPrivilegedGetDeclaredFields(Class<T> clazz)
- See Also:
Class.getDeclaredFields()
-
doPrivilegedSetAccessible
void doPrivilegedSetAccessible(AccessibleObject obj, boolean flag)
- See Also:
AccessibleObject.setAccessible(boolean)
-
doPrivilegedIsAccessible
boolean doPrivilegedIsAccessible(AccessibleObject obj)
- See Also:
AccessibleObject.isAccessible()
-
doPrivilegedObjectCreate
<T> T doPrivilegedObjectCreate(Class<T> clazz) throws PrivilegedActionException, IllegalAccessException, InstantiationException
-
doPrivilegedSetSystemProperty
void doPrivilegedSetSystemProperty(String propertyName, String value)
-
doPrivilegedGetSystemProperty
String doPrivilegedGetSystemProperty(String propertyName, String defaultValue)
- See Also:
System.getProperty(String, String)
-
doPrivilegedGetSystemProperties
Properties doPrivilegedGetSystemProperties()
- See Also:
System.getProperties()
-
-