ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/org/apache/catalina/mbeans/ContextMBean.java

Path
ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/org/apache/catalina/mbeans/ContextMBean.java
Status
scanned
Type
file
Name
ContextMBean.java
Extension
.java
Programming language
Java
Mime type
text/plain
File type
ASCII text, with CRLF line terminators
Tag

      
    
Rootfs path

      
    
Size
6854 (6.7 KB)
MD5
c16669497aaae9b110bb0e582c99b5e6
SHA1
c49f44e1bcc567b4dec2f9a24fd32671eb0a4c58
SHA256
3fcdc64fbd7e4909c7a9046b67557c3db5a469411e46c5f7f3fc6c5e5c94398e
SHA512

      
    
SHA1_git
6bcac4881522abe2691f0e877e3ddb227361f857
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
ContextMBean.java | 6.7 KB |

/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.catalina.mbeans; import javax.management.MBeanException; import org.apache.catalina.Context; import org.apache.tomcat.util.descriptor.web.ApplicationParameter; import org.apache.tomcat.util.descriptor.web.ErrorPage; import org.apache.tomcat.util.descriptor.web.FilterDef; import org.apache.tomcat.util.descriptor.web.FilterMap; import org.apache.tomcat.util.descriptor.web.SecurityConstraint; public class ContextMBean extends BaseCatalinaMBean<Context> { /** * Return the set of application parameters for this application. * * @return a string array with a representation of each parameter * * @throws MBeanException propagated from the managed resource access */ public String[] findApplicationParameters() throws MBeanException { Context context = doGetManagedResource(); ApplicationParameter[] params = context.findApplicationParameters(); String[] stringParams = new String[params.length]; for (int counter = 0; counter < params.length; counter++) { stringParams[counter] = params[counter].toString(); } return stringParams; } /** * Return the security constraints for this web application. If there are none, a zero-length array is returned. * * @return a string array with a representation of each security constraint * * @throws MBeanException propagated from the managed resource access */ public String[] findConstraints() throws MBeanException { Context context = doGetManagedResource(); SecurityConstraint[] constraints = context.findConstraints(); String[] stringConstraints = new String[constraints.length]; for (int counter = 0; counter < constraints.length; counter++) { stringConstraints[counter] = constraints[counter].toString(); } return stringConstraints; } /** * Return the error page entry for the specified HTTP error code, if any; otherwise return <code>null</code>. * * @param errorCode Error code to look up * * @return a string representation of the error page * * @throws MBeanException propagated from the managed resource access */ public String findErrorPage(int errorCode) throws MBeanException { Context context = doGetManagedResource(); ErrorPage errorPage = context.findErrorPage(errorCode); if (errorPage != null) { return errorPage.toString(); } else { return null; } } /** * Return the error page entry for the specified Java exception type, if any; otherwise return <code>null</code>. * * @param exceptionType Exception type to look up * * @return a string representation of the error page * * @throws MBeanException propagated from the managed resource access */ public String findErrorPage(Throwable exceptionType) throws MBeanException { Context context = doGetManagedResource(); ErrorPage errorPage = context.findErrorPage(exceptionType); if (errorPage != null) { return errorPage.toString(); } else { return null; } } /** * Return the set of defined error pages for all specified error codes and exception types. * * @return a string array with a representation of each error page * * @throws MBeanException propagated from the managed resource access */ public String[] findErrorPages() throws MBeanException { Context context = doGetManagedResource(); ErrorPage[] pages = context.findErrorPages(); String[] stringPages = new String[pages.length]; for (int counter = 0; counter < pages.length; counter++) { stringPages[counter] = pages[counter].toString(); } return stringPages; } /** * Return the filter definition for the specified filter name, if any; otherwise return <code>null</code>. * * @param name Filter name to look up * * @return a string representation of the filter definition * * @throws MBeanException propagated from the managed resource access */ public String findFilterDef(String name) throws MBeanException { Context context = doGetManagedResource(); FilterDef filterDef = context.findFilterDef(name); if (filterDef != null) { return filterDef.toString(); } else { return null; } } /** * Return the set of defined filters for this Context. * * @return a string array with a representation of all the filter definitions * * @throws MBeanException propagated from the managed resource access */ public String[] findFilterDefs() throws MBeanException { Context context = doGetManagedResource(); FilterDef[] filterDefs = context.findFilterDefs(); String[] stringFilters = new String[filterDefs.length]; for (int counter = 0; counter < filterDefs.length; counter++) { stringFilters[counter] = filterDefs[counter].toString(); } return stringFilters; } /** * Return the set of filter mappings for this Context. * * @return a string array with a representation of all the filter mappings * * @throws MBeanException propagated from the managed resource access */ public String[] findFilterMaps() throws MBeanException { Context context = doGetManagedResource(); FilterMap[] maps = context.findFilterMaps(); String[] stringMaps = new String[maps.length]; for (int counter = 0; counter < maps.length; counter++) { stringMaps[counter] = maps[counter].toString(); } return stringMaps; } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
17.55
Copyrights

      
    
Holders

      
    
Authors

      
    
License detections License expression License expression SPDX
apache_2_0-4bde3f57-78aa-4201-96bf-531cba09e7de apache-2.0 Apache-2.0
URL Start line End line
http://www.apache.org/licenses/LICENSE-2.0 9 9