@Override
 public void finishWizard(
     AbstractServiceUnitWizard wizard, AbstractEndpoint endpoint, IProgressMonitor monitor) {
   domain
       .getCommandStack()
       .execute(new AddCommand(domain, jbi.getServices().getConsumes(), endpoint));
 }
  /*
   * (non-Javadoc)
   * @see com.ebmwebsourcing.petals.services.explorer.sources.EndpointSource
   * #refreshServiceUnits(org.eclipse.core.runtime.IProgressMonitor)
   */
  @Override
  protected Collection<ServiceUnitBean> refreshServiceUnits(IProgressMonitor monitor) {

    if (monitor == null) monitor = new NullProgressMonitor();

    List<ServiceUnitBean> suBeans = new ArrayList<ServiceUnitBean>();
    for (File projectFile : this.directory.listFiles()) {

      if (!projectFile.isDirectory()) continue;

      // Get the end-points
      for (File jbiXmlFile : getAllJbiXmlFile(projectFile)) {
        try {
          monitor.worked(1);
          Jbi jbi = JbiXmlUtils.getJbiXmlModel(jbiXmlFile);
          if (jbi.getServices() != null) {

            ServiceUnitBean suBean = new ServiceUnitBean();
            suBean.setSource(this);
            suBean.setJbiXmlLocation(jbi.eResource().getURI().toFileString());
            suBean.setServiceUnitName(projectFile.getName());
            suBean.setComponentName(getComponentId(jbiXmlFile));

            getEndpointBeans(jbi, suBean);
            if (suBean.getEndpoints().size() > 0) suBeans.add(suBean);
          }

        } catch (InvalidJbiXmlException e1) {
          PetalsServicesPlugin.log(
              e1, IStatus.WARNING, "Invalid jbi.xml located at " + jbiXmlFile.getAbsolutePath());
        }
      }
    }

    return suBeans;
  }