Commit 879b31f3 authored by Dave Syer's avatar Dave Syer

Add Ordered to RegistrationBean

Fixes gh-507
parent d0cd1df9
...@@ -22,6 +22,7 @@ import java.util.Map; ...@@ -22,6 +22,7 @@ import java.util.Map;
import javax.servlet.Registration; import javax.servlet.Registration;
import org.springframework.core.Conventions; import org.springframework.core.Conventions;
import org.springframework.core.Ordered;
import org.springframework.util.Assert; import org.springframework.util.Assert;
/** /**
...@@ -32,10 +33,12 @@ import org.springframework.util.Assert; ...@@ -32,10 +33,12 @@ import org.springframework.util.Assert;
* @see FilterRegistrationBean * @see FilterRegistrationBean
* @see ServletListenerRegistrationBean * @see ServletListenerRegistrationBean
*/ */
public abstract class RegistrationBean implements ServletContextInitializer { public abstract class RegistrationBean implements ServletContextInitializer, Ordered {
private String name; private String name;
private int order = Ordered.LOWEST_PRECEDENCE;
private boolean asyncSupported = true; private boolean asyncSupported = true;
private Map<String, String> initParameters = new LinkedHashMap<String, String>(); private Map<String, String> initParameters = new LinkedHashMap<String, String>();
...@@ -113,4 +116,19 @@ public abstract class RegistrationBean implements ServletContextInitializer { ...@@ -113,4 +116,19 @@ public abstract class RegistrationBean implements ServletContextInitializer {
} }
} }
/**
* @param order the order to set
*/
public void setOrder(int order) {
this.order = order;
}
/**
* @return the order
*/
@Override
public int getOrder() {
return this.order;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment