Skip to content

Commit ecc2db1

Browse files
committed
spring-projects#264 add rethrowNonRetryable
1 parent dd819b4 commit ecc2db1

File tree

149 files changed

+18196
-18064
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+18196
-18064
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,8 @@
329329
<groupId>org.apache.maven.plugins</groupId>
330330
<artifactId>maven-compiler-plugin</artifactId>
331331
<configuration>
332-
<source>1.6</source>
333-
<target>1.6</target>
332+
<source>8</source>
333+
<target>8</target>
334334
</configuration>
335335
</plugin>
336336
<plugin>
Lines changed: 82 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,82 @@
1-
/*
2-
* Copyright 2006-2007 the original author or authors.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* https://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
16-
package org.springframework.classify;
17-
18-
import java.util.Map;
19-
20-
/**
21-
* A special purpose {@link Classifier} with easy configuration options for mapping from
22-
* one arbitrary type of object to another via a pattern matcher.
23-
*
24-
* @author Dave Syer
25-
* @param <C> the type of thing to classify
26-
* @param <T> the output of the classifier
27-
*
28-
*/
29-
@SuppressWarnings("serial")
30-
public class BackToBackPatternClassifier<C, T> implements Classifier<C, T> {
31-
32-
private Classifier<C, String> router;
33-
34-
private Classifier<String, T> matcher;
35-
36-
/**
37-
* Default constructor, provided as a convenience for people using setter injection.
38-
*/
39-
public BackToBackPatternClassifier() {
40-
}
41-
42-
/**
43-
* Set up a classifier with input to the router and output from the matcher.
44-
* @param router see {@link #setRouterDelegate(Object)}
45-
* @param matcher see {@link #setMatcherMap(Map)}
46-
*/
47-
public BackToBackPatternClassifier(Classifier<C, String> router, Classifier<String, T> matcher) {
48-
super();
49-
this.router = router;
50-
this.matcher = matcher;
51-
}
52-
53-
/**
54-
* A convenience method for creating a pattern matching classifier for the matcher
55-
* component.
56-
* @param map maps pattern keys with wildcards to output values
57-
*/
58-
public void setMatcherMap(Map<String, T> map) {
59-
this.matcher = new PatternMatchingClassifier<T>(map);
60-
}
61-
62-
/**
63-
* A convenience method of creating a router classifier based on a plain old Java
64-
* Object. The object provided must have precisely one public method that either has
65-
* the <code>@Classifier</code> annotation or accepts a single argument and outputs a
66-
* String. This will be used to create an input classifier for the router component.
67-
* @param delegate the delegate object used to create a router classifier
68-
*/
69-
public void setRouterDelegate(Object delegate) {
70-
this.router = new ClassifierAdapter<C, String>(delegate);
71-
}
72-
73-
/**
74-
* Classify the input and map to a String, then take that and put it into a pattern
75-
* matcher to match to an output value.
76-
*/
77-
@Override
78-
public T classify(C classifiable) {
79-
return this.matcher.classify(this.router.classify(classifiable));
80-
}
81-
82-
}
1+
/*
2+
* Copyright 2006-2007 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package org.springframework.classify;
17+
18+
import java.util.Map;
19+
20+
/**
21+
* A special purpose {@link Classifier} with easy configuration options for mapping from
22+
* one arbitrary type of object to another via a pattern matcher.
23+
*
24+
* @author Dave Syer
25+
* @param <C> the type of thing to classify
26+
* @param <T> the output of the classifier
27+
*
28+
*/
29+
@SuppressWarnings("serial")
30+
public class BackToBackPatternClassifier<C, T> implements Classifier<C, T> {
31+
32+
private Classifier<C, String> router;
33+
34+
private Classifier<String, T> matcher;
35+
36+
/**
37+
* Default constructor, provided as a convenience for people using setter injection.
38+
*/
39+
public BackToBackPatternClassifier() {
40+
}
41+
42+
/**
43+
* Set up a classifier with input to the router and output from the matcher.
44+
* @param router see {@link #setRouterDelegate(Object)}
45+
* @param matcher see {@link #setMatcherMap(Map)}
46+
*/
47+
public BackToBackPatternClassifier(Classifier<C, String> router, Classifier<String, T> matcher) {
48+
super();
49+
this.router = router;
50+
this.matcher = matcher;
51+
}
52+
53+
/**
54+
* A convenience method for creating a pattern matching classifier for the matcher
55+
* component.
56+
* @param map maps pattern keys with wildcards to output values
57+
*/
58+
public void setMatcherMap(Map<String, T> map) {
59+
this.matcher = new PatternMatchingClassifier<T>(map);
60+
}
61+
62+
/**
63+
* A convenience method of creating a router classifier based on a plain old Java
64+
* Object. The object provided must have precisely one public method that either has
65+
* the <code>@Classifier</code> annotation or accepts a single argument and outputs a
66+
* String. This will be used to create an input classifier for the router component.
67+
* @param delegate the delegate object used to create a router classifier
68+
*/
69+
public void setRouterDelegate(Object delegate) {
70+
this.router = new ClassifierAdapter<C, String>(delegate);
71+
}
72+
73+
/**
74+
* Classify the input and map to a String, then take that and put it into a pattern
75+
* matcher to match to an output value.
76+
*/
77+
@Override
78+
public T classify(C classifiable) {
79+
return this.matcher.classify(this.router.classify(classifiable));
80+
}
81+
82+
}

0 commit comments

Comments
 (0)