本文整理汇总了Java中com.orientechnologies.orient.core.exception.OSecurityException类的典型用法代码示例。如果您正苦于以下问题:Java OSecurityException类的具体用法?Java OSecurityException怎么用?Java OSecurityException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OSecurityException类属于com.orientechnologies.orient.core.exception包,在下文中一共展示了OSecurityException类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onException
import com.orientechnologies.orient.core.exception.OSecurityException; //导入依赖的package包/类
@Override
public IRequestHandler onException(RequestCycle cycle, Exception ex) {
Throwable th = null;
if((th=Exceptions.findCause(ex, OSecurityException.class))!=null
|| (th=Exceptions.findCause(ex, OValidationException.class))!=null
|| (th=Exceptions.findCause(ex, OSchemaException.class))!=null
|| (th=Exceptions.findCause(ex, IllegalStateException.class))!=null && Exceptions.findCause(ex, WicketRuntimeException.class)==null)
{
Page page = extractCurrentPage(false);
if(page==null) {
return th instanceof OSecurityException ?
new UnauthorizedInstantiationHandler(extractCurrentPage(true))
:null;
}
OrientDbWebSession.get().error(th.getMessage());
return new RenderPageRequestHandler(new PageProvider(page),
RenderPageRequestHandler.RedirectPolicy.ALWAYS_REDIRECT);
}
else if((th=Exceptions.findCause(ex, UnauthorizedActionException.class))!=null)
{
final UnauthorizedActionException unauthorizedActionException = (UnauthorizedActionException)th;
return new UnauthorizedInstantiationHandler(unauthorizedActionException.getComponent());
}
else
{
return null;
}
}