You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shiro.apache.org by lh...@apache.org on 2010/05/11 02:14:12 UTC
svn commit: r942957 - in /incubator/shiro/trunk:
core/src/main/java/org/apache/shiro/aop/
core/src/main/java/org/apache/shiro/authz/permission/
core/src/main/java/org/apache/shiro/util/ src/docbkx/resources/xsl/
support/aspectj/src/main/aspect/org/apac...
Author: lhazlewood
Date: Tue May 11 00:14:12 2010
New Revision: 942957
URL: http://svn.apache.org/viewvc?rev=942957&view=rev
Log:
Fixed license headers in all remaining known files
Modified:
incubator/shiro/trunk/core/src/main/java/org/apache/shiro/aop/MethodInterceptor.java
incubator/shiro/trunk/core/src/main/java/org/apache/shiro/aop/MethodInterceptorSupport.java
incubator/shiro/trunk/core/src/main/java/org/apache/shiro/aop/MethodInvocation.java
incubator/shiro/trunk/core/src/main/java/org/apache/shiro/authz/permission/DomainPermission.java
incubator/shiro/trunk/core/src/main/java/org/apache/shiro/util/ThreadState.java
incubator/shiro/trunk/src/docbkx/resources/xsl/fopdf.xsl
incubator/shiro/trunk/support/aspectj/src/main/aspect/org/apache/shiro/aspectj/ShiroAnnotationAuthorizingAspect.java
incubator/shiro/trunk/support/aspectj/src/main/java/org/apache/shiro/aspectj/AspectjAnnotationsAuthorizingMethodInterceptor.java
incubator/shiro/trunk/support/aspectj/src/main/java/org/apache/shiro/aspectj/BeforeAdviceMethodInvocationAdapter.java
incubator/shiro/trunk/support/aspectj/src/main/java/org/apache/shiro/aspectj/package-info.java
incubator/shiro/trunk/support/aspectj/src/test/java/org/apache/shiro/aspectj/DummyService.java
incubator/shiro/trunk/support/aspectj/src/test/java/org/apache/shiro/aspectj/DummyServiceTest.java
incubator/shiro/trunk/support/aspectj/src/test/java/org/apache/shiro/aspectj/RestrictedDummyService.java
incubator/shiro/trunk/support/aspectj/src/test/java/org/apache/shiro/aspectj/SecuredDummyService.java
incubator/shiro/trunk/support/aspectj/src/test/resources/META-INF/aop.xml
incubator/shiro/trunk/support/spring/src/test/java/org/apache/shiro/spring/remoting/SecureRemoteInvocationFactoryTest.java
Modified: incubator/shiro/trunk/core/src/main/java/org/apache/shiro/aop/MethodInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/shiro/trunk/core/src/main/java/org/apache/shiro/aop/MethodInterceptor.java?rev=942957&r1=942956&r2=942957&view=diff
==============================================================================
--- incubator/shiro/trunk/core/src/main/java/org/apache/shiro/aop/MethodInterceptor.java (original)
+++ incubator/shiro/trunk/core/src/main/java/org/apache/shiro/aop/MethodInterceptor.java Tue May 11 00:14:12 2010
@@ -16,25 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
package org.apache.shiro.aop;
/**
Modified: incubator/shiro/trunk/core/src/main/java/org/apache/shiro/aop/MethodInterceptorSupport.java
URL: http://svn.apache.org/viewvc/incubator/shiro/trunk/core/src/main/java/org/apache/shiro/aop/MethodInterceptorSupport.java?rev=942957&r1=942956&r2=942957&view=diff
==============================================================================
--- incubator/shiro/trunk/core/src/main/java/org/apache/shiro/aop/MethodInterceptorSupport.java (original)
+++ incubator/shiro/trunk/core/src/main/java/org/apache/shiro/aop/MethodInterceptorSupport.java Tue May 11 00:14:12 2010
@@ -16,25 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
package org.apache.shiro.aop;
import org.apache.shiro.SecurityUtils;
@@ -49,8 +30,7 @@ import org.apache.shiro.subject.Subject;
* @author Les Hazlewood
* @since 0.2
*/
-public abstract class MethodInterceptorSupport implements MethodInterceptor
-{
+public abstract class MethodInterceptorSupport implements MethodInterceptor {
/**
* Default no-argument constructor for subclasses.
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=942957&r1=942956&r2=942957&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 Tue May 11 00:14:12 2010
@@ -16,25 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
package org.apache.shiro.aop;
import java.lang.reflect.Method;
Modified: incubator/shiro/trunk/core/src/main/java/org/apache/shiro/authz/permission/DomainPermission.java
URL: http://svn.apache.org/viewvc/incubator/shiro/trunk/core/src/main/java/org/apache/shiro/authz/permission/DomainPermission.java?rev=942957&r1=942956&r2=942957&view=diff
==============================================================================
--- incubator/shiro/trunk/core/src/main/java/org/apache/shiro/authz/permission/DomainPermission.java (original)
+++ incubator/shiro/trunk/core/src/main/java/org/apache/shiro/authz/permission/DomainPermission.java Tue May 11 00:14:12 2010
@@ -1,3 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.shiro.authz.permission;
import org.apache.shiro.util.StringUtils;
@@ -17,7 +35,9 @@ public abstract class DomainPermission e
private String actions;
private String targets;
- /** Creates a domain permission with *all* actions for *all* targets; */
+ /**
+ * Creates a domain permission with *all* actions for *all* targets;
+ */
public DomainPermission() {
setParts(getDomain(getClass()), null, null);
}
Modified: incubator/shiro/trunk/core/src/main/java/org/apache/shiro/util/ThreadState.java
URL: http://svn.apache.org/viewvc/incubator/shiro/trunk/core/src/main/java/org/apache/shiro/util/ThreadState.java?rev=942957&r1=942956&r2=942957&view=diff
==============================================================================
--- incubator/shiro/trunk/core/src/main/java/org/apache/shiro/util/ThreadState.java (original)
+++ incubator/shiro/trunk/core/src/main/java/org/apache/shiro/util/ThreadState.java Tue May 11 00:14:12 2010
@@ -1,3 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.shiro.util;
/**
Modified: incubator/shiro/trunk/src/docbkx/resources/xsl/fopdf.xsl
URL: http://svn.apache.org/viewvc/incubator/shiro/trunk/src/docbkx/resources/xsl/fopdf.xsl?rev=942957&r1=942956&r2=942957&view=diff
==============================================================================
--- incubator/shiro/trunk/src/docbkx/resources/xsl/fopdf.xsl (original)
+++ incubator/shiro/trunk/src/docbkx/resources/xsl/fopdf.xsl Tue May 11 00:14:12 2010
@@ -1,5 +1,4 @@
<?xml version="1.0"?>
-
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
Modified: incubator/shiro/trunk/support/aspectj/src/main/aspect/org/apache/shiro/aspectj/ShiroAnnotationAuthorizingAspect.java
URL: http://svn.apache.org/viewvc/incubator/shiro/trunk/support/aspectj/src/main/aspect/org/apache/shiro/aspectj/ShiroAnnotationAuthorizingAspect.java?rev=942957&r1=942956&r2=942957&view=diff
==============================================================================
--- incubator/shiro/trunk/support/aspectj/src/main/aspect/org/apache/shiro/aspectj/ShiroAnnotationAuthorizingAspect.java (original)
+++ incubator/shiro/trunk/support/aspectj/src/main/aspect/org/apache/shiro/aspectj/ShiroAnnotationAuthorizingAspect.java Tue May 11 00:14:12 2010
@@ -1,3 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.shiro.aspectj;
import org.aspectj.lang.JoinPoint;
@@ -7,28 +25,28 @@ import org.aspectj.lang.annotation.Point
/**
* Aspect that adds a before advice for each invocation of an annotated method.
- *
+ *
* @author J-C Desrochers
*/
@Aspect()
public class ShiroAnnotationAuthorizingAspect {
- private static final String pointCupExpression =
- "execution(@org.apache.shiro.authz.annotation.RequiresAuthentication * *(..)) || " +
- "execution(@org.apache.shiro.authz.annotation.RequiresGuest * *(..)) || " +
- "execution(@org.apache.shiro.authz.annotation.RequiresPermissions * *(..)) || " +
- "execution(@org.apache.shiro.authz.annotation.RequiresRoles * *(..)) || " +
- "execution(@org.apache.shiro.authz.annotation.RequiresUser * *(..))";
-
- @Pointcut(pointCupExpression)
- void anyShiroAnnotatedMethodCall(JoinPoint thisJoinPoint) {
- }
-
- private AspectjAnnotationsAuthorizingMethodInterceptor interceptor =
- new AspectjAnnotationsAuthorizingMethodInterceptor();
-
- @Before("anyShiroAnnotatedMethodCall(thisJoinPoint)")
- public void executeAnnotatedMethod(JoinPoint thisJoinPoint) throws Throwable {
- interceptor.performBeforeInterception(thisJoinPoint);
- }
+ private static final String pointCupExpression =
+ "execution(@org.apache.shiro.authz.annotation.RequiresAuthentication * *(..)) || " +
+ "execution(@org.apache.shiro.authz.annotation.RequiresGuest * *(..)) || " +
+ "execution(@org.apache.shiro.authz.annotation.RequiresPermissions * *(..)) || " +
+ "execution(@org.apache.shiro.authz.annotation.RequiresRoles * *(..)) || " +
+ "execution(@org.apache.shiro.authz.annotation.RequiresUser * *(..))";
+
+ @Pointcut(pointCupExpression)
+ void anyShiroAnnotatedMethodCall(JoinPoint thisJoinPoint) {
+ }
+
+ private AspectjAnnotationsAuthorizingMethodInterceptor interceptor =
+ new AspectjAnnotationsAuthorizingMethodInterceptor();
+
+ @Before("anyShiroAnnotatedMethodCall(thisJoinPoint)")
+ public void executeAnnotatedMethod(JoinPoint thisJoinPoint) throws Throwable {
+ interceptor.performBeforeInterception(thisJoinPoint);
+ }
}
Modified: incubator/shiro/trunk/support/aspectj/src/main/java/org/apache/shiro/aspectj/AspectjAnnotationsAuthorizingMethodInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/shiro/trunk/support/aspectj/src/main/java/org/apache/shiro/aspectj/AspectjAnnotationsAuthorizingMethodInterceptor.java?rev=942957&r1=942956&r2=942957&view=diff
==============================================================================
--- incubator/shiro/trunk/support/aspectj/src/main/java/org/apache/shiro/aspectj/AspectjAnnotationsAuthorizingMethodInterceptor.java (original)
+++ incubator/shiro/trunk/support/aspectj/src/main/java/org/apache/shiro/aspectj/AspectjAnnotationsAuthorizingMethodInterceptor.java Tue May 11 00:14:12 2010
@@ -1,7 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.shiro.aspectj;
-import java.util.Arrays;
-
import org.apache.shiro.aop.MethodInvocation;
import org.apache.shiro.authz.aop.AnnotationsAuthorizingMethodInterceptor;
import org.aspectj.lang.JoinPoint;
@@ -9,39 +25,41 @@ import org.aspectj.lang.reflect.MethodSi
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.util.Arrays;
+
/**
* Extends the annotations authorizing method interceptor class hierarchie to adapt
* an aspectj {@link JoinPoint} into a {@link MethodInvocation} amd to perform the
* authorization of method invocations.
- *
+ *
* @author J-C Desrochers
* @author Kalle Korhonen
* @since 1.0.0
*/
public class AspectjAnnotationsAuthorizingMethodInterceptor extends AnnotationsAuthorizingMethodInterceptor {
- /**
- * This class's private log instance.
- */
- private static final Logger log = LoggerFactory.getLogger(AspectjAnnotationsAuthorizingMethodInterceptor.class);
-
- /**
- * Performs the method interception of the before advice at the specified joint point.
- *
- * @param aJoinPoint The joint point to intercept.
- * @throws Throwable If an error occurs berforming the method invocation.
- */
- protected void performBeforeInterception(JoinPoint aJoinPoint) throws Throwable {
- if (log.isTraceEnabled()) log.trace( "#### Invoking a method decorated with a Shiro annotation" +
- "\n\tkind : " + aJoinPoint.getKind() +
- "\n\tjoinPoint : " + aJoinPoint +
- "\n\tannotations: " + Arrays.toString(((MethodSignature) aJoinPoint.getSignature()).getMethod().getAnnotations()) +
- "\n\ttarget : " + aJoinPoint.getTarget()
- );
-
- // 1. Adapt the join point into a method invocation
- BeforeAdviceMethodInvocationAdapter mi = BeforeAdviceMethodInvocationAdapter.createFrom(aJoinPoint);
-
- // 2. Delegate the authorization of the method call to the super class
- super.invoke(mi);
- }
+ /**
+ * This class's private log instance.
+ */
+ private static final Logger log = LoggerFactory.getLogger(AspectjAnnotationsAuthorizingMethodInterceptor.class);
+
+ /**
+ * Performs the method interception of the before advice at the specified joint point.
+ *
+ * @param aJoinPoint The joint point to intercept.
+ * @throws Throwable If an error occurs berforming the method invocation.
+ */
+ protected void performBeforeInterception(JoinPoint aJoinPoint) throws Throwable {
+ if (log.isTraceEnabled()) log.trace("#### Invoking a method decorated with a Shiro annotation" +
+ "\n\tkind : " + aJoinPoint.getKind() +
+ "\n\tjoinPoint : " + aJoinPoint +
+ "\n\tannotations: " + Arrays.toString(((MethodSignature) aJoinPoint.getSignature()).getMethod().getAnnotations()) +
+ "\n\ttarget : " + aJoinPoint.getTarget()
+ );
+
+ // 1. Adapt the join point into a method invocation
+ BeforeAdviceMethodInvocationAdapter mi = BeforeAdviceMethodInvocationAdapter.createFrom(aJoinPoint);
+
+ // 2. Delegate the authorization of the method call to the super class
+ super.invoke(mi);
+ }
}
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=942957&r1=942956&r2=942957&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 Tue May 11 00:14:12 2010
@@ -1,3 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.shiro.aspectj;
import org.apache.shiro.aop.MethodInvocation;
Modified: incubator/shiro/trunk/support/aspectj/src/main/java/org/apache/shiro/aspectj/package-info.java
URL: http://svn.apache.org/viewvc/incubator/shiro/trunk/support/aspectj/src/main/java/org/apache/shiro/aspectj/package-info.java?rev=942957&r1=942956&r2=942957&view=diff
==============================================================================
--- incubator/shiro/trunk/support/aspectj/src/main/java/org/apache/shiro/aspectj/package-info.java (original)
+++ incubator/shiro/trunk/support/aspectj/src/main/java/org/apache/shiro/aspectj/package-info.java Tue May 11 00:14:12 2010
@@ -1,4 +1,3 @@
-package org.apache.shiro.aspectj;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -21,3 +20,7 @@ package org.apache.shiro.aspectj;
* <a href="http://www.eclipse.org/aspectj/">AspectJ</a> support for enabling
* dynamic authorization using Shiro's annotations.
*/
+package org.apache.shiro.aspectj;
+
+
+
Modified: incubator/shiro/trunk/support/aspectj/src/test/java/org/apache/shiro/aspectj/DummyService.java
URL: http://svn.apache.org/viewvc/incubator/shiro/trunk/support/aspectj/src/test/java/org/apache/shiro/aspectj/DummyService.java?rev=942957&r1=942956&r2=942957&view=diff
==============================================================================
--- incubator/shiro/trunk/support/aspectj/src/test/java/org/apache/shiro/aspectj/DummyService.java (original)
+++ incubator/shiro/trunk/support/aspectj/src/test/java/org/apache/shiro/aspectj/DummyService.java Tue May 11 00:14:12 2010
@@ -1,22 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.shiro.aspectj;
/**
* Basic service for test purposes.
- *
+ *
* @author J-C Desrochers
*/
public interface DummyService {
- public void log(String aMessage);
-
- public void anonymous();
-
- public void guest();
-
- public void peek();
-
- public void retrieve();
-
- public void change();
+ public void log(String aMessage);
+
+ public void anonymous();
+
+ public void guest();
+
+ public void peek();
+
+ public void retrieve();
+
+ public void change();
}
Modified: incubator/shiro/trunk/support/aspectj/src/test/java/org/apache/shiro/aspectj/DummyServiceTest.java
URL: http://svn.apache.org/viewvc/incubator/shiro/trunk/support/aspectj/src/test/java/org/apache/shiro/aspectj/DummyServiceTest.java?rev=942957&r1=942956&r2=942957&view=diff
==============================================================================
--- incubator/shiro/trunk/support/aspectj/src/test/java/org/apache/shiro/aspectj/DummyServiceTest.java (original)
+++ incubator/shiro/trunk/support/aspectj/src/test/java/org/apache/shiro/aspectj/DummyServiceTest.java Tue May 11 00:14:12 2010
@@ -1,3 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.shiro.aspectj;
import org.apache.log4j.ConsoleAppender;
Modified: incubator/shiro/trunk/support/aspectj/src/test/java/org/apache/shiro/aspectj/RestrictedDummyService.java
URL: http://svn.apache.org/viewvc/incubator/shiro/trunk/support/aspectj/src/test/java/org/apache/shiro/aspectj/RestrictedDummyService.java?rev=942957&r1=942956&r2=942957&view=diff
==============================================================================
--- incubator/shiro/trunk/support/aspectj/src/test/java/org/apache/shiro/aspectj/RestrictedDummyService.java (original)
+++ incubator/shiro/trunk/support/aspectj/src/test/java/org/apache/shiro/aspectj/RestrictedDummyService.java Tue May 11 00:14:12 2010
@@ -1,19 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.shiro.aspectj;
import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
* Extends the secure dummy service and makes it some access more restrictive.
- *
+ *
* @author J-C Desrochers
*/
public class RestrictedDummyService extends SecuredDummyService {
- @RequiresPermissions("dummy:admin")
- public void retrieve() {
- log("retrieve *RESTRICTED*");
- super.retrieve();
- }
+ @RequiresPermissions("dummy:admin")
+ public void retrieve() {
+ log("retrieve *RESTRICTED*");
+ super.retrieve();
+ }
+
-
}
Modified: incubator/shiro/trunk/support/aspectj/src/test/java/org/apache/shiro/aspectj/SecuredDummyService.java
URL: http://svn.apache.org/viewvc/incubator/shiro/trunk/support/aspectj/src/test/java/org/apache/shiro/aspectj/SecuredDummyService.java?rev=942957&r1=942956&r2=942957&view=diff
==============================================================================
--- incubator/shiro/trunk/support/aspectj/src/test/java/org/apache/shiro/aspectj/SecuredDummyService.java (original)
+++ incubator/shiro/trunk/support/aspectj/src/test/java/org/apache/shiro/aspectj/SecuredDummyService.java Tue May 11 00:14:12 2010
@@ -1,51 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.shiro.aspectj;
-import java.sql.Timestamp;
-
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresUser;
+import java.sql.Timestamp;
+
/**
* Secured implementation of te dummy service that requires some permissions to execute.
- *
+ *
* @author J-C Desrochers
*/
public class SecuredDummyService implements DummyService {
- @RequiresAuthentication
- @RequiresPermissions("dummy:admin")
- public void change() {
- retrieve();
- log("change");
- peek();
- }
-
- public void anonymous() {
- log("anonymous");
- }
-
- @RequiresAuthentication
- public void guest() {
- log("guest");
- }
-
- @RequiresUser
- public void peek() {
- log("peek");
- }
-
- @RequiresPermissions("dummy:user")
- public void retrieve() {
- log("retrieve");
- }
-
- public void log(String aMessage) {
- if (aMessage != null) {
- System.out.println(new Timestamp(System.currentTimeMillis()).toString() + " [" + Thread.currentThread() + "] * LOG * " + aMessage);
- } else {
- System.out.println("\n\n");
+ @RequiresAuthentication
+ @RequiresPermissions("dummy:admin")
+ public void change() {
+ retrieve();
+ log("change");
+ peek();
+ }
+
+ public void anonymous() {
+ log("anonymous");
+ }
+
+ @RequiresAuthentication
+ public void guest() {
+ log("guest");
+ }
+
+ @RequiresUser
+ public void peek() {
+ log("peek");
+ }
+
+ @RequiresPermissions("dummy:user")
+ public void retrieve() {
+ log("retrieve");
+ }
+
+ public void log(String aMessage) {
+ if (aMessage != null) {
+ System.out.println(new Timestamp(System.currentTimeMillis()).toString() + " [" + Thread.currentThread() + "] * LOG * " + aMessage);
+ } else {
+ System.out.println("\n\n");
+ }
}
- }
}
Modified: incubator/shiro/trunk/support/aspectj/src/test/resources/META-INF/aop.xml
URL: http://svn.apache.org/viewvc/incubator/shiro/trunk/support/aspectj/src/test/resources/META-INF/aop.xml?rev=942957&r1=942956&r2=942957&view=diff
==============================================================================
--- incubator/shiro/trunk/support/aspectj/src/test/resources/META-INF/aop.xml (original)
+++ incubator/shiro/trunk/support/aspectj/src/test/resources/META-INF/aop.xml Tue May 11 00:14:12 2010
@@ -1,10 +1,28 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
<aspectj>
- <aspects>
- <aspect name="org.apache.shiro.aspectj.ShiroAnnotationAuthorizingAspect"/>
- </aspects>
+ <aspects>
+ <aspect name="org.apache.shiro.aspectj.ShiroAnnotationAuthorizingAspect"/>
+ </aspects>
- <weaver options="-verbose">
- <include within="org.apache.shiro.aspectj.*"/>
- </weaver>
+ <weaver options="-verbose">
+ <include within="org.apache.shiro.aspectj.*"/>
+ </weaver>
</aspectj>
Modified: incubator/shiro/trunk/support/spring/src/test/java/org/apache/shiro/spring/remoting/SecureRemoteInvocationFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/shiro/trunk/support/spring/src/test/java/org/apache/shiro/spring/remoting/SecureRemoteInvocationFactoryTest.java?rev=942957&r1=942956&r2=942957&view=diff
==============================================================================
--- incubator/shiro/trunk/support/spring/src/test/java/org/apache/shiro/spring/remoting/SecureRemoteInvocationFactoryTest.java (original)
+++ incubator/shiro/trunk/support/spring/src/test/java/org/apache/shiro/spring/remoting/SecureRemoteInvocationFactoryTest.java Tue May 11 00:14:12 2010
@@ -1,3 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package org.apache.shiro.spring.remoting;
import org.aopalliance.intercept.MethodInvocation;