shiro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lhazlew...@apache.org
Subject svn commit: r916858 - in /incubator/shiro/trunk: core/src/main/java/org/apache/shiro/aop/ samples/quickstart/src/main/java/ support/aspectj/src/main/java/org/apache/shiro/aspectj/ support/spring/src/main/java/org/apache/shiro/spring/security/interceptor/
Date Fri, 26 Feb 2010 23:20:58 GMT
Author: lhazlewood
Date: Fri Feb 26 23:20:58 2010
New Revision: 916858

URL: http://svn.apache.org/viewvc?rev=916858&view=rev
Log:
Fixed minor spelling and/or formatting issues (try to keep code formatted the same to make
real code chages easily noticeable)

Modified:
    incubator/shiro/trunk/core/src/main/java/org/apache/shiro/aop/MethodInvocation.java
    incubator/shiro/trunk/samples/quickstart/src/main/java/Quickstart.java
    incubator/shiro/trunk/support/aspectj/src/main/java/org/apache/shiro/aspectj/BeforeAdviceMethodInvocationAdapter.java
    incubator/shiro/trunk/support/spring/src/main/java/org/apache/shiro/spring/security/interceptor/AopAllianceAnnotationsAuthorizingMethodInterceptor.java

Modified: incubator/shiro/trunk/core/src/main/java/org/apache/shiro/aop/MethodInvocation.java
URL: http://svn.apache.org/viewvc/incubator/shiro/trunk/core/src/main/java/org/apache/shiro/aop/MethodInvocation.java?rev=916858&r1=916857&r2=916858&view=diff
==============================================================================
--- incubator/shiro/trunk/core/src/main/java/org/apache/shiro/aop/MethodInvocation.java (original)
+++ incubator/shiro/trunk/core/src/main/java/org/apache/shiro/aop/MethodInvocation.java Fri
Feb 26 23:20:58 2010
@@ -70,12 +70,13 @@
      * @return the (possibly null) arguments to be supplied to the method invocation.
      */
     Object[] getArguments();
-    
+
     /**
      * Returns the object that holds the current joinpoint's static part.
      * For instance, the target object for an invocation.
-     *      
+     *
      * @return the object that holds the current joinpoint's static part.
+     * @since 1.0
      */
     Object getThis();
 

Modified: incubator/shiro/trunk/samples/quickstart/src/main/java/Quickstart.java
URL: http://svn.apache.org/viewvc/incubator/shiro/trunk/samples/quickstart/src/main/java/Quickstart.java?rev=916858&r1=916857&r2=916858&view=diff
==============================================================================
--- incubator/shiro/trunk/samples/quickstart/src/main/java/Quickstart.java (original)
+++ incubator/shiro/trunk/samples/quickstart/src/main/java/Quickstart.java Fri Feb 26 23:20:58
2010
@@ -43,7 +43,7 @@
 
         // The easiest way to create a Shiro SecurityManager with configured
         // realms, users, roles and permissions is to use the simple INI config.
-        // We'll do that by using a factory that can injest a .ini file and
+        // We'll do that by using a factory that can ingest a .ini file and
         // return a SecurityManager instance:
 
         // Use the shiro.ini file at the root of the classpath

Modified: incubator/shiro/trunk/support/aspectj/src/main/java/org/apache/shiro/aspectj/BeforeAdviceMethodInvocationAdapter.java
URL: http://svn.apache.org/viewvc/incubator/shiro/trunk/support/aspectj/src/main/java/org/apache/shiro/aspectj/BeforeAdviceMethodInvocationAdapter.java?rev=916858&r1=916857&r2=916858&view=diff
==============================================================================
--- incubator/shiro/trunk/support/aspectj/src/main/java/org/apache/shiro/aspectj/BeforeAdviceMethodInvocationAdapter.java
(original)
+++ incubator/shiro/trunk/support/aspectj/src/main/java/org/apache/shiro/aspectj/BeforeAdviceMethodInvocationAdapter.java
Fri Feb 26 23:20:58 2010
@@ -1,84 +1,90 @@
 package org.apache.shiro.aspectj;
 
-import java.lang.reflect.Method;
-
 import org.apache.shiro.aop.MethodInvocation;
 import org.aspectj.lang.JoinPoint;
 import org.aspectj.lang.reflect.AdviceSignature;
 import org.aspectj.lang.reflect.MethodSignature;
 
+import java.lang.reflect.Method;
+
 /**
  * Helper class that adapts and aspectj {@link JoinPoint}.
- * 
+ *
  * @author J-C Desrochers
  * @since 1.0.0
  */
 public class BeforeAdviceMethodInvocationAdapter implements MethodInvocation {
 
-  private Object _object;
-  private Method _method;
-  private Object[] _arguments;
-
-  /**
-   * Factory method that creates a new {@link BeforeAdviceMethodInvocationAdapter} instance
-   * using the AspectJ {@link JoinPoint} provided. If the joint point passed in is not
-   * a method joint point, this method throws an {@link IllegalArgumentException}.
-   * 
-   * @param aJoinPoint The AspectJ {@link JoinPoint} to use to adapt the advice.
-   * @return The created instance.
-   * @throws IllegalArgumentException If the join point passed in does not involve a method
call.
-   */
-  public static BeforeAdviceMethodInvocationAdapter createFrom(JoinPoint aJoinPoint) {
-    if (aJoinPoint.getSignature() instanceof MethodSignature) {
-      return new BeforeAdviceMethodInvocationAdapter(aJoinPoint.getThis(),
-              ((MethodSignature) aJoinPoint.getSignature()).getMethod(),
-              aJoinPoint.getArgs());
-      
-    } else if (aJoinPoint.getSignature() instanceof AdviceSignature) {
-      return new BeforeAdviceMethodInvocationAdapter(aJoinPoint.getThis(),
-              ((AdviceSignature) aJoinPoint.getSignature()).getAdvice(),
-              aJoinPoint.getArgs());
-      
-    } else {
-      throw new IllegalArgumentException("The joint point signature is invalid: expected
a MethodSignature or an AdviceSignature but was " + aJoinPoint.getSignature());
-    }
-  }
-  
-  /**
-   * Creates a new {@link BeforeAdviceMethodInvocationAdapter} instance.
-   *
-   * @param aMethod The method to invoke.
-   * @param someArguments The arguments of the method invocation.
-   */
-  public BeforeAdviceMethodInvocationAdapter(Object anObject, Method aMethod, Object[] someArguments)
{
-    _object = anObject;
-    _method = aMethod;
-    _arguments = someArguments;
-  }
-  
-  /* (non-Javadoc)
-   * @see org.apache.shiro.aop.MethodInvocation#getArguments()
-   */
-  public Object[] getArguments() {
-    return _arguments;
-  }
-
-  /* (non-Javadoc)
-   * @see org.apache.shiro.aop.MethodInvocation#getMethod()
-   */
-  public Method getMethod() {
-    return _method;
-  }
-
-  /* (non-Javadoc)
-   * @see org.apache.shiro.aop.MethodInvocation#proceed()
-   */
-  public Object proceed() throws Throwable {
-    // Do nothing since this adapts a before advice
-    return null;
-  }
-
-  public Object getThis() {
-    return _object;
-  }
+    private Object _object;
+    private Method _method;
+    private Object[] _arguments;
+
+    /**
+     * Factory method that creates a new {@link BeforeAdviceMethodInvocationAdapter} instance
+     * using the AspectJ {@link JoinPoint} provided. If the joint point passed in is not
+     * a method joint point, this method throws an {@link IllegalArgumentException}.
+     *
+     * @param aJoinPoint The AspectJ {@link JoinPoint} to use to adapt the advice.
+     * @return The created instance.
+     * @throws IllegalArgumentException If the join point passed in does not involve a method
call.
+     */
+    public static BeforeAdviceMethodInvocationAdapter createFrom(JoinPoint aJoinPoint) {
+        if (aJoinPoint.getSignature() instanceof MethodSignature) {
+            return new BeforeAdviceMethodInvocationAdapter(aJoinPoint.getThis(),
+                    ((MethodSignature) aJoinPoint.getSignature()).getMethod(),
+                    aJoinPoint.getArgs());
+
+        } else if (aJoinPoint.getSignature() instanceof AdviceSignature) {
+            return new BeforeAdviceMethodInvocationAdapter(aJoinPoint.getThis(),
+                    ((AdviceSignature) aJoinPoint.getSignature()).getAdvice(),
+                    aJoinPoint.getArgs());
+
+        } else {
+            throw new IllegalArgumentException("The joint point signature is invalid: expected
a MethodSignature or an AdviceSignature but was " + aJoinPoint.getSignature());
+        }
+    }
+
+    /**
+     * Creates a new {@link BeforeAdviceMethodInvocationAdapter} instance.
+     *
+     * @param aMethod       The method to invoke.
+     * @param someArguments The arguments of the method invocation.
+     */
+    public BeforeAdviceMethodInvocationAdapter(Object anObject, Method aMethod, Object[]
someArguments) {
+        _object = anObject;
+        _method = aMethod;
+        _arguments = someArguments;
+    }
+
+    /* (non-Javadoc)
+    * @see org.apache.shiro.aop.MethodInvocation#getArguments()
+    */
+
+    public Object[] getArguments() {
+        return _arguments;
+    }
+
+    /* (non-Javadoc)
+    * @see org.apache.shiro.aop.MethodInvocation#getMethod()
+    */
+
+    public Method getMethod() {
+        return _method;
+    }
+
+    /* (non-Javadoc)
+    * @see org.apache.shiro.aop.MethodInvocation#proceed()
+    */
+
+    public Object proceed() throws Throwable {
+        // Do nothing since this adapts a before advice
+        return null;
+    }
+
+    /**
+     * @since 1.0
+     */
+    public Object getThis() {
+        return _object;
+    }
 }

Modified: incubator/shiro/trunk/support/spring/src/main/java/org/apache/shiro/spring/security/interceptor/AopAllianceAnnotationsAuthorizingMethodInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/shiro/trunk/support/spring/src/main/java/org/apache/shiro/spring/security/interceptor/AopAllianceAnnotationsAuthorizingMethodInterceptor.java?rev=916858&r1=916857&r2=916858&view=diff
==============================================================================
--- incubator/shiro/trunk/support/spring/src/main/java/org/apache/shiro/spring/security/interceptor/AopAllianceAnnotationsAuthorizingMethodInterceptor.java
(original)
+++ incubator/shiro/trunk/support/spring/src/main/java/org/apache/shiro/spring/security/interceptor/AopAllianceAnnotationsAuthorizingMethodInterceptor.java
Fri Feb 26 23:20:58 2010
@@ -18,13 +18,12 @@
  */
 package org.apache.shiro.spring.security.interceptor;
 
-import java.lang.reflect.Method;
-
 import org.aopalliance.intercept.MethodInterceptor;
 import org.aopalliance.intercept.MethodInvocation;
-
 import org.apache.shiro.authz.aop.AnnotationsAuthorizingMethodInterceptor;
 
+import java.lang.reflect.Method;
+
 /**
  * Allows Shiro Annotations to work in any <a href="http://aopalliance.sourceforge.net/">AOP
Alliance</a>
  * specific implementation environment (for example, Spring).
@@ -64,9 +63,9 @@
                 return mi.proceed();
             }
 
-	    public Object getThis() {
-		return mi.getThis();
-	    }
+            public Object getThis() {
+                return mi.getThis();
+            }
         };
     }
 
@@ -74,6 +73,7 @@
      * Simply casts the method argument to an
      * {@link org.aopalliance.intercept.MethodInvocation org.aopalliance.intercept.MethodInvocation}
and then
      * calls <code>methodInvocation.{@link org.aopalliance.intercept.MethodInvocation#proceed
proceed}()</code>
+     *
      * @param aopAllianceMethodInvocation the {@link org.aopalliance.intercept.MethodInvocation
org.aopalliance.intercept.MethodInvocation}
      * @return the {@link org.aopalliance.intercept.MethodInvocation#proceed() org.aopalliance.intercept.MethodInvocation.proceed()}
method call result.
      * @throws Throwable if the underlying AOP Alliance <code>proceed()</code>
call throws a <code>Throwable</code>.



Mime
View raw message