Package org.jivesoftware.whack

Examples of org.jivesoftware.whack.ExternalComponent


    String secretKey = secretKeys.get(subdomain);
    if (secretKey == null) {
      secretKey = defaultSecretKey;
    }
    // Create a wrapping ExternalComponent on the component
    ExternalComponent externalComponent = new ExternalComponent(component, this);
    try {
      // Register the new component
      componentsByDomain.put(subdomain, externalComponent);
      components.put(component, externalComponent);
      // Ask the ExternalComponent to connect with the remote server
      externalComponent.connect(host, port, SocketFactory.getDefault(), subdomain);
      // Initialize the component
      JID componentJID = new JID(null, externalComponent.getDomain(), null);
      externalComponent.initialize(componentJID, this);
    } catch (ComponentException e) {
      // Unregister the new component
      componentsByDomain.remove(subdomain);
      components.remove(component);
      // Re-throw the exception
      throw e;
    }
    // Ask the external component to start processing incoming packets
    externalComponent.start();
  }
View Full Code Here


    // Ask the external component to start processing incoming packets
    externalComponent.start();
  }
 
  public void removeComponent(String subdomain) throws ComponentException {
    ExternalComponent externalComponent = componentsByDomain.remove(subdomain);
    components.remove(externalComponent.getComponent());
    if (externalComponent != null) {
      externalComponent.shutdown();
    }
  }
View Full Code Here

TOP

Related Classes of org.jivesoftware.whack.ExternalComponent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.