use of org.jivesoftware.openfire.ConnectionManager in project Openfire by igniterealtime.
the class ExternalComponentManager method setServiceEnabled.
/**
* @deprecated Obtain and use the corresponding {@link org.jivesoftware.openfire.spi.ConnectionListener} instead.
*/
@Deprecated
public static void setServiceEnabled(boolean enabled) throws ModificationNotAllowedException {
// Alert listeners about this event
for (ExternalComponentManagerListener listener : listeners) {
listener.serviceEnabled(enabled);
}
ConnectionManager connectionManager = XMPPServer.getInstance().getConnectionManager();
connectionManager.enableComponentListener(enabled);
}
use of org.jivesoftware.openfire.ConnectionManager in project Openfire by igniterealtime.
the class ExternalComponentManager method setServicePort.
/**
* @deprecated Obtain and use the corresponding {@link org.jivesoftware.openfire.spi.ConnectionListener} instead.
*/
@Deprecated
public static void setServicePort(int port) throws ModificationNotAllowedException {
// Alert listeners about this event
for (ExternalComponentManagerListener listener : listeners) {
listener.portChanged(port);
}
ConnectionManager connectionManager = XMPPServer.getInstance().getConnectionManager();
connectionManager.setComponentListenerPort(port);
}
use of org.jivesoftware.openfire.ConnectionManager in project Openfire by igniterealtime.
the class MulticastDNSService method start.
@Override
public void start() throws IllegalStateException {
// If the service isn't enabled, return.
if (!JiveGlobals.getBooleanProperty("multicastDNS.enabled", false)) {
return;
}
TimerTask startService = new TimerTask() {
@Override
public void run() {
int clientPortNum = -1;
int componentPortNum = -1;
final ConnectionManager connectionManager = XMPPServer.getInstance().getConnectionManager();
if (connectionManager != null) {
clientPortNum = connectionManager.getClientListenerPort();
componentPortNum = connectionManager.getComponentListenerPort();
}
try {
if (jmdns == null) {
jmdns = new JmDNS();
}
String serverName = XMPPServer.getInstance().getServerInfo().getXMPPDomain();
if (clientPortNum != -1) {
ServiceInfo clientService = new ServiceInfo("_xmpp-client._tcp.local.", serverName + "._xmpp-client._tcp.local.", clientPortNum, "XMPP Server");
jmdns.registerService(clientService);
}
if (componentPortNum != -1) {
ServiceInfo componentService = new ServiceInfo("_xmpp-component._tcp.local.", serverName + "._xmpp-component._tcp.local.", componentPortNum, "XMPP Component Server");
jmdns.registerService(componentService);
}
} catch (IOException ioe) {
Log.error(ioe.getMessage(), ioe);
}
}
};
// Schedule the task to run in 5 seconds, to give Wildire time to start the ports.
TaskEngine.getInstance().schedule(startService, 5000);
}
Aggregations