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.
Principal getCurrentPrincipal()
null
if none provided.<T> Constructor<T> doPrivilegedGetDeclaredConstructor(Class<T> clazz, Class<?>... parameterTypes)
Class.getDeclaredConstructor(Class[])
<T> Constructor<T> doPrivilegedGetConstructor(Class<T> clazz, Class<?>... parameterTypes)
Class.getDeclaredConstructor(Class[])
<T> Constructor<?>[] doPrivilegedGetDeclaredConstructors(Class<T> clazz)
Class.getDeclaredConstructors()
<T> Method doPrivilegedGetDeclaredMethod(Class<T> clazz, String name, Class<?>... parameterTypes)
Class.getDeclaredMethod(String, Class[])
<T> Method[] doPrivilegedGetDeclaredMethods(Class<T> clazz)
Class.getDeclaredMethods()
<T> Field doPrivilegedGetDeclaredField(Class<T> clazz, String name)
Class.getDeclaredField(String)
<T> Field[] doPrivilegedGetDeclaredFields(Class<T> clazz)
Class.getDeclaredFields()
void doPrivilegedSetAccessible(AccessibleObject obj, boolean flag)
AccessibleObject.setAccessible(boolean)
boolean doPrivilegedIsAccessible(AccessibleObject obj)
AccessibleObject.isAccessible()
<T> T doPrivilegedObjectCreate(Class<T> clazz) throws PrivilegedActionException, IllegalAccessException, InstantiationException
void doPrivilegedSetSystemProperty(String propertyName, String value)
Class#
String doPrivilegedGetSystemProperty(String propertyName, String defaultValue)
System.getProperty(String, String)
Properties doPrivilegedGetSystemProperties()
System.getProperties()
Copyright © 2008–2016 The Apache Software Foundation. All rights reserved.