Пример #1
0
 @Override
 public void stop() {
   super.stop();
   if (getAddress() != null) {
     // Remove the route to this service
     XMPPServer.getInstance().getRoutingTable().removeComponentRoute(getAddress());
   }
 }
Пример #2
0
 @Override
 public void stop() {
   super.stop();
   // Clean up the pool of sax readers
   xmlReaders.clear();
   // Remove this module as a user event listener
   UserEventDispatcher.removeListener(this);
 }
Пример #3
0
  public void stop() {
    super.stop();

    // Stops the Clearspace MUC transcript manager
    mucTranscriptManager.stop();

    // Unregister/shut down custom MUC service
    XMPPServer.getInstance()
        .getMultiUserChatManager()
        .unregisterMultiUserChatService(MUC_SUBDOMAIN);
  }
 @Override
 public void initialize(XMPPServer server) {
   super.initialize(server);
   localServer = server;
   serverName = server.getServerInfo().getXMPPDomain();
   routingTable = server.getRoutingTable();
   deliverer = server.getPacketDeliverer();
   presenceManager = server.getPresenceManager();
   rosterManager = server.getRosterManager();
   userManager = server.getUserManager();
 }
Пример #5
0
 @Override
 public void start() throws IllegalStateException {
   super.start();
   // Initialize the pool of sax readers
   for (int i = 0; i < POOL_SIZE; i++) {
     SAXReader xmlReader = new SAXReader();
     xmlReader.setEncoding("UTF-8");
     xmlReaders.add(xmlReader);
   }
   // Add this module as a user event listener so we can delete
   // all offline messages when a user is deleted
   UserEventDispatcher.addListener(this);
 }
Пример #6
0
  public void start() throws IllegalStateException {
    super.start();
    if (isEnabled()) {
      // Before starting up service make sure there is a default secret
      if (ExternalComponentManager.getDefaultSecret() == null
          || "".equals(ExternalComponentManager.getDefaultSecret())) {
        try {
          ExternalComponentManager.setDefaultSecret(StringUtils.randomString(10));
        } catch (ModificationNotAllowedException e) {
          Log.warn("Failed to set a default secret to external component service", e);
        }
      }
      // Make sure that external component service is enabled
      if (!ExternalComponentManager.isServiceEnabled()) {
        try {
          ExternalComponentManager.setServiceEnabled(true);
        } catch (ModificationNotAllowedException e) {
          Log.warn("Failed to start external component service", e);
        }
      }
      // Listen for changes to external component settings
      ExternalComponentManager.addListener(this);
      // Listen for registration of new components
      InternalComponentManager.getInstance().addListener(this);
      // Listen for changes in certificates
      CertificateManager.addListener(this);
      // Listen for property changes
      PropertyEventDispatcher.addListener(this);
      // Set up custom clearspace MUC service
      // Create service if it doesn't exist, load if it does.
      MultiUserChatServiceImpl muc =
          (MultiUserChatServiceImpl)
              XMPPServer.getInstance()
                  .getMultiUserChatManager()
                  .getMultiUserChatService(MUC_SUBDOMAIN);
      if (muc == null) {
        try {
          muc =
              XMPPServer.getInstance()
                  .getMultiUserChatManager()
                  .createMultiUserChatService(MUC_SUBDOMAIN, MUC_DESCRIPTION, true);
        } catch (AlreadyExistsException e) {
          Log.error(
              "ClearspaceManager: Found no "
                  + MUC_SUBDOMAIN
                  + " service, but got already exists when creation attempted?  Service probably not started!");
        }
      }
      if (muc != null) {
        // Set up special delegate for Clearspace MUC service
        muc.setMUCDelegate(new ClearspaceMUCEventDelegate());
        // Set up additional features for Clearspace MUC service
        muc.addExtraFeature("clearspace:service");
        // Set up additional identity of conference service to Clearspace MUC service
        muc.addExtraIdentity("conference", "Clearspace Chat Service", "text");
      }

      // Starts the clearspace configuration task
      startClearspaceConfig();

      // Starts the Clearspace MUC transcript manager
      mucTranscriptManager.start();
    }
  }
Пример #7
0
 @Override
 public void initialize(XMPPServer server) {
   super.initialize(server);
   routingTable = server.getRoutingTable();
 }