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