本文整理汇总了Java中com.liferay.portal.kernel.io.unsync.UnsyncByteArrayOutputStream类的典型用法代码示例。如果您正苦于以下问题:Java UnsyncByteArrayOutputStream类的具体用法?Java UnsyncByteArrayOutputStream怎么用?Java UnsyncByteArrayOutputStream使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UnsyncByteArrayOutputStream类属于com.liferay.portal.kernel.io.unsync包,在下文中一共展示了UnsyncByteArrayOutputStream类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: translateThrowable
import com.liferay.portal.kernel.io.unsync.UnsyncByteArrayOutputStream; //导入依赖的package包/类
public static Throwable translateThrowable(Throwable throwable) {
if (_useReflectionToTranslateThrowable) {
try {
UnsyncByteArrayOutputStream unsyncByteArrayOutputStream = new UnsyncByteArrayOutputStream();
ObjectOutputStream objectOutputStream = new ObjectOutputStream(unsyncByteArrayOutputStream);
objectOutputStream.writeObject(throwable);
objectOutputStream.flush();
objectOutputStream.close();
UnsyncByteArrayInputStream unsyncByteArrayInputStream = new UnsyncByteArrayInputStream(unsyncByteArrayOutputStream.unsafeGetByteArray(),
0, unsyncByteArrayOutputStream.size());
Thread currentThread = Thread.currentThread();
ClassLoader contextClassLoader = currentThread.getContextClassLoader();
ObjectInputStream objectInputStream = new ClassLoaderObjectInputStream(unsyncByteArrayInputStream,
contextClassLoader);
throwable = (Throwable)objectInputStream.readObject();
objectInputStream.close();
return throwable;
}
catch (SecurityException se) {
if (_log.isInfoEnabled()) {
_log.info("Do not use reflection to translate throwable");
}
_useReflectionToTranslateThrowable = false;
}
catch (Throwable throwable2) {
_log.error(throwable2, throwable2);
return throwable2;
}
}
Class<?> clazz = throwable.getClass();
String className = clazz.getName();
if (className.equals(PortalException.class.getName())) {
return new PortalException();
}
if (className.equals(SystemException.class.getName())) {
return new SystemException();
}
return throwable;
}
示例2: translateThrowable
import com.liferay.portal.kernel.io.unsync.UnsyncByteArrayOutputStream; //导入依赖的package包/类
public static Throwable translateThrowable(Throwable throwable) {
if (_useReflectionToTranslateThrowable) {
try {
UnsyncByteArrayOutputStream unsyncByteArrayOutputStream = new UnsyncByteArrayOutputStream();
ObjectOutputStream objectOutputStream = new ObjectOutputStream(unsyncByteArrayOutputStream);
objectOutputStream.writeObject(throwable);
objectOutputStream.flush();
objectOutputStream.close();
UnsyncByteArrayInputStream unsyncByteArrayInputStream = new UnsyncByteArrayInputStream(unsyncByteArrayOutputStream.unsafeGetByteArray(),
0, unsyncByteArrayOutputStream.size());
Thread currentThread = Thread.currentThread();
ClassLoader contextClassLoader = currentThread.getContextClassLoader();
ObjectInputStream objectInputStream = new ClassLoaderObjectInputStream(unsyncByteArrayInputStream,
contextClassLoader);
throwable = (Throwable)objectInputStream.readObject();
objectInputStream.close();
return throwable;
}
catch (SecurityException se) {
if (_log.isInfoEnabled()) {
_log.info("Do not use reflection to translate throwable");
}
_useReflectionToTranslateThrowable = false;
}
catch (Throwable throwable2) {
_log.error(throwable2, throwable2);
return throwable2;
}
}
Class<?> clazz = throwable.getClass();
String className = clazz.getName();
if (className.equals(PortalException.class.getName())) {
return new PortalException();
}
if (className.equals(SystemException.class.getName())) {
return new SystemException();
}
if (className.equals(
"org.oep.core.processmgt.NoSuchDossierProcessException")) {
return new org.oep.core.processmgt.NoSuchDossierProcessException();
}
if (className.equals(
"org.oep.core.processmgt.NoSuchDossierStepException")) {
return new org.oep.core.processmgt.NoSuchDossierStepException();
}
return throwable;
}
示例3: translateThrowable
import com.liferay.portal.kernel.io.unsync.UnsyncByteArrayOutputStream; //导入依赖的package包/类
public static Throwable translateThrowable(Throwable throwable) {
if (_useReflectionToTranslateThrowable) {
try {
UnsyncByteArrayOutputStream unsyncByteArrayOutputStream = new UnsyncByteArrayOutputStream();
ObjectOutputStream objectOutputStream = new ObjectOutputStream(unsyncByteArrayOutputStream);
objectOutputStream.writeObject(throwable);
objectOutputStream.flush();
objectOutputStream.close();
UnsyncByteArrayInputStream unsyncByteArrayInputStream = new UnsyncByteArrayInputStream(unsyncByteArrayOutputStream.unsafeGetByteArray(),
0, unsyncByteArrayOutputStream.size());
Thread currentThread = Thread.currentThread();
ClassLoader contextClassLoader = currentThread.getContextClassLoader();
ObjectInputStream objectInputStream = new ClassLoaderObjectInputStream(unsyncByteArrayInputStream,
contextClassLoader);
throwable = (Throwable)objectInputStream.readObject();
objectInputStream.close();
return throwable;
}
catch (SecurityException se) {
if (_log.isInfoEnabled()) {
_log.info("Do not use reflection to translate throwable");
}
_useReflectionToTranslateThrowable = false;
}
catch (Throwable throwable2) {
_log.error(throwable2, throwable2);
return throwable2;
}
}
Class<?> clazz = throwable.getClass();
String className = clazz.getName();
if (className.equals(PortalException.class.getName())) {
return new PortalException();
}
if (className.equals(SystemException.class.getName())) {
return new SystemException();
}
if (className.equals("org.oep.core.logging.NoSuchNewUserLogException")) {
return new org.oep.core.logging.NoSuchNewUserLogException();
}
if (className.equals("org.oep.core.logging.NoSuchUserActivityException")) {
return new org.oep.core.logging.NoSuchUserActivityException();
}
return throwable;
}
示例4: translateThrowable
import com.liferay.portal.kernel.io.unsync.UnsyncByteArrayOutputStream; //导入依赖的package包/类
public static Throwable translateThrowable(Throwable throwable) {
if (_useReflectionToTranslateThrowable) {
try {
UnsyncByteArrayOutputStream unsyncByteArrayOutputStream = new UnsyncByteArrayOutputStream();
ObjectOutputStream objectOutputStream = new ObjectOutputStream(unsyncByteArrayOutputStream);
objectOutputStream.writeObject(throwable);
objectOutputStream.flush();
objectOutputStream.close();
UnsyncByteArrayInputStream unsyncByteArrayInputStream = new UnsyncByteArrayInputStream(unsyncByteArrayOutputStream.unsafeGetByteArray(),
0, unsyncByteArrayOutputStream.size());
Thread currentThread = Thread.currentThread();
ClassLoader contextClassLoader = currentThread.getContextClassLoader();
ObjectInputStream objectInputStream = new ClassLoaderObjectInputStream(unsyncByteArrayInputStream,
contextClassLoader);
throwable = (Throwable)objectInputStream.readObject();
objectInputStream.close();
return throwable;
}
catch (SecurityException se) {
if (_log.isInfoEnabled()) {
_log.info("Do not use reflection to translate throwable");
}
_useReflectionToTranslateThrowable = false;
}
catch (Throwable throwable2) {
_log.error(throwable2, throwable2);
return throwable2;
}
}
Class<?> clazz = throwable.getClass();
String className = clazz.getName();
if (className.equals(PortalException.class.getName())) {
return new PortalException();
}
if (className.equals(SystemException.class.getName())) {
return new SystemException();
}
if (className.equals("org.oep.core.ssomgt.NoSuchApplicationException")) {
return new org.oep.core.ssomgt.NoSuchApplicationException();
}
if (className.equals("org.oep.core.ssomgt.NoSuchAppMessageException")) {
return new org.oep.core.ssomgt.NoSuchAppMessageException();
}
if (className.equals("org.oep.core.ssomgt.NoSuchAppRoleException")) {
return new org.oep.core.ssomgt.NoSuchAppRoleException();
}
if (className.equals(
"org.oep.core.ssomgt.NoSuchAppRole2EmployeeException")) {
return new org.oep.core.ssomgt.NoSuchAppRole2EmployeeException();
}
if (className.equals(
"org.oep.core.ssomgt.NoSuchAppRole2JobPosException")) {
return new org.oep.core.ssomgt.NoSuchAppRole2JobPosException();
}
if (className.equals("org.oep.core.ssomgt.NoSuchUserSyncException")) {
return new org.oep.core.ssomgt.NoSuchUserSyncException();
}
return throwable;
}
示例5: translateThrowable
import com.liferay.portal.kernel.io.unsync.UnsyncByteArrayOutputStream; //导入依赖的package包/类
public static Throwable translateThrowable(Throwable throwable) {
if (_useReflectionToTranslateThrowable) {
try {
UnsyncByteArrayOutputStream unsyncByteArrayOutputStream = new UnsyncByteArrayOutputStream();
ObjectOutputStream objectOutputStream = new ObjectOutputStream(unsyncByteArrayOutputStream);
objectOutputStream.writeObject(throwable);
objectOutputStream.flush();
objectOutputStream.close();
UnsyncByteArrayInputStream unsyncByteArrayInputStream = new UnsyncByteArrayInputStream(unsyncByteArrayOutputStream.unsafeGetByteArray(),
0, unsyncByteArrayOutputStream.size());
Thread currentThread = Thread.currentThread();
ClassLoader contextClassLoader = currentThread.getContextClassLoader();
ObjectInputStream objectInputStream = new ClassLoaderObjectInputStream(unsyncByteArrayInputStream,
contextClassLoader);
throwable = (Throwable) objectInputStream.readObject();
objectInputStream.close();
return throwable;
} catch (SecurityException se) {
if (_log.isInfoEnabled()) {
_log.info("Do not use reflection to translate throwable");
}
_useReflectionToTranslateThrowable = false;
} catch (Throwable throwable2) {
_log.error(throwable2, throwable2);
return throwable2;
}
}
Class<?> clazz = throwable.getClass();
String className = clazz.getName();
if (className.equals(PortalException.class.getName())) {
return new PortalException();
}
if (className.equals(SystemException.class.getName())) {
return new SystemException();
}
if (className.equals("com.govapps.persistence.NoSuchConcernException")) {
return new com.govapps.persistence.NoSuchConcernException();
}
return throwable;
}
示例6: translateThrowable
import com.liferay.portal.kernel.io.unsync.UnsyncByteArrayOutputStream; //导入依赖的package包/类
public static Throwable translateThrowable(Throwable throwable) {
if (_useReflectionToTranslateThrowable) {
try {
UnsyncByteArrayOutputStream unsyncByteArrayOutputStream = new UnsyncByteArrayOutputStream();
ObjectOutputStream objectOutputStream = new ObjectOutputStream(unsyncByteArrayOutputStream);
objectOutputStream.writeObject(throwable);
objectOutputStream.flush();
objectOutputStream.close();
UnsyncByteArrayInputStream unsyncByteArrayInputStream = new UnsyncByteArrayInputStream(unsyncByteArrayOutputStream.unsafeGetByteArray(),
0, unsyncByteArrayOutputStream.size());
Thread currentThread = Thread.currentThread();
ClassLoader contextClassLoader = currentThread.getContextClassLoader();
ObjectInputStream objectInputStream = new ClassLoaderObjectInputStream(unsyncByteArrayInputStream,
contextClassLoader);
throwable = (Throwable) objectInputStream.readObject();
objectInputStream.close();
return throwable;
} catch (SecurityException se) {
if (_log.isInfoEnabled()) {
_log.info("Do not use reflection to translate throwable");
}
_useReflectionToTranslateThrowable = false;
} catch (Throwable throwable2) {
_log.error(throwable2, throwable2);
return throwable2;
}
}
Class<?> clazz = throwable.getClass();
String className = clazz.getName();
if (className.equals(PortalException.class.getName())) {
return new PortalException();
}
if (className.equals(SystemException.class.getName())) {
return new SystemException();
}
if (className.equals(
"br.gov.camara.edemocracia.portlets.wikilegis.NoSuchArtigoException")) {
return new br.gov.camara.edemocracia.portlets.wikilegis.NoSuchArtigoException();
}
if (className.equals(
"br.gov.camara.edemocracia.portlets.wikilegis.NoSuchContribuicaoException")) {
return new br.gov.camara.edemocracia.portlets.wikilegis.NoSuchContribuicaoException();
}
if (className.equals(
"br.gov.camara.edemocracia.portlets.wikilegis.NoSuchEstruturaException")) {
return new br.gov.camara.edemocracia.portlets.wikilegis.NoSuchEstruturaException();
}
return throwable;
}
示例7: translateThrowable
import com.liferay.portal.kernel.io.unsync.UnsyncByteArrayOutputStream; //导入依赖的package包/类
public static Throwable translateThrowable(Throwable throwable) {
if (_useReflectionToTranslateThrowable) {
try {
UnsyncByteArrayOutputStream unsyncByteArrayOutputStream = new UnsyncByteArrayOutputStream();
ObjectOutputStream objectOutputStream = new ObjectOutputStream(unsyncByteArrayOutputStream);
objectOutputStream.writeObject(throwable);
objectOutputStream.flush();
objectOutputStream.close();
UnsyncByteArrayInputStream unsyncByteArrayInputStream = new UnsyncByteArrayInputStream(unsyncByteArrayOutputStream.unsafeGetByteArray(),
0, unsyncByteArrayOutputStream.size());
Thread currentThread = Thread.currentThread();
ClassLoader contextClassLoader = currentThread.getContextClassLoader();
ObjectInputStream objectInputStream = new ClassLoaderObjectInputStream(unsyncByteArrayInputStream,
contextClassLoader);
throwable = (Throwable) objectInputStream.readObject();
objectInputStream.close();
return throwable;
} catch (SecurityException se) {
if (_log.isInfoEnabled()) {
_log.info("Do not use reflection to translate throwable");
}
_useReflectionToTranslateThrowable = false;
} catch (Throwable throwable2) {
_log.error(throwable2, throwable2);
return throwable2;
}
}
Class<?> clazz = throwable.getClass();
String className = clazz.getName();
if (className.equals(PortalException.class.getName())) {
return new PortalException();
}
if (className.equals(SystemException.class.getName())) {
return new SystemException();
}
return throwable;
}
示例8: translateThrowable
import com.liferay.portal.kernel.io.unsync.UnsyncByteArrayOutputStream; //导入依赖的package包/类
public static Throwable translateThrowable(Throwable throwable) {
if (_useReflectionToTranslateThrowable) {
try {
UnsyncByteArrayOutputStream unsyncByteArrayOutputStream = new UnsyncByteArrayOutputStream();
ObjectOutputStream objectOutputStream = new ObjectOutputStream(unsyncByteArrayOutputStream);
objectOutputStream.writeObject(throwable);
objectOutputStream.flush();
objectOutputStream.close();
UnsyncByteArrayInputStream unsyncByteArrayInputStream = new UnsyncByteArrayInputStream(unsyncByteArrayOutputStream.unsafeGetByteArray(),
0, unsyncByteArrayOutputStream.size());
Thread currentThread = Thread.currentThread();
ClassLoader contextClassLoader = currentThread.getContextClassLoader();
ObjectInputStream objectInputStream = new ClassLoaderObjectInputStream(unsyncByteArrayInputStream,
contextClassLoader);
throwable = (Throwable) objectInputStream.readObject();
objectInputStream.close();
return throwable;
} catch (SecurityException se) {
if (_log.isInfoEnabled()) {
_log.info("Do not use reflection to translate throwable");
}
_useReflectionToTranslateThrowable = false;
} catch (Throwable throwable2) {
_log.error(throwable2, throwable2);
return throwable2;
}
}
Class<?> clazz = throwable.getClass();
String className = clazz.getName();
if (className.equals(PortalException.class.getName())) {
return new PortalException();
}
if (className.equals(SystemException.class.getName())) {
return new SystemException();
}
if (className.equals(
"br.gov.camara.edemocracia.portlets.chat.NoSuchChatRoomException")) {
return new br.gov.camara.edemocracia.portlets.chat.NoSuchChatRoomException();
}
if (className.equals(
"br.gov.camara.edemocracia.portlets.chat.NoSuchChatRoomMessageException")) {
return new br.gov.camara.edemocracia.portlets.chat.NoSuchChatRoomMessageException();
}
if (className.equals(
"br.gov.camara.edemocracia.portlets.chat.NoSuchChatRoomTwitterException")) {
return new br.gov.camara.edemocracia.portlets.chat.NoSuchChatRoomTwitterException();
}
if (className.equals(
"br.gov.camara.edemocracia.portlets.chat.NoSuchChatRoomUserException")) {
return new br.gov.camara.edemocracia.portlets.chat.NoSuchChatRoomUserException();
}
if (className.equals(
"br.gov.camara.edemocracia.portlets.chat.NoSuchChatRoomVideoException")) {
return new br.gov.camara.edemocracia.portlets.chat.NoSuchChatRoomVideoException();
}
return throwable;
}
示例9: translateThrowable
import com.liferay.portal.kernel.io.unsync.UnsyncByteArrayOutputStream; //导入依赖的package包/类
public static Throwable translateThrowable(Throwable throwable) {
if (_useReflectionToTranslateThrowable) {
try {
UnsyncByteArrayOutputStream unsyncByteArrayOutputStream = new UnsyncByteArrayOutputStream();
ObjectOutputStream objectOutputStream = new ObjectOutputStream(unsyncByteArrayOutputStream);
objectOutputStream.writeObject(throwable);
objectOutputStream.flush();
objectOutputStream.close();
UnsyncByteArrayInputStream unsyncByteArrayInputStream = new UnsyncByteArrayInputStream(unsyncByteArrayOutputStream.unsafeGetByteArray(),
0, unsyncByteArrayOutputStream.size());
Thread currentThread = Thread.currentThread();
ClassLoader contextClassLoader = currentThread.getContextClassLoader();
ObjectInputStream objectInputStream = new ClassLoaderObjectInputStream(unsyncByteArrayInputStream,
contextClassLoader);
throwable = (Throwable) objectInputStream.readObject();
objectInputStream.close();
return throwable;
} catch (SecurityException se) {
if (_log.isInfoEnabled()) {
_log.info("Do not use reflection to translate throwable");
}
_useReflectionToTranslateThrowable = false;
} catch (Throwable throwable2) {
_log.error(throwable2, throwable2);
return throwable2;
}
}
Class<?> clazz = throwable.getClass();
String className = clazz.getName();
if (className.equals(PortalException.class.getName())) {
return new PortalException();
}
if (className.equals(SystemException.class.getName())) {
return new SystemException();
}
if (className.equals(
"br.gov.camara.edemocracia.portlets.guiadiscussao.NoSuchAcaoException")) {
return new br.gov.camara.edemocracia.portlets.guiadiscussao.NoSuchAcaoException();
}
if (className.equals(
"br.gov.camara.edemocracia.portlets.guiadiscussao.NoSuchConfiguracaoException")) {
return new br.gov.camara.edemocracia.portlets.guiadiscussao.NoSuchConfiguracaoException();
}
if (className.equals(
"br.gov.camara.edemocracia.portlets.guiadiscussao.NoSuchFaseException")) {
return new br.gov.camara.edemocracia.portlets.guiadiscussao.NoSuchFaseException();
}
return throwable;
}
示例10: translateThrowable
import com.liferay.portal.kernel.io.unsync.UnsyncByteArrayOutputStream; //导入依赖的package包/类
public static Throwable translateThrowable(Throwable throwable) {
if (_useReflectionToTranslateThrowable) {
try {
UnsyncByteArrayOutputStream unsyncByteArrayOutputStream = new UnsyncByteArrayOutputStream();
ObjectOutputStream objectOutputStream = new ObjectOutputStream(unsyncByteArrayOutputStream);
objectOutputStream.writeObject(throwable);
objectOutputStream.flush();
objectOutputStream.close();
UnsyncByteArrayInputStream unsyncByteArrayInputStream = new UnsyncByteArrayInputStream(unsyncByteArrayOutputStream.unsafeGetByteArray(),
0, unsyncByteArrayOutputStream.size());
Thread currentThread = Thread.currentThread();
ClassLoader contextClassLoader = currentThread.getContextClassLoader();
ObjectInputStream objectInputStream = new ClassLoaderObjectInputStream(unsyncByteArrayInputStream,
contextClassLoader);
throwable = (Throwable) objectInputStream.readObject();
objectInputStream.close();
return throwable;
} catch (SecurityException se) {
if (_log.isInfoEnabled()) {
_log.info("Do not use reflection to translate throwable");
}
_useReflectionToTranslateThrowable = false;
} catch (Throwable throwable2) {
_log.error(throwable2, throwable2);
return throwable2;
}
}
Class<?> clazz = throwable.getClass();
String className = clazz.getName();
if (className.equals(PortalException.class.getName())) {
return new PortalException();
}
if (className.equals(SystemException.class.getName())) {
return new SystemException();
}
if (className.equals(
"br.gov.camara.edemocracia.portlets.priorizacao.NoSuchConfiguracaoException")) {
return new br.gov.camara.edemocracia.portlets.priorizacao.NoSuchConfiguracaoException();
}
if (className.equals(
"br.gov.camara.edemocracia.portlets.priorizacao.NoSuchEixoException")) {
return new br.gov.camara.edemocracia.portlets.priorizacao.NoSuchEixoException();
}
if (className.equals(
"br.gov.camara.edemocracia.portlets.priorizacao.NoSuchPropostaException")) {
return new br.gov.camara.edemocracia.portlets.priorizacao.NoSuchPropostaException();
}
if (className.equals(
"br.gov.camara.edemocracia.portlets.priorizacao.NoSuchVotoException")) {
return new br.gov.camara.edemocracia.portlets.priorizacao.NoSuchVotoException();
}
return throwable;
}
示例11: translateThrowable
import com.liferay.portal.kernel.io.unsync.UnsyncByteArrayOutputStream; //导入依赖的package包/类
public static Throwable translateThrowable(Throwable throwable) {
if (_useReflectionToTranslateThrowable) {
try {
UnsyncByteArrayOutputStream unsyncByteArrayOutputStream = new UnsyncByteArrayOutputStream();
ObjectOutputStream objectOutputStream = new ObjectOutputStream(unsyncByteArrayOutputStream);
objectOutputStream.writeObject(throwable);
objectOutputStream.flush();
objectOutputStream.close();
UnsyncByteArrayInputStream unsyncByteArrayInputStream = new UnsyncByteArrayInputStream(unsyncByteArrayOutputStream.unsafeGetByteArray(),
0, unsyncByteArrayOutputStream.size());
Thread currentThread = Thread.currentThread();
ClassLoader contextClassLoader = currentThread.getContextClassLoader();
ObjectInputStream objectInputStream = new ClassLoaderObjectInputStream(unsyncByteArrayInputStream,
contextClassLoader);
throwable = (Throwable) objectInputStream.readObject();
objectInputStream.close();
return throwable;
} catch (SecurityException se) {
if (_log.isInfoEnabled()) {
_log.info("Do not use reflection to translate throwable");
}
_useReflectionToTranslateThrowable = false;
} catch (Throwable throwable2) {
_log.error(throwable2, throwable2);
return throwable2;
}
}
Class<?> clazz = throwable.getClass();
String className = clazz.getName();
if (className.equals(PortalException.class.getName())) {
return new PortalException();
}
if (className.equals(SystemException.class.getName())) {
return new SystemException();
}
if (className.equals(
"br.gov.camara.edemocracia.portlets.graficos.NoSuchContadorAcessoException")) {
return new br.gov.camara.edemocracia.portlets.graficos.NoSuchContadorAcessoException();
}
return throwable;
}
示例12: translateThrowable
import com.liferay.portal.kernel.io.unsync.UnsyncByteArrayOutputStream; //导入依赖的package包/类
public static Throwable translateThrowable(Throwable throwable) {
if (_useReflectionToTranslateThrowable) {
try {
UnsyncByteArrayOutputStream unsyncByteArrayOutputStream = new UnsyncByteArrayOutputStream();
ObjectOutputStream objectOutputStream = new ObjectOutputStream(unsyncByteArrayOutputStream);
objectOutputStream.writeObject(throwable);
objectOutputStream.flush();
objectOutputStream.close();
UnsyncByteArrayInputStream unsyncByteArrayInputStream = new UnsyncByteArrayInputStream(unsyncByteArrayOutputStream.unsafeGetByteArray(),
0, unsyncByteArrayOutputStream.size());
Thread currentThread = Thread.currentThread();
ClassLoader contextClassLoader = currentThread.getContextClassLoader();
ObjectInputStream objectInputStream = new ClassLoaderObjectInputStream(unsyncByteArrayInputStream,
contextClassLoader);
throwable = (Throwable)objectInputStream.readObject();
objectInputStream.close();
return throwable;
}
catch (SecurityException se) {
if (_log.isInfoEnabled()) {
_log.info("Do not use reflection to translate throwable");
}
_useReflectionToTranslateThrowable = false;
}
catch (Throwable throwable2) {
_log.error(throwable2, throwable2);
return throwable2;
}
}
Class<?> clazz = throwable.getClass();
String className = clazz.getName();
if (className.equals(PortalException.class.getName())) {
return new PortalException();
}
if (className.equals(SystemException.class.getName())) {
return new SystemException();
}
if (className.equals(
"com.rivetlogic.microsite.NoSuchMicroSiteException")) {
return new com.rivetlogic.microsite.NoSuchMicroSiteException();
}
if (className.equals(
"com.rivetlogic.microsite.NoSuchSiteRequestException")) {
return new com.rivetlogic.microsite.NoSuchSiteRequestException();
}
return throwable;
}
示例13: translateThrowable
import com.liferay.portal.kernel.io.unsync.UnsyncByteArrayOutputStream; //导入依赖的package包/类
public static Throwable translateThrowable(Throwable throwable) {
if (_useReflectionToTranslateThrowable) {
try {
UnsyncByteArrayOutputStream unsyncByteArrayOutputStream = new UnsyncByteArrayOutputStream();
ObjectOutputStream objectOutputStream = new ObjectOutputStream(unsyncByteArrayOutputStream);
objectOutputStream.writeObject(throwable);
objectOutputStream.flush();
objectOutputStream.close();
UnsyncByteArrayInputStream unsyncByteArrayInputStream = new UnsyncByteArrayInputStream(unsyncByteArrayOutputStream.unsafeGetByteArray(),
0, unsyncByteArrayOutputStream.size());
Thread currentThread = Thread.currentThread();
ClassLoader contextClassLoader = currentThread.getContextClassLoader();
ObjectInputStream objectInputStream = new ClassLoaderObjectInputStream(unsyncByteArrayInputStream,
contextClassLoader);
throwable = (Throwable) objectInputStream.readObject();
objectInputStream.close();
return throwable;
} catch (SecurityException se) {
if (_log.isInfoEnabled()) {
_log.info("Do not use reflection to translate throwable");
}
_useReflectionToTranslateThrowable = false;
} catch (Throwable throwable2) {
_log.error(throwable2, throwable2);
return throwable2;
}
}
Class<?> clazz = throwable.getClass();
String className = clazz.getName();
if (className.equals(PortalException.class.getName())) {
return new PortalException();
}
if (className.equals(SystemException.class.getName())) {
return new SystemException();
}
if (className.equals(
"com.knowarth.portlets.themepersonalizer.NoSuchAvailablePersonalizedThemeException")) {
return new com.knowarth.portlets.themepersonalizer.NoSuchAvailablePersonalizedThemeException();
}
if (className.equals(
"com.knowarth.portlets.themepersonalizer.NoSuchUserPersonalizedThemeException")) {
return new com.knowarth.portlets.themepersonalizer.NoSuchUserPersonalizedThemeException();
}
return throwable;
}
示例14: translateThrowable
import com.liferay.portal.kernel.io.unsync.UnsyncByteArrayOutputStream; //导入依赖的package包/类
public static Throwable translateThrowable(Throwable throwable) {
if (_useReflectionToTranslateThrowable) {
try {
UnsyncByteArrayOutputStream unsyncByteArrayOutputStream = new UnsyncByteArrayOutputStream();
ObjectOutputStream objectOutputStream = new ObjectOutputStream(unsyncByteArrayOutputStream);
objectOutputStream.writeObject(throwable);
objectOutputStream.flush();
objectOutputStream.close();
UnsyncByteArrayInputStream unsyncByteArrayInputStream = new UnsyncByteArrayInputStream(unsyncByteArrayOutputStream.unsafeGetByteArray(),
0, unsyncByteArrayOutputStream.size());
Thread currentThread = Thread.currentThread();
ClassLoader contextClassLoader = currentThread.getContextClassLoader();
ObjectInputStream objectInputStream = new ClassLoaderObjectInputStream(unsyncByteArrayInputStream,
contextClassLoader);
throwable = (Throwable)objectInputStream.readObject();
objectInputStream.close();
return throwable;
}
catch (SecurityException se) {
if (_log.isInfoEnabled()) {
_log.info("Do not use reflection to translate throwable");
}
_useReflectionToTranslateThrowable = false;
}
catch (Throwable throwable2) {
_log.error(throwable2, throwable2);
return throwable2;
}
}
Class<?> clazz = throwable.getClass();
String className = clazz.getName();
if (className.equals(PortalException.class.getName())) {
return new PortalException();
}
if (className.equals(SystemException.class.getName())) {
return new SystemException();
}
if (className.equals("de.ancud.shorturl.NoSuchShortUrlException")) {
return new de.ancud.shorturl.NoSuchShortUrlException();
}
return throwable;
}
示例15: translateThrowable
import com.liferay.portal.kernel.io.unsync.UnsyncByteArrayOutputStream; //导入依赖的package包/类
public static Throwable translateThrowable(Throwable throwable) {
if (_useReflectionToTranslateThrowable) {
try {
UnsyncByteArrayOutputStream unsyncByteArrayOutputStream = new UnsyncByteArrayOutputStream();
ObjectOutputStream objectOutputStream = new ObjectOutputStream(unsyncByteArrayOutputStream);
objectOutputStream.writeObject(throwable);
objectOutputStream.flush();
objectOutputStream.close();
UnsyncByteArrayInputStream unsyncByteArrayInputStream = new UnsyncByteArrayInputStream(unsyncByteArrayOutputStream.unsafeGetByteArray(),
0, unsyncByteArrayOutputStream.size());
Thread currentThread = Thread.currentThread();
ClassLoader contextClassLoader = currentThread.getContextClassLoader();
ObjectInputStream objectInputStream = new ClassLoaderObjectInputStream(unsyncByteArrayInputStream,
contextClassLoader);
throwable = (Throwable)objectInputStream.readObject();
objectInputStream.close();
return throwable;
}
catch (SecurityException se) {
if (_log.isInfoEnabled()) {
_log.info("Do not use reflection to translate throwable");
}
_useReflectionToTranslateThrowable = false;
}
catch (Throwable throwable2) {
_log.error(throwable2, throwable2);
return throwable2;
}
}
Class<?> clazz = throwable.getClass();
String className = clazz.getName();
if (className.equals(PortalException.class.getName())) {
return new PortalException();
}
if (className.equals(SystemException.class.getName())) {
return new SystemException();
}
if (className.equals(
"gr.open.marketplace.NoSuchAdminIPConfigurationException")) {
return new gr.open.marketplace.NoSuchAdminIPConfigurationException();
}
if (className.equals(
"gr.open.marketplace.NoSuchAdminIPValidationDataException")) {
return new gr.open.marketplace.NoSuchAdminIPValidationDataException();
}
return throwable;
}