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


Java UnsyncByteArrayOutputStream类代码示例

本文整理汇总了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;
}
 
开发者ID:baxtheman,项目名称:mqtt-liferay-plugins,代码行数:56,代码来源:ClpSerializer.java

示例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;
}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:66,代码来源:ClpSerializer.java

示例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;
}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:64,代码来源:ClpSerializer.java

示例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;
}
 
开发者ID:openegovplatform,项目名称:OEPv2,代码行数:82,代码来源:ClpSerializer.java

示例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;
}
 
开发者ID:fraunhoferfokus,项目名称:govapps,代码行数:58,代码来源:ClpSerializer.java

示例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;
}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:69,代码来源:ClpSerializer.java

示例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;
}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:54,代码来源:ClpSerializer.java

示例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;
}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:79,代码来源:ClpSerializer.java

示例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;
}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:69,代码来源:ClpSerializer.java

示例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;
}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:74,代码来源:ClpSerializer.java

示例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;
}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:59,代码来源:ClpSerializer.java

示例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;
}
 
开发者ID:rivetlogic,项目名称:liferay-microsite-manager,代码行数:66,代码来源:ClpSerializer.java

示例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;
}
 
开发者ID:knowarth-technologies,项目名称:theme-personalizer,代码行数:64,代码来源:ClpSerializer.java

示例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;
}
 
开发者ID:moddavid,项目名称:Ancud_ShortURL-portlet,代码行数:60,代码来源:ClpSerializer.java

示例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;
}
 
开发者ID:technopolis,项目名称:role-access-lists,代码行数:66,代码来源:ClpSerializer.java


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