You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shiro.apache.org by ad...@apache.org on 2010/05/26 20:34:49 UTC
svn commit: r948527 [3/38] - in /incubator/shiro: branches/shiro-root-1.0.x/
branches/shiro-root-1.0.x/all/
branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/
branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/aop/
branches/shiro...
Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/authz/aop/PermissionAnnotationMethodInterceptor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/authz/aop/RoleAnnotationHandler.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/authz/aop/RoleAnnotationMethodInterceptor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/authz/aop/UserAnnotationHandler.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/authz/aop/UserAnnotationMethodInterceptor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/authz/aop/package-info.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/authz/package-info.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/authz/permission/AllPermission.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/authz/permission/DomainPermission.java
URL: http://svn.apache.org/viewvc/incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/authz/permission/DomainPermission.java?rev=948527&r1=948526&r2=948527&view=diff
==============================================================================
--- incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/authz/permission/DomainPermission.java (original)
+++ incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/authz/permission/DomainPermission.java Wed May 26 18:34:28 2010
@@ -1,105 +1,105 @@
-/*
- * 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;
-
-/**
- * Provides a base Permission class from which type-safe/domain-specific subclasses may extend. Can be used
- * as a base class for JPA/Hibernate persisted permissions that wish to store the parts of the permission string
- * in separate columns (e.g. 'domain', 'actions' and 'targets' columns), which can be used in querying
- * strategies.
- *
- * @author Les Hazlewood
- * @since 1.0
- */
-public abstract class DomainPermission extends WildcardPermission {
-
- private String domain;
- private String actions;
- private String targets;
-
- /**
- * Creates a domain permission with *all* actions for *all* targets;
- */
- public DomainPermission() {
- setParts(getDomain(getClass()), null, null);
- }
-
- public DomainPermission(String actions) {
- setParts(getDomain(getClass()), actions, null);
- }
-
- public DomainPermission(String actions, String targets) {
- setParts(getDomain(getClass()), actions, targets);
- }
-
- protected void setParts(String domain, String actions, String targets) {
- if (!StringUtils.hasText(domain)) {
- throw new IllegalArgumentException("domain argument cannot be null or empty.");
- }
- StringBuilder sb = new StringBuilder(domain);
-
- if (!StringUtils.hasText(actions)) {
- if (StringUtils.hasText(targets)) {
- sb.append(PART_DIVIDER_TOKEN).append(WILDCARD_TOKEN);
- }
- } else {
- sb.append(PART_DIVIDER_TOKEN).append(actions);
- }
- if (targets != null) {
- sb.append(PART_DIVIDER_TOKEN).append(targets);
- }
- setParts(sb.toString());
- }
-
- protected String getDomain(Class<? extends DomainPermission> clazz) {
- String domain = clazz.getSimpleName().toLowerCase();
- //strip any trailing 'permission' text from the name (as all subclasses should have been named):
- int index = domain.lastIndexOf("permission");
- if (index != -1) {
- domain = domain.substring(0, index);
- }
- return domain;
- }
-
- public String getDomain() {
- return domain;
- }
-
- protected void setDomain(String domain) {
- this.domain = domain;
- }
-
- public String getActions() {
- return actions;
- }
-
- protected void setActions(String actions) {
- this.actions = actions;
- }
-
- public String getTargets() {
- return targets;
- }
-
- protected void setTargets(String targets) {
- this.targets = targets;
- }
-}
+/*
+ * 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;
+
+/**
+ * Provides a base Permission class from which type-safe/domain-specific subclasses may extend. Can be used
+ * as a base class for JPA/Hibernate persisted permissions that wish to store the parts of the permission string
+ * in separate columns (e.g. 'domain', 'actions' and 'targets' columns), which can be used in querying
+ * strategies.
+ *
+ * @author Les Hazlewood
+ * @since 1.0
+ */
+public abstract class DomainPermission extends WildcardPermission {
+
+ private String domain;
+ private String actions;
+ private String targets;
+
+ /**
+ * Creates a domain permission with *all* actions for *all* targets;
+ */
+ public DomainPermission() {
+ setParts(getDomain(getClass()), null, null);
+ }
+
+ public DomainPermission(String actions) {
+ setParts(getDomain(getClass()), actions, null);
+ }
+
+ public DomainPermission(String actions, String targets) {
+ setParts(getDomain(getClass()), actions, targets);
+ }
+
+ protected void setParts(String domain, String actions, String targets) {
+ if (!StringUtils.hasText(domain)) {
+ throw new IllegalArgumentException("domain argument cannot be null or empty.");
+ }
+ StringBuilder sb = new StringBuilder(domain);
+
+ if (!StringUtils.hasText(actions)) {
+ if (StringUtils.hasText(targets)) {
+ sb.append(PART_DIVIDER_TOKEN).append(WILDCARD_TOKEN);
+ }
+ } else {
+ sb.append(PART_DIVIDER_TOKEN).append(actions);
+ }
+ if (targets != null) {
+ sb.append(PART_DIVIDER_TOKEN).append(targets);
+ }
+ setParts(sb.toString());
+ }
+
+ protected String getDomain(Class<? extends DomainPermission> clazz) {
+ String domain = clazz.getSimpleName().toLowerCase();
+ //strip any trailing 'permission' text from the name (as all subclasses should have been named):
+ int index = domain.lastIndexOf("permission");
+ if (index != -1) {
+ domain = domain.substring(0, index);
+ }
+ return domain;
+ }
+
+ public String getDomain() {
+ return domain;
+ }
+
+ protected void setDomain(String domain) {
+ this.domain = domain;
+ }
+
+ public String getActions() {
+ return actions;
+ }
+
+ protected void setActions(String actions) {
+ this.actions = actions;
+ }
+
+ public String getTargets() {
+ return targets;
+ }
+
+ protected void setTargets(String targets) {
+ this.targets = targets;
+ }
+}
Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/authz/permission/DomainPermission.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/authz/permission/InvalidPermissionStringException.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/authz/permission/PermissionResolver.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/authz/permission/PermissionResolverAware.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/authz/permission/RolePermissionResolver.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/authz/permission/RolePermissionResolverAware.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/authz/permission/WildcardPermission.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/authz/permission/WildcardPermissionResolver.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/authz/permission/package-info.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/cache/AbstractCacheManager.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/cache/Cache.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/cache/CacheException.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/cache/CacheManager.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/cache/CacheManagerAware.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/cache/MapCache.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/cache/MemoryConstrainedCacheManager.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/cache/package-info.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/codec/Base64.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/codec/CodecException.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/codec/CodecSupport.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/codec/Hex.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/codec/package-info.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/concurrent/SubjectAwareExecutor.java
URL: http://svn.apache.org/viewvc/incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/concurrent/SubjectAwareExecutor.java?rev=948527&r1=948526&r2=948527&view=diff
==============================================================================
--- incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/concurrent/SubjectAwareExecutor.java (original)
+++ incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/concurrent/SubjectAwareExecutor.java Wed May 26 18:34:28 2010
@@ -1,131 +1,131 @@
-/*
- * 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.concurrent;
-
-import org.apache.shiro.SecurityUtils;
-import org.apache.shiro.subject.Subject;
-
-import java.util.concurrent.Executor;
-
-/**
- * {@code Executor} implementation that will automatically first associate any argument
- * {@link Runnable} instances with the currently available {@link Subject} and then
- * dispatch the Subject-enabled runnable to an underlying delegate {@link Executor}
- * instance.
- * <p/>
- * This is a simplification for applications that want to execute code as the currently
- * executing {@code Subject} on another thread, but don't want or need to call the
- * {@link Subject#associateWith(Runnable)} method and dispatch to a Thread manually. This
- * simplifies code and reduces Shiro dependencies across application source code.
- * <p/>
- * Consider this code that could be repeated in many places across an application:
- * <pre>
- * {@link Runnable Runnable} applicationWork = //instantiate or acquire Runnable from somewhere
- * {@link Subject Subject} subject = {@link SecurityUtils SecurityUtils}.{@link SecurityUtils#getSubject() getSubject()};
- * {@link Runnable Runnable} work = subject.{@link Subject#associateWith(Runnable) associateWith(applicationWork)};
- * {@link Executor anExecutor}.{@link Executor#execute(Runnable) execute(work)};
- * </pre>
- * Instead, if the {@code Executor} instance used in application code is an instance of this class (which delegates
- * to the target Executor that you want), all places in code like the above reduce to this:
- * <pre>
- * {@link Runnable Runnable} applicationWork = //instantiate or acquire Runnable from somewhere
- * {@link Executor anExecutor}.{@link Executor#execute(Runnable) execute(work)};
- * </pre>
- * Notice there is no use of the Shiro API in the 2nd code block, encouraging the principle of loose coupling across
- * your codebase.
- *
- * @see SubjectAwareExecutorService
- * @since 1.0
- */
-public class SubjectAwareExecutor implements Executor {
-
- /**
- * The target Executor instance that will actually execute the subject-associated Runnable instances.
- */
- private Executor targetExecutor;
-
- public SubjectAwareExecutor() {
- }
-
- public SubjectAwareExecutor(Executor targetExecutor) {
- if (targetExecutor == null) {
- throw new NullPointerException("target Executor instance cannot be null.");
- }
- this.targetExecutor = targetExecutor;
- }
-
- /**
- * Returns the target Executor instance that will actually execute the subject-associated Runnable instances.
- *
- * @return target Executor instance that will actually execute the subject-associated Runnable instances.
- */
- public Executor getTargetExecutor() {
- return targetExecutor;
- }
-
- /**
- * Sets target Executor instance that will actually execute the subject-associated Runnable instances.
- *
- * @param targetExecutor the target Executor instance that will actually execute the subject-associated Runnable
- * instances.
- */
- public void setTargetExecutor(Executor targetExecutor) {
- this.targetExecutor = targetExecutor;
- }
-
- /**
- * Returns the currently Subject instance that should be associated with Runnable or Callable instances before
- * being dispatched to the target {@code Executor} instance. This implementation merely defaults to returning
- * {@code SecurityUtils}.{@link SecurityUtils#getSubject() getSubject()}.
- *
- * @return the currently Subject instance that should be associated with Runnable or Callable instances before
- * being dispatched to the target {@code Executor} instance.
- */
- protected Subject getSubject() {
- return SecurityUtils.getSubject();
- }
-
- /**
- * Utility method for subclasses to associate the argument {@code Runnable} with the currently executing subject
- * and then return the associated Runnable. The default implementation merely defaults to
- * <pre>
- * Subject subject = {@link #getSubject() getSubject()};
- * return subject.{@link Subject#associateWith(Runnable) associateWith(r)};
- * </pre>
- *
- * @param r the argument runnable to be associated with the current subject
- * @return the associated runnable instance reflecting the current subject
- */
- protected Runnable associateWithSubject(Runnable r) {
- Subject subject = getSubject();
- return subject.associateWith(r);
- }
-
- /**
- * Executes the specified runnable by first associating it with the currently executing {@code Subject} and then
- * dispatches the associated Runnable to the underlying target {@link Executor} instance.
- *
- * @param command the runnable to associate with the currently executing subject and then to execute via the target
- * {@code Executor} instance.
- */
- public void execute(Runnable command) {
- Runnable associated = associateWithSubject(command);
- getTargetExecutor().execute(associated);
- }
-}
+/*
+ * 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.concurrent;
+
+import org.apache.shiro.SecurityUtils;
+import org.apache.shiro.subject.Subject;
+
+import java.util.concurrent.Executor;
+
+/**
+ * {@code Executor} implementation that will automatically first associate any argument
+ * {@link Runnable} instances with the currently available {@link Subject} and then
+ * dispatch the Subject-enabled runnable to an underlying delegate {@link Executor}
+ * instance.
+ * <p/>
+ * This is a simplification for applications that want to execute code as the currently
+ * executing {@code Subject} on another thread, but don't want or need to call the
+ * {@link Subject#associateWith(Runnable)} method and dispatch to a Thread manually. This
+ * simplifies code and reduces Shiro dependencies across application source code.
+ * <p/>
+ * Consider this code that could be repeated in many places across an application:
+ * <pre>
+ * {@link Runnable Runnable} applicationWork = //instantiate or acquire Runnable from somewhere
+ * {@link Subject Subject} subject = {@link SecurityUtils SecurityUtils}.{@link SecurityUtils#getSubject() getSubject()};
+ * {@link Runnable Runnable} work = subject.{@link Subject#associateWith(Runnable) associateWith(applicationWork)};
+ * {@link Executor anExecutor}.{@link Executor#execute(Runnable) execute(work)};
+ * </pre>
+ * Instead, if the {@code Executor} instance used in application code is an instance of this class (which delegates
+ * to the target Executor that you want), all places in code like the above reduce to this:
+ * <pre>
+ * {@link Runnable Runnable} applicationWork = //instantiate or acquire Runnable from somewhere
+ * {@link Executor anExecutor}.{@link Executor#execute(Runnable) execute(work)};
+ * </pre>
+ * Notice there is no use of the Shiro API in the 2nd code block, encouraging the principle of loose coupling across
+ * your codebase.
+ *
+ * @see SubjectAwareExecutorService
+ * @since 1.0
+ */
+public class SubjectAwareExecutor implements Executor {
+
+ /**
+ * The target Executor instance that will actually execute the subject-associated Runnable instances.
+ */
+ private Executor targetExecutor;
+
+ public SubjectAwareExecutor() {
+ }
+
+ public SubjectAwareExecutor(Executor targetExecutor) {
+ if (targetExecutor == null) {
+ throw new NullPointerException("target Executor instance cannot be null.");
+ }
+ this.targetExecutor = targetExecutor;
+ }
+
+ /**
+ * Returns the target Executor instance that will actually execute the subject-associated Runnable instances.
+ *
+ * @return target Executor instance that will actually execute the subject-associated Runnable instances.
+ */
+ public Executor getTargetExecutor() {
+ return targetExecutor;
+ }
+
+ /**
+ * Sets target Executor instance that will actually execute the subject-associated Runnable instances.
+ *
+ * @param targetExecutor the target Executor instance that will actually execute the subject-associated Runnable
+ * instances.
+ */
+ public void setTargetExecutor(Executor targetExecutor) {
+ this.targetExecutor = targetExecutor;
+ }
+
+ /**
+ * Returns the currently Subject instance that should be associated with Runnable or Callable instances before
+ * being dispatched to the target {@code Executor} instance. This implementation merely defaults to returning
+ * {@code SecurityUtils}.{@link SecurityUtils#getSubject() getSubject()}.
+ *
+ * @return the currently Subject instance that should be associated with Runnable or Callable instances before
+ * being dispatched to the target {@code Executor} instance.
+ */
+ protected Subject getSubject() {
+ return SecurityUtils.getSubject();
+ }
+
+ /**
+ * Utility method for subclasses to associate the argument {@code Runnable} with the currently executing subject
+ * and then return the associated Runnable. The default implementation merely defaults to
+ * <pre>
+ * Subject subject = {@link #getSubject() getSubject()};
+ * return subject.{@link Subject#associateWith(Runnable) associateWith(r)};
+ * </pre>
+ *
+ * @param r the argument runnable to be associated with the current subject
+ * @return the associated runnable instance reflecting the current subject
+ */
+ protected Runnable associateWithSubject(Runnable r) {
+ Subject subject = getSubject();
+ return subject.associateWith(r);
+ }
+
+ /**
+ * Executes the specified runnable by first associating it with the currently executing {@code Subject} and then
+ * dispatches the associated Runnable to the underlying target {@link Executor} instance.
+ *
+ * @param command the runnable to associate with the currently executing subject and then to execute via the target
+ * {@code Executor} instance.
+ */
+ public void execute(Runnable command) {
+ Runnable associated = associateWithSubject(command);
+ getTargetExecutor().execute(associated);
+ }
+}
Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/concurrent/SubjectAwareExecutor.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/concurrent/SubjectAwareExecutorService.java
URL: http://svn.apache.org/viewvc/incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/concurrent/SubjectAwareExecutorService.java?rev=948527&r1=948526&r2=948527&view=diff
==============================================================================
--- incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/concurrent/SubjectAwareExecutorService.java (original)
+++ incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/concurrent/SubjectAwareExecutorService.java Wed May 26 18:34:28 2010
@@ -1,158 +1,158 @@
-/*
- * 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.concurrent;
-
-import org.apache.shiro.subject.Subject;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.concurrent.*;
-
-/**
- * {@code ExecutorService} implementation that will automatically first associate any argument
- * {@link Runnable} or {@link Callable} instances with the {@link #getSubject currently available subject} and then
- * dispatch the Subject-enabled runnable or callable to an underlying delegate
- * {@link java.util.concurrent.ExecutorService ExecutorService} instance. The principle is the same as the
- * parent {@link SubjectAwareExecutor} class, but enables the richer {@link ExecutorService} API.
- * <p/>
- * This is a simplification for applications that want to execute code as the currently
- * executing {@code Subject} on another thread, but don't want or need to call the
- * {@link Subject#associateWith(Runnable)} or {@link Subject#associateWith(Callable)} methods and dispatch them to a
- * Thread manually. This simplifies code and reduces Shiro dependencies across application source code.
- * <p/>
- * Consider this code that could be repeated in many places across an application:
- * <pre>
- * {@link Callable Callable} applicationWork = //instantiate or acquire Callable from somewhere
- * {@link Subject Subject} subject = {@link org.apache.shiro.SecurityUtils SecurityUtils}.{@link org.apache.shiro.SecurityUtils#getSubject() getSubject()};
- * {@link Callable Callable} work = subject.{@link Subject#associateWith(Callable) associateWith(applicationWork)};
- * {@link ExecutorService anExecutorService}.{@link ExecutorService#submit(Callable) submit(work)};
- * </pre>
- * Instead, if the {@code ExecutorService} instance used at runtime is an instance of this class
- * (which delegates to the target ExecutorService that you want), all places in code like the above reduce to this:
- * <pre>
- * {@link Callable Callable} applicationWork = //instantiate or acquire Callable from somewhere
- * {@link ExecutorService anExecutorService}.{@link ExecutorService#submit(Callable) submit(work)};
- * </pre>
- * Notice there is no use of the Shiro API in the 2nd code block, encouraging the principle of loose coupling across
- * your codebase.
- *
- * @since 1.0
- */
-public class SubjectAwareExecutorService extends SubjectAwareExecutor implements ExecutorService {
-
- private ExecutorService targetExecutorService;
-
- public SubjectAwareExecutorService() {
- }
-
- public SubjectAwareExecutorService(ExecutorService target) {
- setTargetExecutorService(target);
- }
-
- public ExecutorService getTargetExecutorService() {
- return targetExecutorService;
- }
-
- public void setTargetExecutorService(ExecutorService targetExecutorService) {
- super.setTargetExecutor(targetExecutorService);
- this.targetExecutorService = targetExecutorService;
- }
-
- @Override
- public void setTargetExecutor(Executor targetExecutor) {
- if (!(targetExecutor instanceof ExecutorService)) {
- String msg = "The " + getClass().getName() + " implementation only accepts " +
- ExecutorService.class.getName() + " target instances.";
- throw new IllegalArgumentException(msg);
- }
- super.setTargetExecutor(targetExecutor);
- }
-
- public void shutdown() {
- this.targetExecutorService.shutdown();
- }
-
- public List<Runnable> shutdownNow() {
- return this.targetExecutorService.shutdownNow();
- }
-
- public boolean isShutdown() {
- return this.targetExecutorService.isShutdown();
- }
-
- public boolean isTerminated() {
- return this.targetExecutorService.isTerminated();
- }
-
- public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException {
- return this.targetExecutorService.awaitTermination(timeout, unit);
- }
-
- protected <T> Callable<T> associateWithSubject(Callable<T> task) {
- Subject subject = getSubject();
- return subject.associateWith(task);
- }
-
- public <T> Future<T> submit(Callable<T> task) {
- Callable<T> work = associateWithSubject(task);
- return this.targetExecutorService.submit(work);
- }
-
- public <T> Future<T> submit(Runnable task, T result) {
- Runnable work = associateWithSubject(task);
- return this.targetExecutorService.submit(work, result);
- }
-
- public Future<?> submit(Runnable task) {
- Runnable work = associateWithSubject(task);
- return this.targetExecutorService.submit(work);
- }
-
- protected <T> Collection<Callable<T>> associateWithSubject(Collection<? extends Callable<T>> tasks) {
- Collection<Callable<T>> workItems = new ArrayList<Callable<T>>(tasks.size());
- for (Callable<T> task : tasks) {
- Callable<T> work = associateWithSubject(task);
- workItems.add(work);
- }
- return workItems;
- }
-
- public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) throws InterruptedException {
- Collection<Callable<T>> workItems = associateWithSubject(tasks);
- return this.targetExecutorService.invokeAll(workItems);
- }
-
- public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)
- throws InterruptedException {
- Collection<Callable<T>> workItems = associateWithSubject(tasks);
- return this.targetExecutorService.invokeAll(workItems, timeout, unit);
- }
-
- public <T> T invokeAny(Collection<? extends Callable<T>> tasks) throws InterruptedException, ExecutionException {
- Collection<Callable<T>> workItems = associateWithSubject(tasks);
- return this.targetExecutorService.invokeAny(workItems);
- }
-
- public <T> T invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)
- throws InterruptedException, ExecutionException, TimeoutException {
- Collection<Callable<T>> workItems = associateWithSubject(tasks);
- return this.targetExecutorService.invokeAny(workItems, timeout, unit);
- }
-}
+/*
+ * 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.concurrent;
+
+import org.apache.shiro.subject.Subject;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.concurrent.*;
+
+/**
+ * {@code ExecutorService} implementation that will automatically first associate any argument
+ * {@link Runnable} or {@link Callable} instances with the {@link #getSubject currently available subject} and then
+ * dispatch the Subject-enabled runnable or callable to an underlying delegate
+ * {@link java.util.concurrent.ExecutorService ExecutorService} instance. The principle is the same as the
+ * parent {@link SubjectAwareExecutor} class, but enables the richer {@link ExecutorService} API.
+ * <p/>
+ * This is a simplification for applications that want to execute code as the currently
+ * executing {@code Subject} on another thread, but don't want or need to call the
+ * {@link Subject#associateWith(Runnable)} or {@link Subject#associateWith(Callable)} methods and dispatch them to a
+ * Thread manually. This simplifies code and reduces Shiro dependencies across application source code.
+ * <p/>
+ * Consider this code that could be repeated in many places across an application:
+ * <pre>
+ * {@link Callable Callable} applicationWork = //instantiate or acquire Callable from somewhere
+ * {@link Subject Subject} subject = {@link org.apache.shiro.SecurityUtils SecurityUtils}.{@link org.apache.shiro.SecurityUtils#getSubject() getSubject()};
+ * {@link Callable Callable} work = subject.{@link Subject#associateWith(Callable) associateWith(applicationWork)};
+ * {@link ExecutorService anExecutorService}.{@link ExecutorService#submit(Callable) submit(work)};
+ * </pre>
+ * Instead, if the {@code ExecutorService} instance used at runtime is an instance of this class
+ * (which delegates to the target ExecutorService that you want), all places in code like the above reduce to this:
+ * <pre>
+ * {@link Callable Callable} applicationWork = //instantiate or acquire Callable from somewhere
+ * {@link ExecutorService anExecutorService}.{@link ExecutorService#submit(Callable) submit(work)};
+ * </pre>
+ * Notice there is no use of the Shiro API in the 2nd code block, encouraging the principle of loose coupling across
+ * your codebase.
+ *
+ * @since 1.0
+ */
+public class SubjectAwareExecutorService extends SubjectAwareExecutor implements ExecutorService {
+
+ private ExecutorService targetExecutorService;
+
+ public SubjectAwareExecutorService() {
+ }
+
+ public SubjectAwareExecutorService(ExecutorService target) {
+ setTargetExecutorService(target);
+ }
+
+ public ExecutorService getTargetExecutorService() {
+ return targetExecutorService;
+ }
+
+ public void setTargetExecutorService(ExecutorService targetExecutorService) {
+ super.setTargetExecutor(targetExecutorService);
+ this.targetExecutorService = targetExecutorService;
+ }
+
+ @Override
+ public void setTargetExecutor(Executor targetExecutor) {
+ if (!(targetExecutor instanceof ExecutorService)) {
+ String msg = "The " + getClass().getName() + " implementation only accepts " +
+ ExecutorService.class.getName() + " target instances.";
+ throw new IllegalArgumentException(msg);
+ }
+ super.setTargetExecutor(targetExecutor);
+ }
+
+ public void shutdown() {
+ this.targetExecutorService.shutdown();
+ }
+
+ public List<Runnable> shutdownNow() {
+ return this.targetExecutorService.shutdownNow();
+ }
+
+ public boolean isShutdown() {
+ return this.targetExecutorService.isShutdown();
+ }
+
+ public boolean isTerminated() {
+ return this.targetExecutorService.isTerminated();
+ }
+
+ public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException {
+ return this.targetExecutorService.awaitTermination(timeout, unit);
+ }
+
+ protected <T> Callable<T> associateWithSubject(Callable<T> task) {
+ Subject subject = getSubject();
+ return subject.associateWith(task);
+ }
+
+ public <T> Future<T> submit(Callable<T> task) {
+ Callable<T> work = associateWithSubject(task);
+ return this.targetExecutorService.submit(work);
+ }
+
+ public <T> Future<T> submit(Runnable task, T result) {
+ Runnable work = associateWithSubject(task);
+ return this.targetExecutorService.submit(work, result);
+ }
+
+ public Future<?> submit(Runnable task) {
+ Runnable work = associateWithSubject(task);
+ return this.targetExecutorService.submit(work);
+ }
+
+ protected <T> Collection<Callable<T>> associateWithSubject(Collection<? extends Callable<T>> tasks) {
+ Collection<Callable<T>> workItems = new ArrayList<Callable<T>>(tasks.size());
+ for (Callable<T> task : tasks) {
+ Callable<T> work = associateWithSubject(task);
+ workItems.add(work);
+ }
+ return workItems;
+ }
+
+ public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) throws InterruptedException {
+ Collection<Callable<T>> workItems = associateWithSubject(tasks);
+ return this.targetExecutorService.invokeAll(workItems);
+ }
+
+ public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)
+ throws InterruptedException {
+ Collection<Callable<T>> workItems = associateWithSubject(tasks);
+ return this.targetExecutorService.invokeAll(workItems, timeout, unit);
+ }
+
+ public <T> T invokeAny(Collection<? extends Callable<T>> tasks) throws InterruptedException, ExecutionException {
+ Collection<Callable<T>> workItems = associateWithSubject(tasks);
+ return this.targetExecutorService.invokeAny(workItems);
+ }
+
+ public <T> T invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)
+ throws InterruptedException, ExecutionException, TimeoutException {
+ Collection<Callable<T>> workItems = associateWithSubject(tasks);
+ return this.targetExecutorService.invokeAny(workItems, timeout, unit);
+ }
+}
Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/concurrent/SubjectAwareExecutorService.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/concurrent/SubjectAwareScheduledExecutorService.java
URL: http://svn.apache.org/viewvc/incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/concurrent/SubjectAwareScheduledExecutorService.java?rev=948527&r1=948526&r2=948527&view=diff
==============================================================================
--- incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/concurrent/SubjectAwareScheduledExecutorService.java (original)
+++ incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/concurrent/SubjectAwareScheduledExecutorService.java Wed May 26 18:34:28 2010
@@ -1,86 +1,86 @@
-/*
- * 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.concurrent;
-
-import java.util.concurrent.*;
-
-/**
- * Same concept as the {@link SubjectAwareExecutorService} but additionally supports the
- * {@link ScheduledExecutorService} interface.
- */
-public class SubjectAwareScheduledExecutorService extends SubjectAwareExecutorService implements ScheduledExecutorService {
-
- private ScheduledExecutorService targetScheduledExecutorService;
-
- public SubjectAwareScheduledExecutorService() {
- }
-
- public SubjectAwareScheduledExecutorService(ScheduledExecutorService target) {
- setTargetScheduledExecutorService(target);
- }
-
- public ScheduledExecutorService getTargetScheduledExecutorService() {
- return targetScheduledExecutorService;
- }
-
- public void setTargetScheduledExecutorService(ScheduledExecutorService targetScheduledExecutorService) {
- super.setTargetExecutorService(targetScheduledExecutorService);
- this.targetScheduledExecutorService = targetScheduledExecutorService;
- }
-
- @Override
- public void setTargetExecutor(Executor targetExecutor) {
- if (!(targetExecutor instanceof ScheduledExecutorService)) {
- String msg = "The " + getClass().getName() + " implementation only accepts " +
- ScheduledExecutorService.class.getName() + " target instances.";
- throw new IllegalArgumentException(msg);
- }
- super.setTargetExecutorService((ScheduledExecutorService) targetExecutor);
- }
-
- @Override
- public void setTargetExecutorService(ExecutorService targetExecutorService) {
- if (!(targetExecutorService instanceof ScheduledExecutorService)) {
- String msg = "The " + getClass().getName() + " implementation only accepts " +
- ScheduledExecutorService.class.getName() + " target instances.";
- throw new IllegalArgumentException(msg);
- }
- super.setTargetExecutorService(targetExecutorService);
- }
-
- public ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit) {
- Runnable work = associateWithSubject(command);
- return this.targetScheduledExecutorService.schedule(work, delay, unit);
- }
-
- public <V> ScheduledFuture<V> schedule(Callable<V> callable, long delay, TimeUnit unit) {
- Callable<V> work = associateWithSubject(callable);
- return this.targetScheduledExecutorService.schedule(work, delay, unit);
- }
-
- public ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) {
- Runnable work = associateWithSubject(command);
- return this.targetScheduledExecutorService.scheduleAtFixedRate(work, initialDelay, period, unit);
- }
-
- public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) {
- Runnable work = associateWithSubject(command);
- return this.targetScheduledExecutorService.scheduleWithFixedDelay(work, initialDelay, delay, unit);
- }
-}
+/*
+ * 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.concurrent;
+
+import java.util.concurrent.*;
+
+/**
+ * Same concept as the {@link SubjectAwareExecutorService} but additionally supports the
+ * {@link ScheduledExecutorService} interface.
+ */
+public class SubjectAwareScheduledExecutorService extends SubjectAwareExecutorService implements ScheduledExecutorService {
+
+ private ScheduledExecutorService targetScheduledExecutorService;
+
+ public SubjectAwareScheduledExecutorService() {
+ }
+
+ public SubjectAwareScheduledExecutorService(ScheduledExecutorService target) {
+ setTargetScheduledExecutorService(target);
+ }
+
+ public ScheduledExecutorService getTargetScheduledExecutorService() {
+ return targetScheduledExecutorService;
+ }
+
+ public void setTargetScheduledExecutorService(ScheduledExecutorService targetScheduledExecutorService) {
+ super.setTargetExecutorService(targetScheduledExecutorService);
+ this.targetScheduledExecutorService = targetScheduledExecutorService;
+ }
+
+ @Override
+ public void setTargetExecutor(Executor targetExecutor) {
+ if (!(targetExecutor instanceof ScheduledExecutorService)) {
+ String msg = "The " + getClass().getName() + " implementation only accepts " +
+ ScheduledExecutorService.class.getName() + " target instances.";
+ throw new IllegalArgumentException(msg);
+ }
+ super.setTargetExecutorService((ScheduledExecutorService) targetExecutor);
+ }
+
+ @Override
+ public void setTargetExecutorService(ExecutorService targetExecutorService) {
+ if (!(targetExecutorService instanceof ScheduledExecutorService)) {
+ String msg = "The " + getClass().getName() + " implementation only accepts " +
+ ScheduledExecutorService.class.getName() + " target instances.";
+ throw new IllegalArgumentException(msg);
+ }
+ super.setTargetExecutorService(targetExecutorService);
+ }
+
+ public ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit) {
+ Runnable work = associateWithSubject(command);
+ return this.targetScheduledExecutorService.schedule(work, delay, unit);
+ }
+
+ public <V> ScheduledFuture<V> schedule(Callable<V> callable, long delay, TimeUnit unit) {
+ Callable<V> work = associateWithSubject(callable);
+ return this.targetScheduledExecutorService.schedule(work, delay, unit);
+ }
+
+ public ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) {
+ Runnable work = associateWithSubject(command);
+ return this.targetScheduledExecutorService.scheduleAtFixedRate(work, initialDelay, period, unit);
+ }
+
+ public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) {
+ Runnable work = associateWithSubject(command);
+ return this.targetScheduledExecutorService.scheduleWithFixedDelay(work, initialDelay, delay, unit);
+ }
+}
Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/concurrent/SubjectAwareScheduledExecutorService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/concurrent/package-info.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/config/ConfigurationException.java
URL: http://svn.apache.org/viewvc/incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/config/ConfigurationException.java?rev=948527&r1=948526&r2=948527&view=diff
==============================================================================
--- incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/config/ConfigurationException.java (original)
+++ incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/config/ConfigurationException.java Wed May 26 18:34:28 2010
@@ -1,67 +1,67 @@
-/*
- * 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.config;
-
-import org.apache.shiro.ShiroException;
-
-
-/**
- * Root exception indicating there was a problem parsing or processing the Shiro configuration.
- *
- * @author Les Hazlewood
- * @since 0.9
- */
-public class ConfigurationException extends ShiroException
-{
-
- /**
- * Creates a new ConfigurationException.
- */
- public ConfigurationException() {
- super();
- }
-
- /**
- * Constructs a new ConfigurationException.
- *
- * @param message the reason for the exception
- */
- public ConfigurationException(String message) {
- super(message);
- }
-
- /**
- * Constructs a new ConfigurationException.
- *
- * @param cause the underlying Throwable that caused this exception to be thrown.
- */
- public ConfigurationException(Throwable cause) {
- super(cause);
- }
-
- /**
- * Constructs a new ConfigurationException.
- *
- * @param message the reason for the exception
- * @param cause the underlying Throwable that caused this exception to be thrown.
- */
- public ConfigurationException(String message, Throwable cause) {
- super(message, cause);
- }
-}
+/*
+ * 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.config;
+
+import org.apache.shiro.ShiroException;
+
+
+/**
+ * Root exception indicating there was a problem parsing or processing the Shiro configuration.
+ *
+ * @author Les Hazlewood
+ * @since 0.9
+ */
+public class ConfigurationException extends ShiroException
+{
+
+ /**
+ * Creates a new ConfigurationException.
+ */
+ public ConfigurationException() {
+ super();
+ }
+
+ /**
+ * Constructs a new ConfigurationException.
+ *
+ * @param message the reason for the exception
+ */
+ public ConfigurationException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructs a new ConfigurationException.
+ *
+ * @param cause the underlying Throwable that caused this exception to be thrown.
+ */
+ public ConfigurationException(Throwable cause) {
+ super(cause);
+ }
+
+ /**
+ * Constructs a new ConfigurationException.
+ *
+ * @param message the reason for the exception
+ * @param cause the underlying Throwable that caused this exception to be thrown.
+ */
+ public ConfigurationException(String message, Throwable cause) {
+ super(message, cause);
+ }
+}
Propchange: incubator/shiro/branches/shiro-root-1.0.x/core/src/main/java/org/apache/shiro/config/ConfigurationException.java
------------------------------------------------------------------------------
svn:eol-style = native