You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mb...@apache.org on 2013/08/14 00:10:21 UTC
svn commit: r1513673 - in /commons/sandbox/weaver/trunk/src/site:
markdown/index.md site.xml
Author: mbenson
Date: Tue Aug 13 22:10:21 2013
New Revision: 1513673
URL: http://svn.apache.org/r1513673
Log:
site work
Modified:
commons/sandbox/weaver/trunk/src/site/markdown/index.md
commons/sandbox/weaver/trunk/src/site/site.xml
Modified: commons/sandbox/weaver/trunk/src/site/markdown/index.md
URL: http://svn.apache.org/viewvc/commons/sandbox/weaver/trunk/src/site/markdown/index.md?rev=1513673&r1=1513672&r2=1513673&view=diff
==============================================================================
--- commons/sandbox/weaver/trunk/src/site/markdown/index.md (original)
+++ commons/sandbox/weaver/trunk/src/site/markdown/index.md Tue Aug 13 22:10:21 2013
@@ -1,49 +1,17 @@
-# Commons Privilizer
+# Commons Weaver
-Provides machinery to automate the handling of Java Security access
-controls in code. This involves wrapping calls that may trigger
-`java.lang.SecurityException`s in `PrivilegedAction` objects.
-Unfortunately this is quite an expensive operation and slows code
-down considerably; when executed in an environment that has no
-`SecurityManager` activated it is an utter waste.
-The typical pattern to cope with this is:
+Provides a general framework for the application of transformations
+to compiled Java bytecode. Commons Weaver provides:
-```java
-if (System.getSecurityManager() != null) {
- AccessController.doPrivileged(new PrivilegedAction<Void>() {
- public Void run() {
- doSomethingThatRequiresPermissions();
- return null;
- }
- });
-} else {
- doSomethingThatRequiresPermissions();
-}
-```
+* [Core Framework](commons-weaver/index.html)
+* [Weaver Modules](commons-weaver-modules-parent/index.html)
+* [Maven Plugin] (commons-weaver-maven-plugin/index.html)
+* [Antlib] (commons-weaver-antlib-parent/index.html)
-This becomes tedious in short order. The immediate response of a
-typical developer: relegate the repetitive code to a set of
-utility methods. In the case of Java security, however, this
-approach is considered risky. The purpose of the Privilizer, then,
-is to instrument compiled methods originally annotated with our
-`@Privileged` annotation. This annotation is retained in the
-classfiles, but not available at runtime, and there are no runtime
-dependencies.
+##FAQ
-### With Privilizer
+* *Q*: Why not just use AspectJ?
-```java
-
-@Privileged
-private void doSomethingThatRequiresPermissions() {
- ...
-}
-```
-
-Commons Privilizer provides both a Maven plugin and an Antlib for
-weaving your compiled, annotated classes. You can control the weaving
-behavior by parameterizing the Maven goals and Ant task with
-the [Policy][policy] and [AccessLevel][accessLevel] `enum`s.
-
-[policy]: apidocs/org/apache/commons/privilizer/weave/Privilizer.Policy.html
-[accessLevel]: apidocs/org/apache/commons/privilizer/weave/AccessLevel.html
+ *A*: The original motivation to develop the codebase that evolved into
+ Commons Weaver instead of simply using AspectJ was to avoid the
+ runtime dependency, however small, introduced by the use of AspectJ.
Modified: commons/sandbox/weaver/trunk/src/site/site.xml
URL: http://svn.apache.org/viewvc/commons/sandbox/weaver/trunk/src/site/site.xml?rev=1513673&r1=1513672&r2=1513673&view=diff
==============================================================================
--- commons/sandbox/weaver/trunk/src/site/site.xml (original)
+++ commons/sandbox/weaver/trunk/src/site/site.xml Tue Aug 13 22:10:21 2013
@@ -33,6 +33,5 @@
<item name="SVN" href="/source-repository.html"/>
<item name="Building" href="/building.html"/>
</menu>
- <menu ref="modules" />
</body>
</project>