Adds static init - Makes the disco feature available by default on every connection

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2182 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Gaston Dombiak 2003-12-19 17:59:55 +00:00 committed by gdombiak
parent a42e3c2742
commit 7eba4a484b
1 changed files with 9 additions and 0 deletions

View File

@ -77,6 +77,15 @@ public class ServiceDiscoveryManager {
private XMPPConnection connection;
private List features = new ArrayList();
// Create a new ServiceDiscoveryManager on every established connection
static {
XMPPConnection.addConnectionListener(new ConnectionEstablishedListener() {
public void connectionEstablished(XMPPConnection connection) {
new ServiceDiscoveryManager(connection);
}
});
}
/**
* Creates a new ServiceDiscoveryManager for a given XMPPConnection. This means that the
* service manager will respond to any service discovery request that the connection may