@org.junit.Before
  public void deployHelloWorldComponent() {

    try {
      url = AbstractWebServicesFactory.getLocalUrl();

      Component boot = Utils.getBootstrapComponent();

      GCMTypeFactory tf = GCM.getGCMTypeFactory(boot);
      GenericFactory cf = GCM.getGenericFactory(boot);

      ComponentType typeComp =
          tf.createFcType(
              new InterfaceType[] {
                tf.createFcItfType(
                    "hello-world", HelloWorldItf.class.getName(), false, false, false),
                tf.createFcItfType(
                    "good-bye-world", GoodByeWorldItf.class.getName(), false, false, false)
              });

      String controllersConfigFileLocation =
          AbstractPAWebServicesControllerImpl.getControllerFileUrl("cxf").getPath();
      ControllerDescription cd =
          new ControllerDescription(
              "composite", Constants.PRIMITIVE, controllersConfigFileLocation);
      comp =
          cf.newFcInstance(
              typeComp, cd, new ContentDescription(HelloWorldComponent.class.getName(), null));

      GCM.getGCMLifeCycleController(comp).startFc();

      // Deploying the service in the Active Object way
      WebServicesFactory wsf = AbstractWebServicesFactory.getWebServicesFactory("cxf");
      ws = wsf.getWebServices(url);
      ws.exposeComponentAsWebService(comp, "server", new String[] {"hello-world"});
      ws.exposeComponentAsWebService(comp, "server2");

      // Deploying the service using the web service controller
      wsc =
          org.objectweb.proactive.extensions.webservices.component.Utils.getPAWebServicesController(
              comp);
      wsc.initServlet();
      wsc.setUrl(url);
      wsc.exposeComponentAsWebService("server3", new String[] {"hello-world"});
      wsc.exposeComponentAsWebService("server4");

    } catch (Exception e) {
      e.printStackTrace();
      assertTrue(false);
    }
  }
  private void addControllers(Map<String, String> controllersConfiguration) {
    // create the interface references tables
    // the size is the addition of :
    // - 1 for the current ItfRef (that is at the same time a binding controller, lifecycle
    // controller,
    // content controller and name controller
    // - the number of client functional interfaces
    // - the number of server functional interfaces
    // ArrayList interface_references_list = new ArrayList(1
    // +componentType.getFcInterfaceTypes().length+controllersConfiguration.size());
    this.nfItfs = new HashMap<String, Interface>(1 + controllersConfiguration.size());

    // add controllers
    // Enumeration controllersInterfaces = controllersConfiguration.propertyNames();
    Iterator<String> iteratorOnControllers = controllersConfiguration.keySet().iterator();
    Class<?> controllerClass = null;
    AbstractPAController currentController;
    PAInterface currentInterface = null;
    Class<?> controllerItf;
    Vector<InterfaceType> nfType = new Vector<InterfaceType>();
    while (iteratorOnControllers.hasNext()) {
      String controllerItfName = iteratorOnControllers.next();
      try {
        controllerItf = Class.forName(controllerItfName);
        controllerClass = Class.forName(controllersConfiguration.get(controllerItf.getName()));
        Constructor<?> controllerClassConstructor =
            controllerClass.getConstructor(new Class<?>[] {Component.class});
        currentController =
            (AbstractPAController) controllerClassConstructor.newInstance(new Object[] {this});
        currentInterface =
            RepresentativeInterfaceClassGenerator.instance()
                .generateControllerInterface(
                    currentController.getFcItfName(),
                    this,
                    (PAGCMInterfaceType) currentController.getFcItfType());
        ((StubObject) currentInterface).setProxy(this.proxy);

      } catch (Exception e) {
        logger.error(
            "could not create controller "
                + controllersConfiguration.get(controllerItfName)
                + " : "
                + e.getMessage());
        continue;
      }

      if (BindingController.class.isAssignableFrom(controllerClass)) {
        if ((this.componentParameters.getHierarchicalType().equals(Constants.PRIMITIVE)
            && (Utils.getClientItfTypes(this.componentParameters.getComponentType()).length == 0)
            && !hasNfInternalServerInterfaces())) {
          if (logger.isDebugEnabled()) {
            logger.debug(
                "user component class of this component does not have any client interface. It will have no BindingController");
          }
          continue;
        }
      }
      if (ContentController.class.isAssignableFrom(controllerClass)) {
        if (Constants.PRIMITIVE.equals(this.componentParameters.getHierarchicalType())) {
          // no content controller here
          continue;
        }
      }
      if (currentInterface != null) {
        this.nfItfs.put(currentController.getFcItfName(), currentInterface);
        nfType.add((InterfaceType) currentInterface.getFcItfType());
      }
    }

    try { // Setting the real NF type, as some controllers may not be generated
      Component boot = Utils.getBootstrapComponent();
      PAGCMTypeFactory type_factory = Utils.getPAGCMTypeFactory(boot);
      InterfaceType[] fItfTypes =
          ((PAComponentType) this.componentParameters.getComponentType()).getFcInterfaceTypes();
      InterfaceType[] nfItfTypes = nfType.toArray(new InterfaceType[] {});
      this.componentParameters.setComponentType(type_factory.createFcType(fItfTypes, nfItfTypes));
    } catch (Exception e) {
      e.printStackTrace();
      logger.warn("NF type could not be set");
    }
  }
  /**
   * Create and add the NF Interfaces using both a component configuration file, and an NF Type.
   *
   * <ol>
   *   <li>Creates NF Interfaces from the declared NF Type. If there is non NF Type, this step is
   *       ignored.
   *   <li>Creates Object Controllers from the Controllers Configuration File. If some of them
   *       duplicates interfaces declared in the NF Type, they are ignored. In other words, the
   *       declared NF Type has priority over the Controllers Configuration File.
   *   <li>Checks that the mandatory interfaces are declared. In particular, if the membrane
   *       controller has been previously declared, it is created here.
   *   <li>Updates the NF Type of the Component.
   * </ol>
   *
   * NOTE: When an NF interface is described in the ADL file, the Factory adds the
   * 'membrane-controller' default implementation automatically, so that it is not necessary to
   * specify the 'membrane-controller' explicitly.
   */
  private void addControllerInterfaces() {

    // Vector to collect the real NF type
    Vector<InterfaceType> nfType = new Vector<InterfaceType>();

    boolean isPrimitive =
        Constants.PRIMITIVE.equals(this.componentParameters.getHierarchicalType());

    // ------------------------------------------------------------
    // 1. Create interfaces from the declared NF type
    // Read the NF Type
    PAComponentType componentType = (PAComponentType) this.componentParameters.getComponentType();
    InterfaceType[] nfItfTypes = componentType.getNfFcInterfaceTypes();
    PAGCMInterfaceType[] pagcmNfItfTypes = new PAGCMInterfaceType[nfItfTypes.length];
    System.arraycopy(nfItfTypes, 0, pagcmNfItfTypes, 0, nfItfTypes.length);
    // Class<?> controllerItf = null;

    for (PAGCMInterfaceType pagcmNfItfType : pagcmNfItfTypes) {

      String itfName = pagcmNfItfType.getFcItfName();
      PAInterface itfRef = null;

      try {
        // some controllers interfaces are ignored
        if (specialCasesForNfType(itfName, pagcmNfItfType, isPrimitive)) continue;

        // TODO: check the case MULTICAST && CLIENT, treated in
        // PAComponentImpl.addControllerInterfaces, but not here

        // Generate the representative interface
        itfRef =
            RepresentativeInterfaceClassGenerator.instance()
                .generateInterface(
                    pagcmNfItfType.getFcItfName(),
                    this,
                    pagcmNfItfType,
                    pagcmNfItfType.isInternal(),
                    false);

        // update the hashmap and the vector of NF types
        this.nfItfs.put(itfName, itfRef);
        nfType.add((InterfaceType) itfRef.getFcItfType());

      } catch (Exception e) {
        throw new ProActiveRuntimeException(
            "Could not create NF interface reference'"
                + itfName
                + "' while instantiating component'"
                + this.componentParameters.getName()
                + "'. "
                + e.getMessage(),
            e);
      }
    }

    // ------------------------------------------------------------
    // 2. Create interfaces from the Controller Configuration file

    // read the Controller Configuration File
    Map<String, String> controllerEntries = null;
    if (this.componentParameters.getControllerDescription().configFileIsSpecified()) {
      // Parse controller config file
      String controllersConfigFileLocation =
          this.componentParameters.getControllerDescription().getControllersConfigFileLocation();
      loggerADL.debug("Parsing Controller Configuration File: " + controllersConfigFileLocation);
      ComponentConfigurationHandler componentConfiguration =
          PAComponentImpl.loadControllerConfiguration(controllersConfigFileLocation);
      controllerEntries = componentConfiguration.getControllers();

      // Create controller objects from the Controller Configuration File
      for (Map.Entry<String, String> controllerEntry : controllerEntries.entrySet()) {

        String controllerName = null;
        String controllerItfName = controllerEntry.getKey();
        String controllerClassName = controllerEntry.getValue();
        Class<?> controllerItf = null;
        Class<?> controllerClass = null;
        AbstractPAController controller = null;
        PAInterface itfRef = null;
        PAGCMInterfaceType controllerItfType = null;

        try {
          // fetch the classes
          controllerItf = Class.forName(controllerItfName);
          controllerClass = Class.forName(controllerClassName);
          // Instantiates the controller object, using 'this' component as owner.
          Constructor<?> controllerClassConstructor =
              controllerClass.getConstructor(new Class[] {Component.class});
          controller =
              (AbstractPAController) controllerClassConstructor.newInstance(new Object[] {this});

          // Obtains the controller interfaceType as declared by the object (in the method
          // setControllerItfType)
          controllerItfType = (PAGCMInterfaceType) controller.getFcItfType();
          // now we can know the name of the controller, and discriminate special cases
          controllerName = controllerItfType.getFcItfName();

          // Some controllers are not created
          if (specialCasesForController(
              controllerName, controllerItfType, isPrimitive, controllersConfigFileLocation)) {
            continue;
          }

          if (!controllerItf.isAssignableFrom(controllerClass)) {
            logger.error(
                "Could not create controller. Class '"
                    + controllerClassName
                    + " does not implement interface '"
                    + controllerItfName
                    + ". Check controller configuration file.");
            continue;
          }

          // Generate the representative interface
          itfRef =
              RepresentativeInterfaceClassGenerator.instance()
                  .generateControllerInterface(controllerName, this, controllerItfType);
          ((StubObject) itfRef).setProxy(this.proxy);

        } catch (Exception e) {
          throw new ProActiveRuntimeException(
              "Could not create representative interface for controller '"
                  + controllerClassName
                  + "' while instantiating component'"
                  + this.componentParameters.getName()
                  + "'. Check your configuration file "
                  + this.componentParameters
                      .getControllerDescription()
                      .getControllersConfigFileLocation()
                  + " : "
                  + e.getMessage(),
              e);
        }

        // add the controller to the controllers interfaces map, and add the controller type to the
        // NF type
        nfItfs.put(controllerName, itfRef);
        nfType.add((InterfaceType) itfRef.getFcItfType());
      }
    }

    // ------------------------------------------------------------
    // 3. Check that the mandatory controllers have been created
    checkMandatoryControllers(nfType);

    // ------------------------------------------------------------
    // 4. Set the real NF type, after having created all the NF interfaces
    try {
      Component boot = Utils.getBootstrapComponent();
      PAGCMTypeFactory tf = Utils.getPAGCMTypeFactory(boot);
      InterfaceType[] f = this.componentParameters.getComponentType().getFcInterfaceTypes();
      InterfaceType[] nf = nfType.toArray(new InterfaceType[] {});
      // Re-Set the real ComponentType
      this.componentParameters.setComponentType(tf.createFcType(f, nf));
    } catch (Exception e) {
      logger.error("NF type could not be set");
      e.printStackTrace();
    }
  }