当前位置: 首页>>代码示例>>Java>>正文


Java SecurityUtil.isPackageProtectionEnabled方法代码示例

本文整理汇总了Java中org.apache.catalina.security.SecurityUtil.isPackageProtectionEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java SecurityUtil.isPackageProtectionEnabled方法的具体用法?Java SecurityUtil.isPackageProtectionEnabled怎么用?Java SecurityUtil.isPackageProtectionEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.catalina.security.SecurityUtil的用法示例。


在下文中一共展示了SecurityUtil.isPackageProtectionEnabled方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: clearStore

import org.apache.catalina.security.SecurityUtil; //导入方法依赖的package包/类
/**
 * Clear all sessions from the Store.
 */
public void clearStore() {

	if (store == null)
		return;

	try {
		if (SecurityUtil.isPackageProtectionEnabled()) {
			try {
				AccessController.doPrivileged(new PrivilegedStoreClear());
			} catch (PrivilegedActionException ex) {
				Exception exception = ex.getException();
				log.error("Exception clearing the Store: " + exception, exception);
			}
		} else {
			store.clear();
		}
	} catch (IOException e) {
		log.error("Exception clearing the Store: " + e, e);
	}

}
 
开发者ID:how2j,项目名称:lazycat,代码行数:25,代码来源:PersistentManagerBase.java

示例2: executeMethod

import org.apache.catalina.security.SecurityUtil; //导入方法依赖的package包/类
/**
 * Executes the method of the specified <code>ApplicationContext</code>
 * @param method The method object to be invoked.
 * @param context The AppliationContext object on which the method
 *                   will be invoked
 * @param params The arguments passed to the called method.
 */
private Object executeMethod(final Method method, 
                             final ApplicationContext context,
                             final Object[] params) 
        throws PrivilegedActionException, 
               IllegalAccessException,
               InvocationTargetException {
                                 
    if (SecurityUtil.isPackageProtectionEnabled()){
       return AccessController.doPrivileged(new PrivilegedExceptionAction<Object>(){
            @Override
            public Object run() throws IllegalAccessException, InvocationTargetException{
                return method.invoke(context,  params);
            }
        });
    } else {
        return method.invoke(context, params);
    }        
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:26,代码来源:ApplicationContextFacade.java

示例3: unload

import org.apache.catalina.security.SecurityUtil; //导入方法依赖的package包/类
/**
 * Save any currently active sessions in the appropriate persistence
 * mechanism, if any.  If persistence is not supported, this method
 * returns without doing anything.
 *
 * @exception IOException if an input/output error occurs
 */
public void unload() throws IOException {
    if (SecurityUtil.isPackageProtectionEnabled()){
        try{
            AccessController.doPrivileged( new PrivilegedDoUnload() );
        } catch (PrivilegedActionException ex){
            Exception exception = ex.getException();
            if (exception instanceof IOException){
                throw (IOException)exception;
            }
            if (log.isDebugEnabled())
                log.debug("Unreported exception in unLoad() "
                    + exception);
        }
    } else {
        doUnload();
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:25,代码来源:StandardManager.java

示例4: addFilter

import org.apache.catalina.security.SecurityUtil; //导入方法依赖的package包/类
@Override
public FilterRegistration.Dynamic addFilter(String filterName,
        String className) {
    if (SecurityUtil.isPackageProtectionEnabled()) {
        return (FilterRegistration.Dynamic) doPrivileged(
                "addFilter", new Object[]{filterName, className});
    } else {
        return context.addFilter(filterName, className);
    }
}
 
开发者ID:sunmingshuai,项目名称:apache-tomcat-7.0.73-with-comment,代码行数:11,代码来源:ApplicationContextFacade.java

示例5: doPrivileged

import org.apache.catalina.security.SecurityUtil; //导入方法依赖的package包/类
@Override
@SuppressWarnings("unchecked") // doPrivileged() returns the correct type
public Map<String, ? extends ServletRegistration> getServletRegistrations() {
	if (SecurityUtil.isPackageProtectionEnabled()) {
		return (Map<String, ? extends ServletRegistration>) doPrivileged("getServletRegistrations", null);
	} else {
		return context.getServletRegistrations();
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:10,代码来源:ApplicationContextFacade.java

示例6: getInitParameter

import org.apache.catalina.security.SecurityUtil; //导入方法依赖的package包/类
@Override
public String getInitParameter(String name) {
	if (SecurityUtil.isPackageProtectionEnabled()) {
		return (String) doPrivileged("getInitParameter", new Object[] { name });
	} else {
		return context.getInitParameter(name);
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:9,代码来源:ApplicationContextFacade.java

示例7: getFilterRegistration

import org.apache.catalina.security.SecurityUtil; //导入方法依赖的package包/类
@Override
public FilterRegistration getFilterRegistration(String filterName) {
	if (SecurityUtil.isPackageProtectionEnabled()) {
		return (FilterRegistration) doPrivileged("getFilterRegistration", new Object[] { filterName });
	} else {
		return context.getFilterRegistration(filterName);
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:9,代码来源:ApplicationContextFacade.java

示例8: addListener

import org.apache.catalina.security.SecurityUtil; //导入方法依赖的package包/类
@Override
public void addListener(Class<? extends EventListener> listenerClass) {
    if (SecurityUtil.isPackageProtectionEnabled()) {
        doPrivileged("addListener",
                new Class[]{Class.class},
                new Object[]{listenerClass});
    } else {
        context.addListener(listenerClass);
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:11,代码来源:ApplicationContextFacade.java

示例9: addListener

import org.apache.catalina.security.SecurityUtil; //导入方法依赖的package包/类
@Override
public void addListener(String className) {
    if (SecurityUtil.isPackageProtectionEnabled()) {
        doPrivileged("addListener",
                new Object[]{className});
    } else {
        context.addListener(className);
    }
}
 
开发者ID:sunmingshuai,项目名称:apache-tomcat-7.0.73-with-comment,代码行数:10,代码来源:ApplicationContextFacade.java

示例10: read

import org.apache.catalina.security.SecurityUtil; //导入方法依赖的package包/类
@Override
public int read() throws IOException {
	if (SecurityUtil.isPackageProtectionEnabled()) {

		try {
			Integer result = AccessController.doPrivileged(new PrivilegedExceptionAction<Integer>() {

				@Override
				public Integer run() throws IOException {
					Integer integer = Integer.valueOf(ib.readByte());
					return integer;
				}

			});
			return result.intValue();
		} catch (PrivilegedActionException pae) {
			Exception e = pae.getException();
			if (e instanceof IOException) {
				throw (IOException) e;
			} else {
				throw new RuntimeException(e.getMessage(), e);
			}
		}
	} else {
		return ib.readByte();
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:28,代码来源:CoyoteInputStream.java

示例11: addFilter

import org.apache.catalina.security.SecurityUtil; //导入方法依赖的package包/类
@Override
public FilterRegistration.Dynamic addFilter(String filterName,
        Class<? extends Filter> filterClass) {
    if (SecurityUtil.isPackageProtectionEnabled()) {
        return (FilterRegistration.Dynamic) doPrivileged("addFilter",
                new Class[]{String.class, Class.class},
                new Object[]{filterName, filterClass});
    } else {
        return context.addFilter(filterName, filterClass);
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:12,代码来源:ApplicationContextFacade.java

示例12: log

import org.apache.catalina.security.SecurityUtil; //导入方法依赖的package包/类
public void log(String msg) {
    if (SecurityUtil.isPackageProtectionEnabled()) {
        doPrivileged("log", new Object[]{msg} );
    } else {
        context.log(msg);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:8,代码来源:ApplicationContextFacade.java

示例13: getMimeType

import org.apache.catalina.security.SecurityUtil; //导入方法依赖的package包/类
public String getMimeType(String file) {
    if (SecurityUtil.isPackageProtectionEnabled()) {
        return (String)doPrivileged("getMimeType", new Object[]{file});
    } else {
        return context.getMimeType(file);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:8,代码来源:ApplicationContextFacade.java

示例14: setContentType

import org.apache.catalina.security.SecurityUtil; //导入方法依赖的package包/类
@Override
public void setContentType(String type) {

	if (isCommitted()) {
		return;
	}

	if (SecurityUtil.isPackageProtectionEnabled()) {
		AccessController.doPrivileged(new SetContentTypePrivilegedAction(type));
	} else {
		response.setContentType(type);
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:14,代码来源:ResponseFacade.java

示例15: getRealPath

import org.apache.catalina.security.SecurityUtil; //导入方法依赖的package包/类
public String getRealPath(String path) {
    if (SecurityUtil.isPackageProtectionEnabled()) {
        return (String) doPrivileged("getRealPath", new Object[]{path});
    } else {
        return context.getRealPath(path);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:8,代码来源:ApplicationContextFacade.java


注:本文中的org.apache.catalina.security.SecurityUtil.isPackageProtectionEnabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。