File: 03-spring-compatibility.patch

package info (click to toggle)
shiro 1.3.2-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,284 kB
  • sloc: java: 32,033; xml: 3,292; jsp: 374; makefile: 4
file content (33 lines) | stat: -rw-r--r-- 1,324 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From aa2cd4fca10416623ecc29008cd851a4f1ed3d98 Mon Sep 17 00:00:00 2001
From: Brian Demers <bdemers@apache.org>
Date: Fri, 23 Sep 2016 16:43:48 -0400
Subject: [PATCH] SHIRO-590 - Added Spring Boot starters and programatic Spring
 support.

---
 .../shiro/spring/LifecycleBeanPostProcessor.java      | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/support/spring/src/main/java/org/apache/shiro/spring/LifecycleBeanPostProcessor.java b/support/spring/src/main/java/org/apache/shiro/spring/LifecycleBeanPostProcessor.java
index a526769e..a318d20b 100644
--- a/support/spring/src/main/java/org/apache/shiro/spring/LifecycleBeanPostProcessor.java
+++ b/support/spring/src/main/java/org/apache/shiro/spring/LifecycleBeanPostProcessor.java
@@ -134,4 +134,15 @@ public int getOrder() {
         // LifecycleBeanPostProcessor needs Order. See https://issues.apache.org/jira/browse/SHIRO-222
         return order;
     }
+
+    /**
+     * Return true only if <code>bean</code> implements Destroyable.
+     * @param bean bean to check if requires destruction.
+     * @return true only if <code>bean</code> implements Destroyable.
+     * @since 1.4
+     */
+    @SuppressWarnings("unused")
+    public boolean requiresDestruction(Object bean) {
+        return (bean instanceof Destroyable);
+    }
 }
-- 
2.20.1