org.cybergarage.util.Debug.warning()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(233)

本文整理了Java中org.cybergarage.util.Debug.warning()方法的一些代码示例,展示了Debug.warning()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Debug.warning()方法的具体详情如下:
包路径:org.cybergarage.util.Debug
类名称:Debug
方法名:warning

Debug.warning介绍

暂无

代码示例

代码示例来源:origin: i2p/i2p.i2p

  1. public synchronized void lock()
  2. {
  3. while(syncLock == true) {
  4. try {
  5. wait();
  6. }
  7. catch (Exception e) {
  8. Debug.warning(e);
  9. };
  10. }
  11. syncLock = true;
  12. }

代码示例来源:origin: i2p/i2p.i2p

  1. public final static int toInteger(String value)
  2. {
  3. try {
  4. return Integer.parseInt(value);
  5. }
  6. catch (Exception e) {
  7. Debug.warning(e);
  8. }
  9. return 0;
  10. }

代码示例来源:origin: i2p/i2p.i2p

  1. public final static long toLong(String value)
  2. {
  3. try {
  4. return Long.parseLong(value);
  5. }
  6. catch (Exception e) {
  7. Debug.warning(e);
  8. }
  9. return 0;
  10. }

代码示例来源:origin: i2p/i2p.i2p

  1. public boolean close()
  2. {
  3. if (ssdpUniSock == null)
  4. return true;
  5. try {
  6. ssdpUniSock.close();
  7. ssdpUniSock = null;
  8. }
  9. catch (Exception e) {
  10. Debug.warning(e);
  11. return false;
  12. }
  13. return true;
  14. }

代码示例来源:origin: i2p/i2p.i2p

  1. public boolean close()
  2. {
  3. if (serverSock == null)
  4. return true;
  5. try {
  6. serverSock.close();
  7. serverSock = null;
  8. bindAddr = null;
  9. bindPort = 0;
  10. }
  11. catch (Exception e) {
  12. Debug.warning(e);
  13. return false;
  14. }
  15. return true;
  16. }

代码示例来源:origin: i2p/i2p.i2p

  1. public boolean open(String addr, int port)
  2. {
  3. if (serverSock != null)
  4. return true;
  5. try {
  6. bindAddr = InetAddress.getByName(addr);
  7. bindPort = port;
  8. serverSock = new ServerSocket(bindPort, 0, bindAddr);
  9. }
  10. catch (IOException e) {
  11. Debug.warning("HTTP server open failed " + addr + " " + port, e);
  12. return false;
  13. }
  14. return true;
  15. }

代码示例来源:origin: i2p/i2p.i2p

  1. public boolean open()
  2. {
  3. close();
  4. try {
  5. ssdpUniSock = new DatagramSocket();
  6. }
  7. catch (Exception e) {
  8. Debug.warning(e);
  9. return false;
  10. }
  11. return true;
  12. }

代码示例来源:origin: i2p/i2p.i2p

  1. public final static byte[] load(String fileName)
  2. {
  3. try {
  4. FileInputStream fin=new FileInputStream(fileName);
  5. return load(fin);
  6. }
  7. catch (Exception e) {
  8. Debug.warning(e);
  9. return new byte[0];
  10. }
  11. }

代码示例来源:origin: i2p/i2p.i2p

  1. public final static byte[] load(File file)
  2. {
  3. try {
  4. FileInputStream fin=new FileInputStream(file);
  5. return load(fin);
  6. }
  7. catch (Exception e) {
  8. Debug.warning(e);
  9. return new byte[0];
  10. }
  11. }

代码示例来源:origin: i2p/i2p.i2p

  1. public boolean open(String addr, int port, String bindAddr)
  2. {
  3. try {
  4. return open(addr,port,InetAddress.getByName(bindAddr));
  5. }catch (Exception e) {
  6. Debug.warning(e);
  7. return false;
  8. }
  9. }

代码示例来源:origin: i2p/i2p.i2p

  1. public boolean post(String addr, int port, String msg)
  2. {
  3. try {
  4. InetAddress inetAddr = InetAddress.getByName(addr);
  5. DatagramPacket dgmPacket = new DatagramPacket(msg.getBytes(), msg.length(), inetAddr, port);
  6. ssdpUniSock.send(dgmPacket);
  7. }
  8. catch (Exception e) {
  9. Debug.warning("addr = " +ssdpUniSock.getLocalAddress().getHostName());
  10. Debug.warning("port = " + ssdpUniSock.getLocalPort());
  11. Debug.warning(e);
  12. return false;
  13. }
  14. return true;
  15. }

代码示例来源:origin: i2p/i2p.i2p

  1. public String getContentString()
  2. {
  3. String charSet = getCharSet();
  4. if (charSet == null || charSet.length() <= 0)
  5. return new String(content);
  6. try {
  7. return new String(content, charSet);
  8. }
  9. catch (Exception e) {
  10. Debug.warning(e);
  11. }
  12. return new String(content);
  13. }

代码示例来源:origin: i2p/i2p.i2p

  1. public final static byte[] load(FileInputStream fin)
  2. {
  3. byte readBuf[] = new byte[512*1024];
  4. try {
  5. ByteArrayOutputStream bout = new ByteArrayOutputStream();
  6. int readCnt = fin.read(readBuf);
  7. while (0 < readCnt) {
  8. bout.write(readBuf, 0, readCnt);
  9. readCnt = fin.read(readBuf);
  10. }
  11. fin.close();
  12. return bout.toByteArray();
  13. }
  14. catch (Exception e) {
  15. Debug.warning(e);
  16. return new byte[0];
  17. }
  18. }

代码示例来源:origin: i2p/i2p.i2p

  1. public final static int getLeaseTime(String cacheCont){
  2. /*
  3. * Search for max-age keyword instead of equals sign Found value of
  4. * max-age ends at next comma or end of string
  5. */
  6. int mx = 0;
  7. int maxAgeIdx = cacheCont.indexOf("max-age");
  8. if (maxAgeIdx >= 0) {
  9. int endIdx = cacheCont.indexOf(',',maxAgeIdx);
  10. if (endIdx < 0)
  11. endIdx = cacheCont.length();
  12. try {
  13. maxAgeIdx = cacheCont.indexOf("=",maxAgeIdx);
  14. String mxStr = cacheCont.substring(maxAgeIdx+1,endIdx).trim();
  15. mx = Integer.parseInt(mxStr);
  16. } catch (Exception e) {
  17. Debug.warning (e);
  18. }
  19. }
  20. return mx;
  21. }
  22. }

代码示例来源:origin: i2p/i2p.i2p

  1. /**
  2. * @param addr {@link String} rappresenting the multicast hostname to join into.
  3. * @param port int rappresenting the port to be use poth as source and destination
  4. * @param bindAddr {@link InetAddress} which identify the hostname of the interface
  5. * to use for sending and recieving multicast packet
  6. */
  7. public boolean open(String addr,int port, InetAddress bindAddr){
  8. try {
  9. ssdpMultiSock = new MulticastSocket(null);
  10. ssdpMultiSock.setReuseAddress(true);
  11. InetSocketAddress bindSockAddr = new InetSocketAddress(port);
  12. ssdpMultiSock.bind(bindSockAddr);
  13. ssdpMultiGroup = new InetSocketAddress(InetAddress.getByName(addr), port);
  14. ssdpMultiIf = NetworkInterface.getByInetAddress(bindAddr);
  15. ssdpMultiSock.joinGroup(ssdpMultiGroup, ssdpMultiIf);
  16. }
  17. catch (Exception e) {
  18. Debug.warning(e);
  19. return false;
  20. }
  21. return true;
  22. }

代码示例来源:origin: i2p/i2p.i2p

  1. private synchronized Node getRootNode()
  2. {
  3. if (rootNode != null)
  4. return rootNode;
  5. try {
  6. byte content[] = getContent();
  7. ByteArrayInputStream contentIn = new ByteArrayInputStream(content);
  8. Parser parser = SOAP.getXMLParser();
  9. rootNode = parser.parse(contentIn);
  10. }
  11. catch (ParserException e) {
  12. Debug.warning(e);
  13. }
  14. return rootNode;
  15. }

代码示例来源:origin: i2p/i2p.i2p

  1. public boolean send(String msg, String bindAddr, int bindPort)
  2. {
  3. MulticastSocket msock = null;
  4. try {
  5. if ((bindAddr) != null && (0 < bindPort)) {
  6. msock = new MulticastSocket(null);
  7. msock.bind(new InetSocketAddress(bindAddr, bindPort));
  8. }else{
  9. msock = new MulticastSocket();
  10. }
  11. DatagramPacket dgmPacket = new DatagramPacket(msg.getBytes(), msg.length(), ssdpMultiGroup);
  12. // Thnaks for Theo Beisch (11/09/04)
  13. msock.setTimeToLive(UPnP.getTimeToLive());
  14. msock.send(dgmPacket);
  15. }
  16. catch (Exception e) {
  17. Debug.warning(e);
  18. return false;
  19. } finally {
  20. if (msock != null) msock.close();
  21. }
  22. return true;
  23. }

代码示例来源:origin: i2p/i2p.i2p

  1. public void performNotifyListener(SSDPPacket ssdpPacket)
  2. {
  3. int listenerSize = deviceNotifyListenerList.size();
  4. for (int n=0; n<listenerSize; n++) {
  5. NotifyListener listener = (NotifyListener)deviceNotifyListenerList.get(n);
  6. try{
  7. listener.deviceNotifyReceived(ssdpPacket);
  8. }catch(Exception e){
  9. Debug.warning("NotifyListener returned an error:", e);
  10. }
  11. }
  12. }

代码示例来源:origin: i2p/i2p.i2p

  1. public void performSearchResponseListener(SSDPPacket ssdpPacket)
  2. {
  3. int listenerSize = deviceSearchResponseListenerList.size();
  4. for (int n=0; n<listenerSize; n++) {
  5. SearchResponseListener listener = (SearchResponseListener)deviceSearchResponseListenerList.get(n);
  6. try{
  7. listener.deviceSearchResponseReceived(ssdpPacket);
  8. }catch(Exception e){
  9. Debug.warning("SearchResponseListener returned an error:", e);
  10. }
  11. }
  12. }

代码示例来源:origin: i2p/i2p.i2p

  1. public SOAPResponse postMessage(String host, int port)
  2. {
  3. HTTPResponse httpRes = post(host, port);
  4. SOAPResponse soapRes = new SOAPResponse(httpRes);
  5. byte content[] = soapRes.getContent();
  6. if (content.length <= 0)
  7. return soapRes;
  8. try {
  9. ByteArrayInputStream byteIn = new ByteArrayInputStream(content);
  10. Parser xmlParser = SOAP.getXMLParser();
  11. Node rootNode = xmlParser.parse(byteIn);
  12. soapRes.setEnvelopeNode(rootNode);
  13. }
  14. catch (Exception e) {
  15. Debug.warning(e);
  16. }
  17. return soapRes;
  18. }

相关文章