• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Log类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.jivesoftware.util.Log的典型用法代码示例。如果您正苦于以下问题:Java Log类的具体用法?Java Log怎么用?Java Log使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Log类属于org.jivesoftware.util包,在下文中一共展示了Log类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getSession

import org.jivesoftware.util.Log; //导入依赖的package包/类
Session getSession() {
    if (sessionType == SessionType.client) {
        return XMPPServer.getInstance().getRoutingTable().getClientRoute(address);
    }
    else if (sessionType == SessionType.component) {
        return SessionManager.getInstance().getComponentSession(address.getDomain());
    }
    else if (sessionType == SessionType.connectionManager) {
        return SessionManager.getInstance().getConnectionMultiplexerSession(address);
    }
    else if (sessionType == SessionType.outgoingServer) {
        return SessionManager.getInstance().getOutgoingServerSession(address.getDomain());
    }
    else if (sessionType == SessionType.incomingServer) {
        return SessionManager.getInstance().getIncomingServerSession(streamID);
    }
    Log.error("Found unknown session type: " + sessionType);
    return null;
}
 
开发者ID:idwanglu2010,项目名称:openfire,代码行数:20,代码来源:DeliverRawTextTask.java


示例2: setAllOffline

import org.jivesoftware.util.Log; //导入依赖的package包/类
public void setAllOffline()
{
    Connection con = null;
    PreparedStatement pstmt = null;

    try
    {
        con = DbConnectionManager.getConnection();
        pstmt = con.prepareStatement(SET_ALL_OFFLINE);
        pstmt.executeUpdate();
    }
    catch (SQLException e)
    {
        Log.error("Unable to clean up user status", e);
    }
    finally
    {
        DbConnectionManager.closeConnection(pstmt, con);
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:21,代码来源:DefaultPersistenceManager.java


示例3: setPresence

import org.jivesoftware.util.Log; //导入依赖的package包/类
public void setPresence(Session session, String presenceText)
{
    Connection con = null;
    PreparedStatement pstmt = null;

    try
    {
        con = DbConnectionManager.getConnection();
        pstmt = con.prepareStatement(SET_PRESENCE);
        pstmt.setString(1, presenceText);
        pstmt.setString(2, session.getAddress().getNode());
        pstmt.setString(3, session.getAddress().getResource());
        pstmt.executeUpdate();
    }
    catch (SQLException e)
    {
        Log.error("Unable to update presence for " + session.getAddress(), e);
    }
    finally
    {
        DbConnectionManager.closeConnection(pstmt, con);
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:24,代码来源:DefaultPersistenceManager.java


示例4: onEndPage

import org.jivesoftware.util.Log; //导入依赖的package包/类
@Override
public void onEndPage(PdfWriter writer, Document document) {
    PdfContentByte cb = writer.getDirectContent();

    try {
        cb.setColorStroke(new Color(156,156,156));
        cb.setLineWidth(2);
        cb.moveTo(document.leftMargin(), document.bottomMargin() + 32);
        cb.lineTo(document.getPageSize().width() - document.rightMargin(), document.bottomMargin() + 32);
        cb.stroke();

        Image gif = Image.getInstance("http://" + request.getServerName() +
            ":" + request.getServerPort() + "/plugins/"+MonitoringConstants.NAME+"/images/pdf_generatedbyof.gif");
        cb.addImage(gif, 221, 0, 0, 28, (int)document.leftMargin(), (int)document.bottomMargin());

    } catch (Exception e) {
        Log.error("error drawing PDF footer: " + e.getMessage());
    }
    cb.saveState();
    
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:22,代码来源:GraphServlet.java


示例5: stop

import org.jivesoftware.util.Log; //导入依赖的package包/类
public void stop() {
	IQRouter iqRouter = server.getIQRouter();
	IQDiscoInfoHandler iqDiscoInfoHandler = server.getIQDiscoInfoHandler();

	for (IQHandler iqHandler : iqHandlers) {
		element2Handlers.remove(iqHandler.getInfo().getName());
		try {
			iqHandler.stop();
			iqHandler.destroy();
		} catch (Exception e) {
			Log.warn("Unable to stop and destroy " + iqHandler.getClass());
		}

		if (iqHandler instanceof ServerFeaturesProvider) {
			for (Iterator<String> i = ((ServerFeaturesProvider) iqHandler)
					.getFeatures(); i.hasNext();) {
				if (iqDiscoInfoHandler != null) {
					iqDiscoInfoHandler.removeServerFeature(i.next());
				}
			}
		}
	}
	if (iqRouter != null) {
		iqRouter.removeHandler(iqDispatcher);
	}
}
 
开发者ID:idwanglu2010,项目名称:openfire,代码行数:27,代码来源:Xep0136Support.java


示例6: getActiveConversations

import org.jivesoftware.util.Log; //导入依赖的package包/类
public Collection<Conversation> getActiveConversations(int conversationTimeout) {
    final Collection<Conversation> conversations;
    final long now = System.currentTimeMillis();

    conversations = new ArrayList<Conversation>();

    Connection con = null;
    PreparedStatement pstmt = null;
    ResultSet rs = null;
    try {
        con = DbConnectionManager.getConnection();
        pstmt = con.prepareStatement( isOracleDB() ? SELECT_ACTIVE_CONVERSATIONS_ORACLE : SELECT_ACTIVE_CONVERSATIONS );

        pstmt.setLong(1, now - conversationTimeout * 60L * 1000L);
        rs = pstmt.executeQuery();
        while (rs.next()) {
            conversations.add(extractConversation(rs));
        }
    } catch (SQLException sqle) {
        Log.error("Error selecting conversations", sqle);
    } finally {
        DbConnectionManager.closeConnection(rs, pstmt, con);
    }

    return conversations;
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:27,代码来源:JdbcPersistenceManager.java


示例7: ProcessPacketTask

import org.jivesoftware.util.Log; //导入依赖的package包/类
protected ProcessPacketTask(RemoteSession remoteSession, JID address, Packet packet) {
    if (remoteSession instanceof RemoteClientSession) {
        this.sessionType = SessionType.client;
    }
    else if (remoteSession instanceof RemoteOutgoingServerSession) {
        this.sessionType = SessionType.outgoingServer;
    }
    else if (remoteSession instanceof RemoteComponentSession) {
        this.sessionType = SessionType.component;
    }
    else if (remoteSession instanceof RemoteConnectionMultiplexerSession) {
        this.sessionType = SessionType.connectionManager;
    }
    else {
        Log.error("Invalid RemoteSession was used for task: " + remoteSession);
    }
    this.address = address;
    this.packet = packet;
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:20,代码来源:ProcessPacketTask.java


示例8: init

import org.jivesoftware.util.Log; //导入依赖的package包/类
private void init(int maxSize, String name) {
    if (maxSize > 0) {
        setLowUnits((int)(maxSize*.9));
    }

    String delayProp = JiveGlobals.getProperty(FLUSH_DELAY_PROP);
    if (delayProp != null) {
        try {
            long delay = Long.parseLong(delayProp);
            if (delay >=0) {
                setFlushDelay((int)delay);
            }
        }
        catch (NumberFormatException nfe) {
            Log.warn("Unable to parse " + FLUSH_DELAY_PROP + " using default value of " + delayProp);
        }
    }

    this.name = name;
}
 
开发者ID:idwanglu2010,项目名称:openfire,代码行数:21,代码来源:CoherenceCache.java


示例9: cleanupDirectedPresences

import org.jivesoftware.util.Log; //导入依赖的package包/类
private void cleanupDirectedPresences(NodeID nodeID) {
    // Remove traces of directed presences sent from node that is gone to entities hosted in this JVM
    Map<String, Collection<String>> senders = nodePresences.remove(nodeID);
    if (senders != null) {
        for (Map.Entry<String, Collection<String>> entry : senders.entrySet()) {
            String sender = entry.getKey();
            Collection<String> receivers = entry.getValue();
            for (String receiver : receivers) {
                try {
                    Presence presence = new Presence(Presence.Type.unavailable);
                    presence.setFrom(sender);
                    presence.setTo(receiver);
                    XMPPServer.getInstance().getPresenceRouter().route(presence);
                }
                catch (PacketException e) {
                    Log.error(e);
                }
            }
        }
    }
}
 
开发者ID:idwanglu2010,项目名称:openfire,代码行数:22,代码来源:ClusterListener.java


示例10: DeliverRawTextTask

import org.jivesoftware.util.Log; //导入依赖的package包/类
protected DeliverRawTextTask(RemoteSession remoteSession, JID address, String text) {
    if (remoteSession instanceof RemoteClientSession) {
        this.sessionType = SessionType.client;
    }
    else if (remoteSession instanceof RemoteOutgoingServerSession) {
        Log.error("OutgoingServerSession used with DeliverRawTextTask; should be using DeliverRawTextServerTask: " + remoteSession);
        this.sessionType = SessionType.outgoingServer;
    }
    else if (remoteSession instanceof RemoteComponentSession) {
        this.sessionType = SessionType.component;
    }
    else if (remoteSession instanceof RemoteConnectionMultiplexerSession) {
        this.sessionType = SessionType.connectionManager;
    }
    else {
        Log.error("Invalid RemoteSession was used for task: " + remoteSession);
    }
    this.address = address;
    this.text = text;
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:21,代码来源:DeliverRawTextTask.java


示例11: getSession

import org.jivesoftware.util.Log; //导入依赖的package包/类
Session getSession() {
    if (sessionType == SessionType.client) {
        return XMPPServer.getInstance().getRoutingTable().getClientRoute(address);
    }
    else if (sessionType == SessionType.component) {
        return SessionManager.getInstance().getComponentSession(address.getDomain());
    }
    else if (sessionType == SessionType.connectionManager) {
        return SessionManager.getInstance().getConnectionMultiplexerSession(address);
    }
    else if (sessionType == SessionType.outgoingServer) {
        Log.error("Trying to write raw data to a server session across the cluster: " + address.toString());
        return null;
    }
    else if (sessionType == SessionType.incomingServer) {
        return SessionManager.getInstance().getIncomingServerSession(streamID);
    }
    Log.error("Found unknown session type: " + sessionType);
    return null;
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:21,代码来源:DeliverRawTextTask.java


示例12: get

import org.jivesoftware.util.Log; //导入依赖的package包/类
/**
 * Returns the data stored under a key corresponding to the name and namespace
 * of the given element. The Element must be in the form:<p>
 *
 * <code>&lt;name xmlns='namespace'/&gt;</code><p>
 * 
 * If no data is currently stored under the given key, an empty element will be
 * returned.
 *
 * @param data an XML document who's element name and namespace is used to
 *      match previously stored private data.
 * @param workgroupName the name of the workgroup who's data is to be stored.
 * @return the data stored under the given key or the data element.
 */
public Element get(String workgroupName, Element data) {
    data.clearContent();
    Connection con = null;
    PreparedStatement pstmt = null;
    ResultSet rs = null;
    try {
        con = DbConnectionManager.getConnection();
        pstmt = con.prepareStatement(LOAD_SETTINGS);
        pstmt.setString(1, workgroupName);
        pstmt.setString(2, data.getNamespaceURI());
        rs = pstmt.executeQuery();
        if (rs.next()) {
            Document document = DocumentHelper.parseText(rs.getString(1).trim());
            data = document.getRootElement();
        }
    }
    catch (Exception e) {
        Log.error(LocaleUtils.getLocalizedString("admin.error"), e);
    }
    finally {
        DbConnectionManager.closeConnection(rs, pstmt, con);
    }
    return data;
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:39,代码来源:WorkgroupSettings.java


示例13: setState

import org.jivesoftware.util.Log; //导入依赖的package包/类
public void setState(Workgroup workgroup, WorkgroupSettings workgroupSettings, QName namespace) {
    this.workgroupSettings = workgroupSettings;
    this.workgroup = workgroup;
    this.namespace = namespace;

    try {
        final Element element = workgroupSettings.get(workgroup.getJID().toBareJID(), DocumentHelper.createElement(namespace));
        final List list = element.elements();

        final Iterator iter = list.iterator();
        while (iter.hasNext()) {
            Element el = (Element)iter.next();
            addToSettings(el);
        }
    }
    catch (Exception ex) {
        Log.error(ex.getMessage(), ex);   
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:20,代码来源:SettingsManager.java


示例14: setMap

import org.jivesoftware.util.Log; //导入依赖的package包/类
public void setMap(Map map) {
    Element element = DocumentHelper.createElement(namespace);
    final Iterator i = element.elementIterator();
    while (i.hasNext()) {
        element.remove((Element)i.next());
    }
    final Iterator iter = map.keySet().iterator();
    while (iter.hasNext()) {
        String key = (String)iter.next();
        String value = (String)map.get(key);

        Element elem = DocumentHelper.createElement("entry");
        elem.addElement(key).setText(value);
        element.add(elem);
    }

    try {
        workgroupSettings.add(workgroup.getJID().toBareJID(), element);
    }
    catch (Exception ex) {
        Log.error(ex.getMessage(), ex);
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:24,代码来源:SettingsManager.java


示例15: messageReceived

import org.jivesoftware.util.Log; //导入依赖的package包/类
@Override
public void messageReceived(IoSession session, Object message) throws Exception {
       //System.out.println("RCVD: " + message);
       // Get the stanza handler for this session
       StanzaHandler handler = (StanzaHandler) session.getAttribute(HANDLER);
       // Get the parser to use to process stanza. For optimization there is going
       // to be a parser for each running thread. Each Filter will be executed
       // by the Executor placed as the first Filter. So we can have a parser associated
       // to each Thread
       int hashCode = Thread.currentThread().hashCode();
       XmlPullParser parser = parsers.get(hashCode);
       if (parser == null) {
           parser = factory.newPullParser();
           parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
           parsers.put(hashCode, parser);
       }

       // Let the stanza handler process the received stanza
       try {
           handler.process( (String) message, parser);
       } catch (Exception e) {
           Log.error("Closing connection due to error while processing message: " + message, e);
           Connection connection = (Connection) session.getAttribute(CONNECTION);
           connection.close();
       }
   }
 
开发者ID:igniterealtime,项目名称:Openfire-connectionmanager,代码行数:27,代码来源:ConnectionHandler.java


示例16: onEndPage

import org.jivesoftware.util.Log; //导入依赖的package包/类
@Override
public void onEndPage(PdfWriter writer, Document document) {
          PdfContentByte cb = writer.getDirectContent();

          try {
              cb.setColorStroke(new Color(156,156,156));
              cb.setLineWidth(2);
              cb.moveTo(document.leftMargin(), document.bottomMargin() + 32);
              cb.lineTo(document.getPageSize().width() - document.rightMargin(), document.bottomMargin() + 32);
              cb.stroke();

              Image gif = Image.getInstance("http://" + request.getServerName() +
                  ":" + request.getServerPort() + "/plugins/"+MonitoringConstants.NAME+"/images/pdf_generatedbyof.gif");
              cb.addImage(gif, 221, 0, 0, 28, (int)document.leftMargin(), (int)document.bottomMargin());

          } catch (Exception e) {
              Log.error("error drawing PDF footer: " + e.getMessage());
          }
          cb.saveState();
          
      }
 
开发者ID:idwanglu2010,项目名称:openfire,代码行数:22,代码来源:GraphServlet.java


示例17: start

import org.jivesoftware.util.Log; //导入依赖的package包/类
public void start() {
    File databaseDir = new File(JiveGlobals.getHomeDirectory(), File.separator + "embedded-db");
    // If the database doesn't exist, create it.
    if (!databaseDir.exists()) {
        databaseDir.mkdirs();
    }

    try {
        serverURL = "jdbc:hsqldb:" + databaseDir.getCanonicalPath() + File.separator + "openfire";
    }
    catch (IOException ioe) {
        Log.error("EmbeddedConnectionProvider: Error starting connection pool: ", ioe);
    }
    proxoolURL = "proxool.openfire:"+driver+":"+serverURL;
    settings = new Properties();
    settings.setProperty("proxool.maximum-connection-count", "25");
    settings.setProperty("proxool.minimum-connection-count", "3");
    settings.setProperty("proxool.maximum-connection-lifetime", Integer.toString((int)(86400000 * 0.5)));
    settings.setProperty("user", "sa");
    settings.setProperty("password", "");
}
 
开发者ID:coodeer,项目名称:g3server,代码行数:22,代码来源:EmbeddedConnectionProvider.java


示例18: destroy

import org.jivesoftware.util.Log; //导入依赖的package包/类
public void destroy() {
    // Shutdown the database.
    Connection con = null;
    PreparedStatement pstmt = null;
    try {
        con = getConnection();
        pstmt = con.prepareStatement("SHUTDOWN");
        pstmt.execute();
    }
    catch (SQLException sqle) {
        Log.error(sqle.getMessage(), sqle);
    }
    finally {
        DbConnectionManager.closeConnection(pstmt, con);
    }
    // Blank out the settings
    settings = null;
}
 
开发者ID:coodeer,项目名称:g3server,代码行数:19,代码来源:EmbeddedConnectionProvider.java


示例19: onEndPage

import org.jivesoftware.util.Log; //导入依赖的package包/类
@Override
public void onEndPage(PdfWriter writer, Document document) {
          PdfContentByte cb = writer.getDirectContent();

          try {
              cb.setColorStroke(new Color(156,156,156));
              cb.setLineWidth(2);
              cb.moveTo(document.leftMargin(), document.bottomMargin() + 32);
              cb.lineTo(document.getPageSize().width() - document.rightMargin(), document.bottomMargin() + 32);
              cb.stroke();

              Image gif = Image.getInstance("http://" + request.getServerName() +
                  ":" + request.getServerPort() + "/plugins/monitoring/images/pdf_generatedbyof.gif");
              cb.addImage(gif, 221, 0, 0, 28, (int)document.leftMargin(), (int)document.bottomMargin());

          } catch (Exception e) {
              Log.error("error drawing PDF footer: " + e.getMessage());
          }
          cb.saveState();
          
      }
 
开发者ID:coodeer,项目名称:g3server,代码行数:22,代码来源:GraphServlet.java


示例20: DeliverRawTextTask

import org.jivesoftware.util.Log; //导入依赖的package包/类
protected DeliverRawTextTask(RemoteSession remoteSession, JID address, String text) {
    if (remoteSession instanceof RemoteClientSession) {
        this.sessionType = SessionType.client;
    }
    else if (remoteSession instanceof RemoteOutgoingServerSession) {
        this.sessionType = SessionType.outgoingServer;
    }
    else if (remoteSession instanceof RemoteComponentSession) {
        this.sessionType = SessionType.component;
    }
    else if (remoteSession instanceof RemoteConnectionMultiplexerSession) {
        this.sessionType = SessionType.connectionManager;
    }
    else {
        Log.error("Invalid RemoteSession was used for task: " + remoteSession);
    }
    this.address = address;
    this.text = text;
}
 
开发者ID:coodeer,项目名称:g3server,代码行数:20,代码来源:DeliverRawTextTask.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RefreshQueuesRequest类代码示例发布时间:2022-05-22
下一篇:
Java SubmitApplicationRequestProto类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap