Interface AppContext
public interface AppContext
A container-agnostic interface to the currently loaded webapp.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the set of Permissions granted to the application, excludinguser-specified permissions.Returns the ClassLoader for the webapp.Returns the container-specific context implementation.Returns aPermissionsobject containingUnresolvedPermissioninstances for every permission that was requested by the user in theirappengine-web.xmlfile.
-
Method Details
-
getClassLoader
ClassLoader getClassLoader()Returns the ClassLoader for the webapp.- Returns:
- a non-null ClassLoader
-
getUserPermissions
Permissions getUserPermissions()Returns aPermissionsobject containingUnresolvedPermissioninstances for every permission that was requested by the user in theirappengine-web.xmlfile.Note that user code will not actually run with these permissions. However, to user-provided code that calls
SecurityManager.checkPermissiondirectly it will appear that it is. This is designed primarily for third-party libraries that introduce their ownPermissionsubclasses that are not used by any other classes.- Returns:
- a non-null set of Permissions
-
getApplicationPermissions
Permissions getApplicationPermissions()Returns the set of Permissions granted to the application, excludinguser-specified permissions.- Returns:
- a non-null set of Permissions
-
getContainerContext
Object getContainerContext()Returns the container-specific context implementation.- Returns:
- a non-null context, represented by a container-specific class.
For example, Jetty's
org.mortbay.jetty.webapp.WebAppContext.
-