Commit e2c2e2e6 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Refactoring wortk. JM-924

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@6546 b35dd754-fafc-0310-a699-88a17e54d16e
parent 8eb2f1c2
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* $Revision: 580 $ * $Revision: 580 $
* $Date: 2004-12-01 18:46:33 -0300 (Wed, 01 Dec 2004) $ * $Date: 2004-12-01 18:46:33 -0300 (Wed, 01 Dec 2004) $
* *
* Copyright (C) 2004-2006 Jive Software. All rights reserved. * Copyright (C) 2004-2007 Jive Software. All rights reserved.
* *
* This software is published under the terms of the GNU Public License (GPL), * This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution. * a copy of which is included in this distribution.
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
package org.jivesoftware.wildfire; package org.jivesoftware.wildfire;
import org.jivesoftware.wildfire.session.Session;
import java.util.Comparator; import java.util.Comparator;
import java.util.Date; import java.util.Date;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* $Revision: 3128 $ * $Revision: 3128 $
* $Date: 2005-11-30 15:31:54 -0300 (Wed, 30 Nov 2005) $ * $Date: 2005-11-30 15:31:54 -0300 (Wed, 30 Nov 2005) $
* *
* Copyright (C) 2004-2006 Jive Software. All rights reserved. * Copyright (C) 2004-2007 Jive Software. All rights reserved.
* *
* This software is published under the terms of the GNU Public License (GPL), * This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution. * a copy of which is included in this distribution.
...@@ -16,7 +16,10 @@ import org.dom4j.DocumentException; ...@@ -16,7 +16,10 @@ import org.dom4j.DocumentException;
import org.dom4j.DocumentHelper; import org.dom4j.DocumentHelper;
import org.jivesoftware.database.DbConnectionManager; import org.jivesoftware.database.DbConnectionManager;
import org.jivesoftware.util.*; import org.jivesoftware.util.*;
import org.jivesoftware.wildfire.*; import org.jivesoftware.wildfire.PacketDeliverer;
import org.jivesoftware.wildfire.PresenceManager;
import org.jivesoftware.wildfire.SessionManager;
import org.jivesoftware.wildfire.XMPPServer;
import org.jivesoftware.wildfire.auth.UnauthorizedException; import org.jivesoftware.wildfire.auth.UnauthorizedException;
import org.jivesoftware.wildfire.component.InternalComponentManager; import org.jivesoftware.wildfire.component.InternalComponentManager;
import org.jivesoftware.wildfire.container.BasicModule; import org.jivesoftware.wildfire.container.BasicModule;
...@@ -26,6 +29,7 @@ import org.jivesoftware.wildfire.privacy.PrivacyListManager; ...@@ -26,6 +29,7 @@ import org.jivesoftware.wildfire.privacy.PrivacyListManager;
import org.jivesoftware.wildfire.roster.Roster; import org.jivesoftware.wildfire.roster.Roster;
import org.jivesoftware.wildfire.roster.RosterItem; import org.jivesoftware.wildfire.roster.RosterItem;
import org.jivesoftware.wildfire.roster.RosterManager; import org.jivesoftware.wildfire.roster.RosterManager;
import org.jivesoftware.wildfire.session.ClientSession;
import org.jivesoftware.wildfire.user.User; import org.jivesoftware.wildfire.user.User;
import org.jivesoftware.wildfire.user.UserManager; import org.jivesoftware.wildfire.user.UserManager;
import org.jivesoftware.wildfire.user.UserNotFoundException; import org.jivesoftware.wildfire.user.UserNotFoundException;
...@@ -34,7 +38,6 @@ import org.xmpp.packet.JID; ...@@ -34,7 +38,6 @@ import org.xmpp.packet.JID;
import org.xmpp.packet.PacketError; import org.xmpp.packet.PacketError;
import org.xmpp.packet.Presence; import org.xmpp.packet.Presence;
import java.sql.Connection;
import java.sql.*; import java.sql.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
...@@ -72,9 +75,6 @@ public class PresenceManagerImpl extends BasicModule implements PresenceManager ...@@ -72,9 +75,6 @@ public class PresenceManagerImpl extends BasicModule implements PresenceManager
public PresenceManagerImpl() { public PresenceManagerImpl() {
super("Presence manager"); super("Presence manager");
// Use component manager for Presence Updates.
componentManager = InternalComponentManager.getInstance();
} }
public boolean isAvailable(User user) { public boolean isAvailable(User user) {
...@@ -261,7 +261,7 @@ public class PresenceManagerImpl extends BasicModule implements PresenceManager ...@@ -261,7 +261,7 @@ public class PresenceManagerImpl extends BasicModule implements PresenceManager
pstmt.execute(); pstmt.execute();
} }
catch (SQLException sqle) { catch (SQLException sqle) {
Log.error(sqle); Log.error("Error storing offline presence of user: " + username, sqle);
} }
finally { finally {
DbConnectionManager.closeConnection(pstmt, con); DbConnectionManager.closeConnection(pstmt, con);
...@@ -477,6 +477,13 @@ public class PresenceManagerImpl extends BasicModule implements PresenceManager ...@@ -477,6 +477,13 @@ public class PresenceManagerImpl extends BasicModule implements PresenceManager
rosterManager = server.getRosterManager(); rosterManager = server.getRosterManager();
} }
public void start() throws IllegalStateException {
super.start();
// Use component manager for Presence Updates.
componentManager = InternalComponentManager.getInstance();
}
public void stop() { public void stop() {
// Clear the caches when stopping the module. // Clear the caches when stopping the module.
offlinePresenceCache.clear(); offlinePresenceCache.clear();
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* $Revision: 3138 $ * $Revision: 3138 $
* $Date: 2005-12-01 02:13:26 -0300 (Thu, 01 Dec 2005) $ * $Date: 2005-12-01 02:13:26 -0300 (Thu, 01 Dec 2005) $
* *
* Copyright (C) 2004 Jive Software. All rights reserved. * Copyright (C) 2007 Jive Software. All rights reserved.
* *
* This software is published under the terms of the GNU Public License (GPL), * This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution. * a copy of which is included in this distribution.
...@@ -12,10 +12,14 @@ ...@@ -12,10 +12,14 @@
package org.jivesoftware.wildfire.spi; package org.jivesoftware.wildfire.spi;
import org.jivesoftware.util.Log; import org.jivesoftware.util.Log;
import org.jivesoftware.wildfire.*; import org.jivesoftware.wildfire.ChannelHandler;
import org.jivesoftware.wildfire.RoutableChannelHandler;
import org.jivesoftware.wildfire.RoutingTable;
import org.jivesoftware.wildfire.XMPPServer;
import org.jivesoftware.wildfire.component.InternalComponentManager; import org.jivesoftware.wildfire.component.InternalComponentManager;
import org.jivesoftware.wildfire.container.BasicModule; import org.jivesoftware.wildfire.container.BasicModule;
import org.jivesoftware.wildfire.server.OutgoingSessionPromise; import org.jivesoftware.wildfire.server.OutgoingSessionPromise;
import org.jivesoftware.wildfire.session.ClientSession;
import org.xmpp.packet.JID; import org.xmpp.packet.JID;
import java.util.*; import java.util.*;
...@@ -41,7 +45,6 @@ public class RoutingTableImpl extends BasicModule implements RoutingTable { ...@@ -41,7 +45,6 @@ public class RoutingTableImpl extends BasicModule implements RoutingTable {
public RoutingTableImpl() { public RoutingTableImpl() {
super("Routing table"); super("Routing table");
componentManager = InternalComponentManager.getInstance();
} }
public void addRoute(JID node, RoutableChannelHandler destination) { public void addRoute(JID node, RoutableChannelHandler destination) {
...@@ -261,4 +264,9 @@ public class RoutingTableImpl extends BasicModule implements RoutingTable { ...@@ -261,4 +264,9 @@ public class RoutingTableImpl extends BasicModule implements RoutingTable {
super.initialize(server); super.initialize(server);
serverName = server.getServerInfo().getName(); serverName = server.getServerInfo().getName();
} }
public void start() throws IllegalStateException {
super.start();
componentManager = InternalComponentManager.getInstance();
}
} }
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* $Revision: $ * $Revision: $
* $Date: $ * $Date: $
* *
* Copyright (C) 2006 Jive Software. All rights reserved. * Copyright (C) 2007 Jive Software. All rights reserved.
* *
* This software is published under the terms of the GNU Public License (GPL), * This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution. * a copy of which is included in this distribution.
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
package org.jivesoftware.wildfire.user; package org.jivesoftware.wildfire.user;
import org.jivesoftware.wildfire.ClientSession; import org.jivesoftware.wildfire.session.ClientSession;
import org.xmpp.packet.Presence; import org.xmpp.packet.Presence;
import java.util.List; import java.util.List;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* $Revision: $ * $Revision: $
* $Date: $ * $Date: $
* *
* Copyright (C) 2006 Jive Software. All rights reserved. * Copyright (C) 2007 Jive Software. All rights reserved.
* *
* This software is published under the terms of the GNU Public License (GPL), * This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution. * a copy of which is included in this distribution.
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
package org.jivesoftware.wildfire.user; package org.jivesoftware.wildfire.user;
import org.jivesoftware.wildfire.ClientSession; import org.jivesoftware.wildfire.session.ClientSession;
import org.xmpp.packet.Presence; import org.xmpp.packet.Presence;
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment