Add Ordered to RegistrationBean
Fixes gh-507
This commit is contained in:
@@ -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;
|
|||||||
* @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 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param order the order to set
|
||||||
|
*/
|
||||||
|
public void setOrder(int order) {
|
||||||
|
this.order = order;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the order
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int getOrder() {
|
||||||
|
return this.order;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user