當前位置: 首頁>>代碼示例>>Java>>正文


Java UtilsFunctions.exceptionToString方法代碼示例

本文整理匯總了Java中es.tid.util.UtilsFunctions.exceptionToString方法的典型用法代碼示例。如果您正苦於以下問題:Java UtilsFunctions.exceptionToString方法的具體用法?Java UtilsFunctions.exceptionToString怎麽用?Java UtilsFunctions.exceptionToString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在es.tid.util.UtilsFunctions的用法示例。


在下文中一共展示了UtilsFunctions.exceptionToString方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: newRequest

import es.tid.util.UtilsFunctions; //導入方法依賴的package包/類
public PCEPMessage newRequest( PCEPMessage pcreq, long maxTimeMs)
{
	log.info("New Request. Request:"+pcreq.toString());
	Object object_lock = new Object();		
	long idRequest = generateRandomID();

	Long idReqLong = new Long(idRequest);
	long timeIni = System.nanoTime();
	locks.put(idReqLong, object_lock);
	sendPCEPMessage(pcreq);
	
	synchronized (object_lock) 
	{ 
		try 
		{				
			log.info("ESPERAREMOS "+maxTimeMs);
			object_lock.wait(maxTimeMs);
		} 
		catch (InterruptedException e)
		{
			UtilsFunctions.exceptionToString(e);
		}
	}
	
	long timeIni2=System.nanoTime();
	double reqTime_ms=(timeIni2-timeIni)/1000000;
	log.debug("Request or timeout");
	
	PCEPMessage resp = responses.remove(new Long(idRequest));
	if (resp==null)
	{
		log.warn("NO RESPONSE!!!!! me deshago del lock... con idReqLong "+idRequest);
		locks.remove(idReqLong);
	}
	return resp;
}
 
開發者ID:telefonicaid,項目名稱:netphony-pce,代碼行數:37,代碼來源:ClientRequestManager.java

示例2: initiate

import es.tid.util.UtilsFunctions; //導入方法依賴的package包/類
public PCEPMessage initiate ( PCEPInitiate pcini, long maxTimeMs)
{
	log.info("Sending Initiate:"+pcini.toString());
	
	byte[] LSPname=pcini.getPcepIntiatedLSPList().get(0).getLsp().getSymbolicPathNameTLV_tlv().getSymbolicPathNameID();
	long idIni=pcini.getPcepIntiatedLSPList().get(0).getRsp().getSRP_ID_number();
	System.out.println("Sending with id " +idIni);
	Long idReqLong=new Long(idIni);
	long timeIni=System.nanoTime();
	//System.out.println("id ini es "+)
	Semaphore semapohore=new Semaphore(0);
	semaphores.put(idIni, semapohore);
	sendPCEPMessage(pcini);
		
	try 
		{				
		semapohore.tryAcquire(maxTimeMs,TimeUnit.MILLISECONDS);
			
		} 
		catch (InterruptedException e)
		{
			UtilsFunctions.exceptionToString(e);
		}
	long timeIni2=System.nanoTime();
	//log.info("Response "+pr.toString());
	double reqTime_ms=(timeIni2-timeIni)/1000000;
	log.debug("Time: "+reqTime_ms );
	
	PCEPMessage resp=responsesInit.remove(new Long(idIni));
	if (resp==null){
		log.warn("NO RESPONSE!!!!! me deshago del lock... con idIni "+idIni);
		locks.remove(idReqLong);
	}
	return resp;
}
 
開發者ID:telefonicaid,項目名稱:netphony-pce,代碼行數:36,代碼來源:ClientRequestManager.java


注:本文中的es.tid.util.UtilsFunctions.exceptionToString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。