/** * $RCSfile$ * $Revision: 3144 $ * $Date: 2005-12-01 14:20:11 -0300 (Thu, 01 Dec 2005) $ * * Copyright (C) 2004-2008 Jive Software. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.jivesoftware.openfire; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.lang.reflect.Method; import java.net.InetAddress; import java.net.UnknownHostException; import java.security.KeyStore; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.Collection; import java.util.Date; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.concurrent.CopyOnWriteArrayList; import org.dom4j.Document; import org.dom4j.io.SAXReader; import org.jivesoftware.database.DbConnectionManager; import org.jivesoftware.openfire.admin.AdminManager; import org.jivesoftware.openfire.audit.AuditManager; import org.jivesoftware.openfire.audit.spi.AuditManagerImpl; import org.jivesoftware.openfire.clearspace.ClearspaceManager; import org.jivesoftware.openfire.cluster.NodeID; import org.jivesoftware.openfire.commands.AdHocCommandHandler; import org.jivesoftware.openfire.component.InternalComponentManager; import org.jivesoftware.openfire.container.AdminConsolePlugin; import org.jivesoftware.openfire.container.Module; import org.jivesoftware.openfire.container.PluginManager; import org.jivesoftware.openfire.disco.IQDiscoInfoHandler; import org.jivesoftware.openfire.disco.IQDiscoItemsHandler; import org.jivesoftware.openfire.disco.ServerFeaturesProvider; import org.jivesoftware.openfire.disco.ServerIdentitiesProvider; import org.jivesoftware.openfire.disco.ServerItemsProvider; import org.jivesoftware.openfire.disco.UserIdentitiesProvider; import org.jivesoftware.openfire.disco.UserItemsProvider; import org.jivesoftware.openfire.filetransfer.DefaultFileTransferManager; import org.jivesoftware.openfire.filetransfer.FileTransferManager; import org.jivesoftware.openfire.filetransfer.proxy.FileTransferProxy; import org.jivesoftware.openfire.handler.IQAuthHandler; import org.jivesoftware.openfire.handler.IQBindHandler; import org.jivesoftware.openfire.handler.IQHandler; import org.jivesoftware.openfire.handler.IQLastActivityHandler; import org.jivesoftware.openfire.handler.IQOfflineMessagesHandler; import org.jivesoftware.openfire.handler.IQPingHandler; import org.jivesoftware.openfire.handler.IQPrivacyHandler; import org.jivesoftware.openfire.handler.IQPrivateHandler; import org.jivesoftware.openfire.handler.IQRegisterHandler; import org.jivesoftware.openfire.handler.IQRosterHandler; import org.jivesoftware.openfire.handler.IQSessionEstablishmentHandler; import org.jivesoftware.openfire.handler.IQSharedGroupHandler; import org.jivesoftware.openfire.handler.IQTimeHandler; import org.jivesoftware.openfire.handler.IQVersionHandler; import org.jivesoftware.openfire.handler.IQvCardHandler; import org.jivesoftware.openfire.handler.PresenceSubscribeHandler; import org.jivesoftware.openfire.handler.PresenceUpdateHandler; import org.jivesoftware.openfire.lockout.LockOutManager; import org.jivesoftware.openfire.mediaproxy.MediaProxyService; import org.jivesoftware.openfire.muc.MultiUserChatManager; import org.jivesoftware.openfire.net.MulticastDNSService; import org.jivesoftware.openfire.net.SSLConfig; import org.jivesoftware.openfire.net.ServerTrafficCounter; import org.jivesoftware.openfire.pep.IQPEPHandler; import org.jivesoftware.openfire.pep.IQPEPOwnerHandler; import org.jivesoftware.openfire.pubsub.PubSubModule; import org.jivesoftware.openfire.roster.RosterManager; import org.jivesoftware.openfire.session.RemoteSessionLocator; import org.jivesoftware.openfire.spi.ConnectionManagerImpl; import org.jivesoftware.openfire.spi.PacketDelivererImpl; import org.jivesoftware.openfire.spi.PacketRouterImpl; import org.jivesoftware.openfire.spi.PacketTransporterImpl; import org.jivesoftware.openfire.spi.PresenceManagerImpl; import org.jivesoftware.openfire.spi.RoutingTableImpl; import org.jivesoftware.openfire.spi.XMPPServerInfoImpl; import org.jivesoftware.openfire.transport.TransportHandler; import org.jivesoftware.openfire.update.UpdateManager; import org.jivesoftware.openfire.user.UserManager; import org.jivesoftware.openfire.vcard.VCardManager; import org.jivesoftware.util.CertificateManager; import org.jivesoftware.util.InitializationException; import org.jivesoftware.util.JiveGlobals; import org.jivesoftware.util.LocaleUtils; import org.jivesoftware.util.TaskEngine; import org.jivesoftware.util.Version; import org.jivesoftware.util.cache.CacheFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.xmpp.packet.JID; /** * The main XMPP server that will load, initialize and start all the server's * modules. The server is unique in the JVM and could be obtained by using the * {@link #getInstance()} method.
*
* The loaded modules will be initialized and may access through the server other * modules. This means that the only way for a module to locate another module is * through the server. The server maintains a list of loaded modules.*
* After starting up all the modules the server will load any available plugin. * For more information see: {@link org.jivesoftware.openfire.container.PluginManager}.*
* A configuration file keeps the server configuration. This information is required for the * server to work correctly. The server assumes that the configuration file is named * openfire.xml and is located in the conf folder. The folder that keeps * the configuration file must be located under the home folder. The server will try different * methods to locate the home folder. * *Following the loading and initialization of all the modules * this method is called to iterate through the known modules and * start them.
*/ private void startModules() { for (Module module : modules.values()) { boolean started = false; try { module.start(); } catch (Exception e) { if (started && module != null) { module.stop(); module.destroy(); } Log.error(LocaleUtils.getLocalizedString("admin.error"), e); } } } /** * Restarts the server and all it's modules only if the server is restartable. Otherwise do * nothing. */ public void restart() { if (isStandAlone() && isRestartable()) { try { Class wrapperClass = Class.forName(WRAPPER_CLASSNAME); Method restartMethod = wrapperClass.getMethod("restart", (Class []) null); restartMethod.invoke(null, (Object []) null); } catch (Exception e) { Log.error("Could not restart container", e); } } } /** * Restarts the HTTP server only when running in stand alone mode. The restart * process will be done in another thread that will wait 1 second before doing * the actual restart. The delay will give time to the page that requested the * restart to fully render its content. */ public void restartHTTPServer() { Thread restartThread = new Thread() { @Override public void run() { if (isStandAlone()) { // Restart the HTTP server manager. This covers the case // of changing the ports, as well as generating self-signed certificates. // Wait a short period before shutting down the admin console. // Otherwise, this page won't render properly! try { Thread.sleep(1000); ((AdminConsolePlugin) pluginManager.getPlugin("admin")).shutdown(); ((AdminConsolePlugin) pluginManager.getPlugin("admin")).startup(); } catch (Exception e) { e.printStackTrace(); } } } }; restartThread.setContextClassLoader(loader); restartThread.start(); } /** * Stops the server only if running in standalone mode. Do nothing if the server is running * inside of another server. */ public void stop() { // Only do a system exit if we're running standalone if (isStandAlone()) { // if we're in a wrapper, we have to tell the wrapper to shut us down if (isRestartable()) { try { Class wrapperClass = Class.forName(WRAPPER_CLASSNAME); Method stopMethod = wrapperClass.getMethod("stop", Integer.TYPE); stopMethod.invoke(null, 0); } catch (Exception e) { Log.error("Could not stop container", e); } } else { shutdownServer(); Thread shutdownThread = new ShutdownThread(); shutdownThread.setDaemon(true); shutdownThread.start(); } } else { // Close listening socket no matter what the condition is in order to be able // to be restartable inside a container. shutdownServer(); } } public boolean isSetupMode() { return setupMode; } public boolean isRestartable() { boolean restartable; try { restartable = Class.forName(WRAPPER_CLASSNAME) != null; } catch (ClassNotFoundException e) { restartable = false; } return restartable; } /** * Returns if the server is running in standalone mode. We consider that it's running in * standalone if the "org.jivesoftware.openfire.starter.ServerStarter" class is present in the * system. * * @return true if the server is running in standalone mode. */ public boolean isStandAlone() { boolean standalone; try { standalone = Class.forName(STARTER_CLASSNAME) != null; } catch (ClassNotFoundException e) { standalone = false; } return standalone; } /** * Verify that the database is accessible. */ private void verifyDataSource() { Connection con = null; PreparedStatement pstmt = null; ResultSet rs = null; try { con = DbConnectionManager.getConnection(); pstmt = con.prepareStatement("SELECT count(*) FROM ofID"); rs = pstmt.executeQuery(); rs.next(); } catch (Exception e) { System.err.println("Database setup or configuration error: " + "Please verify your database settings and check the " + "logs/error.log file for detailed error messages."); Log.error("Database could not be accessed", e); throw new IllegalArgumentException(e); } finally { DbConnectionManager.closeConnection(rs, pstmt, con); } } /** * Verifies that the given home guess is a real Openfire home directory. * We do the verification by checking for the Openfire config file in * the config dir of jiveHome. * * @param homeGuess a guess at the path to the home directory. * @param jiveConfigName the name of the config file to check. * @return a file pointing to the home directory or null if the * home directory guess was wrong. * @throws java.io.FileNotFoundException if there was a problem with the home * directory provided */ private File verifyHome(String homeGuess, String jiveConfigName) throws FileNotFoundException { File openfireHome = new File(homeGuess); File configFile = new File(openfireHome, jiveConfigName); if (!configFile.exists()) { throw new FileNotFoundException(); } else { try { return new File(openfireHome.getCanonicalPath()); } catch (Exception ex) { throw new FileNotFoundException(); } } } /** *Retrieve the jive home for the container.
* * @throws FileNotFoundException If jiveHome could not be located */ private void locateOpenfire() throws FileNotFoundException { String jiveConfigName = "conf" + File.separator + "openfire.xml"; // First, try to load it openfireHome as a system property. if (openfireHome == null) { String homeProperty = System.getProperty("openfireHome"); try { if (homeProperty != null) { openfireHome = verifyHome(homeProperty, jiveConfigName); } } catch (FileNotFoundException fe) { // Ignore. } } // If we still don't have home, let's assume this is standalone // and just look for home in a standard sub-dir location and verify // by looking for the config file if (openfireHome == null) { try { openfireHome = verifyHome("..", jiveConfigName).getCanonicalFile(); } catch (FileNotFoundException fe) { // Ignore. } catch (IOException ie) { // Ignore. } } // If home is still null, no outside process has set it and // we have to attempt to load the value from openfire_init.xml, // which must be in the classpath. if (openfireHome == null) { InputStream in = null; try { in = getClass().getResourceAsStream("/openfire_init.xml"); if (in != null) { SAXReader reader = new SAXReader(); Document doc = reader.read(in); String path = doc.getRootElement().getText(); try { if (path != null) { openfireHome = verifyHome(path, jiveConfigName); } } catch (FileNotFoundException fe) { fe.printStackTrace(); } } } catch (Exception e) { System.err.println("Error loading openfire_init.xml to find home."); e.printStackTrace(); } finally { try { if (in != null) { in.close(); } } catch (Exception e) { System.err.println("Could not close open connection"); e.printStackTrace(); } } } if (openfireHome == null) { System.err.println("Could not locate home"); throw new FileNotFoundException(); } else { // Set the home directory for the config file JiveGlobals.setHomeDirectory(openfireHome.toString()); // Set the name of the config file JiveGlobals.setConfigName(jiveConfigName); } } /** *A thread to ensure the server shuts down no matter what.
*Spawned when stop() is called in standalone mode, we wait a few * seconds then call system exit().
* * @author Iain Shigeoka */ private class ShutdownHookThread extends Thread { /** *Logs the server shutdown.
*/ @Override public void run() { shutdownServer(); Log.info("Server halted"); System.err.println("Server halted"); } } /** *A thread to ensure the server shuts down no matter what.
*Spawned when stop() is called in standalone mode, we wait a few * seconds then call system exit().
* * @author Iain Shigeoka */ private class ShutdownThread extends Thread { /** *Shuts down the JVM after a 5 second delay.
*/ @Override public void run() { try { Thread.sleep(5000); // No matter what, we make sure it's dead System.exit(0); } catch (InterruptedException e) { // Ignore. } } } /** * Makes a best effort attempt to shutdown the server */ private void shutdownServer() { shuttingDown = true; // Notify server listeners that the server is about to be stopped for (XMPPServerListener listener : listeners) { listener.serverStopping(); } // Shutdown the task engine. TaskEngine.getInstance().shutdown(); // If we don't have modules then the server has already been shutdown if (modules.isEmpty()) { return; } // Get all modules and stop and destroy them for (Module module : modules.values()) { module.stop(); module.destroy(); } // Stop all plugins if (pluginManager != null) { pluginManager.shutdown(); } modules.clear(); // Stop the Db connection manager. DbConnectionManager.destroyConnectionProvider(); // hack to allow safe stopping Log.info("Openfire stopped"); } /** * Returns true if the server is being shutdown. * * @return true if the server is being shutdown. */ public boolean isShuttingDown() { return shuttingDown; } /** * Returns theConnectionManager registered with this server. The
* ConnectionManager was registered with the server as a module while starting up
* the server.
*
* @return the ConnectionManager registered with this server.
*/
public ConnectionManager getConnectionManager() {
return (ConnectionManager) modules.get(ConnectionManagerImpl.class);
}
/**
* Returns the RoutingTable registered with this server. The
* RoutingTable was registered with the server as a module while starting up
* the server.
*
* @return the RoutingTable registered with this server.
*/
public RoutingTable getRoutingTable() {
return (RoutingTable) modules.get(RoutingTableImpl.class);
}
/**
* Returns the PacketDeliverer registered with this server. The
* PacketDeliverer was registered with the server as a module while starting up
* the server.
*
* @return the PacketDeliverer registered with this server.
*/
public PacketDeliverer getPacketDeliverer() {
return (PacketDeliverer) modules.get(PacketDelivererImpl.class);
}
/**
* Returns the RosterManager registered with this server. The
* RosterManager was registered with the server as a module while starting up
* the server.
*
* @return the RosterManager registered with this server.
*/
public RosterManager getRosterManager() {
return (RosterManager) modules.get(RosterManager.class);
}
/**
* Returns the PresenceManager registered with this server. The
* PresenceManager was registered with the server as a module while starting up
* the server.
*
* @return the PresenceManager registered with this server.
*/
public PresenceManager getPresenceManager() {
return (PresenceManager) modules.get(PresenceManagerImpl.class);
}
/**
* Returns the OfflineMessageStore registered with this server. The
* OfflineMessageStore was registered with the server as a module while starting up
* the server.
*
* @return the OfflineMessageStore registered with this server.
*/
public OfflineMessageStore getOfflineMessageStore() {
return (OfflineMessageStore) modules.get(OfflineMessageStore.class);
}
/**
* Returns the OfflineMessageStrategy registered with this server. The
* OfflineMessageStrategy was registered with the server as a module while starting
* up the server.
*
* @return the OfflineMessageStrategy registered with this server.
*/
public OfflineMessageStrategy getOfflineMessageStrategy() {
return (OfflineMessageStrategy) modules.get(OfflineMessageStrategy.class);
}
/**
* Returns the PacketRouter registered with this server. The
* PacketRouter was registered with the server as a module while starting up
* the server.
*
* @return the PacketRouter registered with this server.
*/
public PacketRouter getPacketRouter() {
return (PacketRouter) modules.get(PacketRouterImpl.class);
}
/**
* Returns the IQRegisterHandler registered with this server. The
* IQRegisterHandler was registered with the server as a module while starting up
* the server.
*
* @return the IQRegisterHandler registered with this server.
*/
public IQRegisterHandler getIQRegisterHandler() {
return (IQRegisterHandler) modules.get(IQRegisterHandler.class);
}
/**
* Returns the IQAuthHandler registered with this server. The
* IQAuthHandler was registered with the server as a module while starting up
* the server.
*
* @return the IQAuthHandler registered with this server.
*/
public IQAuthHandler getIQAuthHandler() {
return (IQAuthHandler) modules.get(IQAuthHandler.class);
}
/**
* Returns the IQPEPHandler registered with this server. The
* IQPEPHandler was registered with the server as a module while starting up
* the server.
*
* @return the IQPEPHandler registered with this server.
*/
public IQPEPHandler getIQPEPHandler() {
return (IQPEPHandler) modules.get(IQPEPHandler.class);
}
/**
* Returns the PluginManager instance registered with this server.
*
* @return the PluginManager instance.
*/
public PluginManager getPluginManager() {
return pluginManager;
}
/**
* Returns the PubSubModule registered with this server. The
* PubSubModule was registered with the server as a module while starting up
* the server.
*
* @return the PubSubModule registered with this server.
*/
public PubSubModule getPubSubModule() {
return (PubSubModule) modules.get(PubSubModule.class);
}
/**
* Returns a list with all the modules registered with the server that inherit from IQHandler.
*
* @return a list with all the modules registered with the server that inherit from IQHandler.
*/
public ListSessionManager registered with this server. The
* SessionManager was registered with the server as a module while starting up
* the server.
*
* @return the SessionManager registered with this server.
*/
public SessionManager getSessionManager() {
return (SessionManager) modules.get(SessionManager.class);
}
/**
* Returns the TransportHandler registered with this server. The
* TransportHandler was registered with the server as a module while starting up
* the server.
*
* @return the TransportHandler registered with this server.
*/
public TransportHandler getTransportHandler() {
return (TransportHandler) modules.get(TransportHandler.class);
}
/**
* Returns the PresenceUpdateHandler registered with this server. The
* PresenceUpdateHandler was registered with the server as a module while starting
* up the server.
*
* @return the PresenceUpdateHandler registered with this server.
*/
public PresenceUpdateHandler getPresenceUpdateHandler() {
return (PresenceUpdateHandler) modules.get(PresenceUpdateHandler.class);
}
/**
* Returns the PresenceSubscribeHandler registered with this server. The
* PresenceSubscribeHandler was registered with the server as a module while
* starting up the server.
*
* @return the PresenceSubscribeHandler registered with this server.
*/
public PresenceSubscribeHandler getPresenceSubscribeHandler() {
return (PresenceSubscribeHandler) modules.get(PresenceSubscribeHandler.class);
}
/**
* Returns the IQRouter registered with this server. The
* IQRouter was registered with the server as a module while starting up
* the server.
*
* @return the IQRouter registered with this server.
*/
public IQRouter getIQRouter() {
return (IQRouter) modules.get(IQRouter.class);
}
/**
* Returns the MessageRouter registered with this server. The
* MessageRouter was registered with the server as a module while starting up
* the server.
*
* @return the MessageRouter registered with this server.
*/
public MessageRouter getMessageRouter() {
return (MessageRouter) modules.get(MessageRouter.class);
}
/**
* Returns the PresenceRouter registered with this server. The
* PresenceRouter was registered with the server as a module while starting up
* the server.
*
* @return the PresenceRouter registered with this server.
*/
public PresenceRouter getPresenceRouter() {
return (PresenceRouter) modules.get(PresenceRouter.class);
}
/**
* Returns the MulticastRouter registered with this server. The
* MulticastRouter was registered with the server as a module while starting up
* the server.
*
* @return the MulticastRouter registered with this server.
*/
public MulticastRouter getMulticastRouter() {
return (MulticastRouter) modules.get(MulticastRouter.class);
}
/**
* Returns the UserManager registered with this server. The
* UserManager was registered with the server as a module while starting up
* the server.
*
* @return the UserManager registered with this server.
*/
public UserManager getUserManager() {
return UserManager.getInstance();
}
/**
* Returns the LockOutManager registered with this server. The
* LockOutManager was registered with the server as a module while starting up
* the server.
*
* @return the LockOutManager registered with this server.
*/
public LockOutManager getLockOutManager() {
return LockOutManager.getInstance();
}
/**
* Returns the UpdateManager registered with this server. The
* UpdateManager was registered with the server as a module while starting up
* the server.
*
* @return the UpdateManager registered with this server.
*/
public UpdateManager getUpdateManager() {
return (UpdateManager) modules.get(UpdateManager.class);
}
/**
* Returns the AuditManager registered with this server. The
* AuditManager was registered with the server as a module while starting up
* the server.
*
* @return the AuditManager registered with this server.
*/
public AuditManager getAuditManager() {
return (AuditManager) modules.get(AuditManagerImpl.class);
}
/**
* Returns a list with all the modules that provide "discoverable" features.
*
* @return a list with all the modules that provide "discoverable" features.
*/
public ListIQDiscoInfoHandler registered with this server. The
* IQDiscoInfoHandler was registered with the server as a module while starting up
* the server.
*
* @return the IQDiscoInfoHandler registered with this server.
*/
public IQDiscoInfoHandler getIQDiscoInfoHandler() {
return (IQDiscoInfoHandler) modules.get(IQDiscoInfoHandler.class);
}
/**
* Returns the IQDiscoItemsHandler registered with this server. The
* IQDiscoItemsHandler was registered with the server as a module while starting up
* the server.
*
* @return the IQDiscoItemsHandler registered with this server.
*/
public IQDiscoItemsHandler getIQDiscoItemsHandler() {
return (IQDiscoItemsHandler) modules.get(IQDiscoItemsHandler.class);
}
/**
* Returns the PrivateStorage registered with this server. The
* PrivateStorage was registered with the server as a module while starting up
* the server.
*
* @return the PrivateStorage registered with this server.
*/
public PrivateStorage getPrivateStorage() {
return (PrivateStorage) modules.get(PrivateStorage.class);
}
/**
* Returns the MultiUserChatManager registered with this server. The
* MultiUserChatManager was registered with the server as a module while starting up
* the server.
*
* @return the MultiUserChatManager registered with this server.
*/
public MultiUserChatManager getMultiUserChatManager() {
return (MultiUserChatManager) modules.get(MultiUserChatManager.class);
}
/**
* Returns the AdHocCommandHandler registered with this server. The
* AdHocCommandHandler was registered with the server as a module while starting up
* the server.
*
* @return the AdHocCommandHandler registered with this server.
*/
public AdHocCommandHandler getAdHocCommandHandler() {
return (AdHocCommandHandler) modules.get(AdHocCommandHandler.class);
}
/**
* Returns the FileTransferProxy registered with this server. The
* FileTransferProxy was registered with the server as a module while starting up
* the server.
*
* @return the FileTransferProxy registered with this server.
*/
public FileTransferProxy getFileTransferProxy() {
return (FileTransferProxy) modules.get(FileTransferProxy.class);
}
/**
* Returns the FileTransferManager registered with this server. The
* FileTransferManager was registered with the server as a module while starting up
* the server.
*
* @return the FileTransferProxy registered with this server.
*/
public FileTransferManager getFileTransferManager() {
return (FileTransferManager) modules.get(DefaultFileTransferManager.class);
}
/**
* Returns the MediaProxyService registered with this server. The
* MediaProxyService was registered with the server as a module while starting up
* the server.
*
* @return the MediaProxyService registered with this server.
*/
public MediaProxyService getMediaProxyService() {
return (MediaProxyService) modules.get(MediaProxyService.class);
}
/**
* Returns the FlashCrossDomainHandler registered with this server. The
* FlashCrossDomainHandler was registered with the server as a module while starting up
* the server.
*
* @return the FlashCrossDomainHandler registered with this server.
*/
public FlashCrossDomainHandler getFlashCrossDomainHandler() {
return (FlashCrossDomainHandler) modules.get(FlashCrossDomainHandler.class);
}
/**
* Returns the VCardManager registered with this server. The
* VCardManager was registered with the server as a module while starting up
* the server.
* @return the VCardManager registered with this server.
*/
public VCardManager getVCardManager() {
return VCardManager.getInstance();
}
/**
* Returns the InternalComponentManager registered with this server. The
* InternalComponentManager was registered with the server as a module while starting up
* the server.
*
* @return the InternalComponentManager registered with this server.
*/
private InternalComponentManager getComponentManager() {
return (InternalComponentManager) modules.get(InternalComponentManager.class);
}
/**
* Returns the locator to use to find sessions hosted in other cluster nodes. When not running
* in a cluster a null value is returned.
*
* @return the locator to use to find sessions hosted in other cluster nodes.
*/
public RemoteSessionLocator getRemoteSessionLocator() {
return remoteSessionLocator;
}
/**
* Sets the locator to use to find sessions hosted in other cluster nodes. When not running
* in a cluster set a null value.
*
* @param remoteSessionLocator the locator to use to find sessions hosted in other cluster nodes.
*/
public void setRemoteSessionLocator(RemoteSessionLocator remoteSessionLocator) {
this.remoteSessionLocator = remoteSessionLocator;
}
/**
* Returns whether or not the server has been started.
*
* @return whether or not the server has been started.
*/
public boolean isStarted() {
return started;
}
}