本文整理匯總了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;
}
}