use of com.sun.enterprise.deployment.web.ServletFilter in project Payara by payara.
the class WebBundleDescriptorImpl method combineServletFilters.
@Override
protected void combineServletFilters(WebBundleDescriptor webBundleDescriptor) {
for (ServletFilter servletFilter : webBundleDescriptor.getServletFilters()) {
ServletFilterDescriptor servletFilterDesc = (ServletFilterDescriptor) servletFilter;
String name = servletFilter.getName();
ServletFilterDescriptor aServletFilterDesc = null;
for (ServletFilter sf : getServletFilters()) {
if (name.equals(sf.getName())) {
aServletFilterDesc = (ServletFilterDescriptor) sf;
break;
}
}
if (aServletFilterDesc != null) {
if (!aServletFilterDesc.isConflict(servletFilterDesc)) {
if (aServletFilterDesc.getClassName().length() == 0) {
aServletFilterDesc.setClassName(servletFilter.getClassName());
}
if (aServletFilterDesc.isAsyncSupported() == null) {
aServletFilterDesc.setAsyncSupported(servletFilter.isAsyncSupported());
}
}
String className = aServletFilterDesc.getClassName();
if (servletFilterDesc.isConflict() && (className == null || className.length() == 0)) {
throw new IllegalArgumentException(localStrings.getLocalString("web.deployment.exceptionconflictfilterwithoutimpl", "Two or more web fragments define the same Filter with conflicting implementation class names that are not overridden by the web.xml"));
}
} else {
if (servletFilterDesc.isConflict()) {
throw new IllegalArgumentException(localStrings.getLocalString("web.deployment.exceptionconflictfilter", "One or more web fragments define the same Filter in a conflicting way, and the Filter is not defined in web.xml"));
} else {
getServletFilters().add(servletFilterDesc);
}
}
}
}
use of com.sun.enterprise.deployment.web.ServletFilter in project Payara by payara.
the class WebBundleDescriptorImpl method addServletFilter.
/**
* Adds a servlet filter to this web component.
* @param ref
*/
@Override
public void addServletFilter(ServletFilter ref) {
String name = ref.getName();
boolean found = false;
for (ServletFilter servletFilter : getServletFilters()) {
if (name.equals(servletFilter.getName())) {
found = true;
break;
}
}
if (!found) {
getServletFilters().addElement(ref);
}
}
use of com.sun.enterprise.deployment.web.ServletFilter in project Payara by payara.
the class WebFragmentDescriptor method combineServletFilters.
@Override
protected void combineServletFilters(WebBundleDescriptor webBundleDescriptor) {
for (ServletFilter servletFilter : webBundleDescriptor.getServletFilters()) {
ServletFilterDescriptor servletFilterDesc = (ServletFilterDescriptor) servletFilter;
String name = servletFilter.getName();
ServletFilterDescriptor aServletFilterDesc = null;
for (ServletFilter sf : getServletFilters()) {
if (name.equals(sf.getName())) {
aServletFilterDesc = (ServletFilterDescriptor) sf;
break;
}
}
if (aServletFilterDesc != null) {
if (aServletFilterDesc.isConflict(servletFilterDesc)) {
aServletFilterDesc.setConflict(true);
}
} else {
getServletFilters().add(servletFilterDesc);
}
}
}
use of com.sun.enterprise.deployment.web.ServletFilter in project Payara by payara.
the class WebBundleTracerVisitor method accept.
public void accept(BundleDescriptor descriptor) {
if (descriptor instanceof WebBundleDescriptor) {
WebBundleDescriptor webBundle = (WebBundleDescriptor) descriptor;
accept(webBundle);
for (Iterator<WebComponentDescriptor> i = webBundle.getWebComponentDescriptors().iterator(); i.hasNext(); ) {
WebComponentDescriptor aWebComp = i.next();
accept(aWebComp);
}
for (Iterator<WebService> itr = webBundle.getWebServices().getWebServices().iterator(); itr.hasNext(); ) {
WebService aWebService = itr.next();
accept(aWebService);
}
super.accept(descriptor);
for (Iterator<ServletFilter> itr = webBundle.getServletFilterDescriptors().iterator(); itr.hasNext(); ) {
ServletFilter servletFilterDescriptor = itr.next();
accept(servletFilterDescriptor);
}
}
}
use of com.sun.enterprise.deployment.web.ServletFilter in project Payara by payara.
the class WebBundleValidator method accept.
public void accept(BundleDescriptor descriptor) {
if (descriptor instanceof WebBundleDescriptor) {
WebBundleDescriptor webBundle = (WebBundleDescriptor) descriptor;
accept(webBundle);
// inject field.
for (InjectionCapable injectable : webBundle.getInjectableResources(webBundle)) {
accept(injectable);
}
for (Iterator<WebComponentDescriptor> i = webBundle.getWebComponentDescriptors().iterator(); i.hasNext(); ) {
WebComponentDescriptor aWebComp = i.next();
accept(aWebComp);
}
for (Iterator<WebService> itr = webBundle.getWebServices().getWebServices().iterator(); itr.hasNext(); ) {
WebService aWebService = itr.next();
accept(aWebService);
}
super.accept(descriptor);
for (Iterator<ServletFilter> itr = webBundle.getServletFilterDescriptors().iterator(); itr.hasNext(); ) {
ServletFilterDescriptor servletFilterDescriptor = (ServletFilterDescriptor) itr.next();
accept(servletFilterDescriptor);
}
}
}
Aggregations