Method ignoring GenerateDeployment events if deployment is already done.

@param eventContext Event to check
1620
public void blockGenerateDeploymentWhenNeeded(@Observes EventContext<GenerateDeployment> eventContext) {
        if (!extensionEnabled()) {
            eventContext.proceed();
        }
        else if (suiteDeploymentGenerated) {
            // Do nothing with event.
            debug("Blocking GenerateDeployment event {0}", eventContext.getEvent().toString());
        } else {
            suiteDeploymentGenerated = true;
            debug("NOT Blocking GenerateDeployment event {0}", eventContext.getEvent().toString());
            eventContext.proceed();
        }
    }
384946
public void blockDeployManagedDeploymentsWhenNeeded(@Observes EventContext<DeployManagedDeployments> eventContext) {
        if (!extensionEnabled()) {
            eventContext.proceed();
        }
        else if (deployDeployments) {
            deployDeployments = false;
            debug("NOT Blocking DeployManagedDeployments event {0}", eventContext.getEvent().toString());
            eventContext.proceed();
        } else {
            // Do nothing with event.
            debug("Blocking DeployManagedDeployments event {0}", eventContext.getEvent().toString());
        }
    }
382006
@Override
  public void updateDeployment(final String host, final Deployment deployment, final String token)
      throws HostNotFoundException, JobNotDeployedException, TokenVerificationException {
    log.info("updating deployment {}: {}", deployment, host);

    final ZooKeeperClient client = provider.get("updateDeployment");

    final JobId jobId = deployment.getJobId();
    final Job job = getJob(client, jobId);
    final Deployment existingDeployment = getDeployment(host, jobId);

    if (job == null) {
      throw new JobNotDeployedException(host, jobId);
    }
    verifyToken(token, job);

    assertHostExists(client, host);
    assertTaskExists(client, host, deployment.getJobId());

    final String path = Paths.configHostJob(host, jobId);
    final Task task = new Task(job, deployment.getGoal(),
        existingDeployment.getDeployerUser(),
        existingDeployment.getDeployerMaster(),
        existingDeployment.getDeploymentGroupName());
    try {
      client.setData(path, task.toJsonBytes());
    } catch (Exception e) {
      throw new HeliosRuntimeException("updating deployment " + deployment
                                       + " on host " + host + " failed", e);
    }
  }
259850
function onDeployCompleted(deploy) {
    if (typeof self.FLEETS[deploy.id] === 'undefined') return; //nothing else to do.
    var fleet = self.FLEETS[deploy.id];
    fleet.success++;
    fleet.success_total++;
    // Try and create a fleet.
    createFleet(deploy);
  }
213012
@EventBusListenerMethod(scope = EventScope.UI)
    void onEvent(final RolloutEvent event) {
        switch (event) {
        case FILTER_BY_TEXT:
        case CREATE_ROLLOUT:
        case UPDATE_ROLLOUT:
        case SHOW_ROLLOUTS:
            refreshContainer();
            break;
        default:
            break;
        }
    }
707268
@Override
    public void contextInitialized(ServletContextEvent event) {
        // On Windows, URL caches can cause problems, particularly with
        // undeployment
        // So, here we attempt to disable them if we detect that we are running
        // on Windows
        try {
            String osName = System.getProperty("os.name");

            if (osName != null && osName.toLowerCase().contains("windows")) {
                URL url = new URL("http://localhost/");
                URLConnection urlConn = url.openConnection();
                urlConn.setDefaultUseCaches(false);
            }
        } catch (Throwable t) {
            // Any errors thrown in disabling the caches aren't significant to
            // the normal execution of the application, so we ignore them
        }
    }
1001530
protected CDI11Deployment createDeployment(ServletContext context, CDI11Bootstrap bootstrap) {

        ImmutableSet.Builder<Metadata<Extension>> extensionsBuilder = ImmutableSet.builder();
        extensionsBuilder.addAll(bootstrap.loadExtensions(WeldResourceLoader.getClassLoader()));
        if (isDevModeEnabled) {
            extensionsBuilder.add(new MetadataImpl<Extension>(DevelopmentMode.getProbeExtension(resourceLoader), "N/A"));
        }

        final Iterable<Metadata<Extension>> extensions = extensionsBuilder.build();
        final TypeDiscoveryConfiguration typeDiscoveryConfiguration = bootstrap.startExtensions(extensions);
        final EEModuleDescriptor eeModule = new EEModuleDescriptorImpl(context.getContextPath(), ModuleType.WEB);

        final DiscoveryStrategy strategy = DiscoveryStrategyFactory.create(resourceLoader, bootstrap, typeDiscoveryConfiguration.getKnownBeanDefiningAnnotations(),
            Boolean.parseBoolean(context.getInitParameter(Jandex.DISABLE_JANDEX_DISCOVERY_STRATEGY)));

        if (Jandex.isJandexAvailable(resourceLoader)) {
            try {
                Class<? extends BeanArchiveHandler> handlerClass = Reflections.loadClass(resourceLoader, JANDEX_SERVLET_CONTEXT_BEAN_ARCHIVE_HANDLER);
                strategy.registerHandler((SecurityActions.newConstructorInstance(handlerClass, new Class<?>[] { ServletContext.class }, context)));
            } catch (Exception e) {
                throw CommonLogger.LOG.unableToInstantiate(JANDEX_SERVLET_CONTEXT_BEAN_ARCHIVE_HANDLER, Arrays.toString(new Object[] { context }), e);
            }
        } else {
            strategy.registerHandler(new ServletContextBeanArchiveHandler(context));
        }
        strategy.setScanner(new WebAppBeanArchiveScanner(resourceLoader, bootstrap, context));
        Set<WeldBeanDeploymentArchive> beanDeploymentArchives = strategy.performDiscovery();

        String isolation = context.getInitParameter(CONTEXT_PARAM_ARCHIVE_ISOLATION);

        if (isolation == null || Boolean.valueOf(isolation)) {
            CommonLogger.LOG.archiveIsolationEnabled();
        } else {
            CommonLogger.LOG.archiveIsolationDisabled();
            Set<WeldBeanDeploymentArchive> flatDeployment = new HashSet<WeldBeanDeploymentArchive>();
            flatDeployment.add(WeldBeanDeploymentArchive.merge(bootstrap, beanDeploymentArchives));
            beanDeploymentArchives = flatDeployment;
        }

        for (BeanDeploymentArchive archive : beanDeploymentArchives) {
            archive.getServices().add(EEModuleDescriptor.class, eeModule);
        }

        CDI11Deployment deployment = new WeldDeployment(resourceLoader, bootstrap, beanDeploymentArchives, extensions) {
            @Override
            protected WeldBeanDeploymentArchive createAdditionalBeanDeploymentArchive() {
                WeldBeanDeploymentArchive archive = super.createAdditionalBeanDeploymentArchive();
                archive.getServices().add(EEModuleDescriptor.class, eeModule);
                return archive;
            }
        };

        if (strategy.getClassFileServices() != null) {
            deployment.getServices().add(ClassFileServices.class, strategy.getClassFileServices());
        }
        return deployment;
    }
1030411
public void setDeploymentsInfo(java.util.Collection<DeploymentInfo> deploymentsInfo) {
        if (deploymentsInfo == null) {
            this.deploymentsInfo = null;
            return;
        }

        this.deploymentsInfo = new com.amazonaws.internal.SdkInternalList<DeploymentInfo>(deploymentsInfo);
    }
741676
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final ResourceRoot deploymentRoot = phaseContext.getDeploymentUnit().getAttachment(Attachments.DEPLOYMENT_ROOT);
        final ModuleSpecification moduleSpecification = phaseContext.getDeploymentUnit().getAttachment(
                Attachments.MODULE_SPECIFICATION);
        if(deploymentRoot == null)
            return;
        final ServicesAttachment servicesAttachments = phaseContext.getDeploymentUnit().getAttachment(Attachments.SERVICES);
        if(servicesAttachments != null && !servicesAttachments.getServiceImplementations(ServiceActivator.class.getName()).isEmpty()) {
            moduleSpecification.addSystemDependency(MSC_DEP);
        }
    }
136257
protected void initDeployers() {
    if (this.deployers == null) {
      this.deployers = new ArrayList<Deployer>();
      if (customPreDeployers != null) {
        this.deployers.addAll(customPreDeployers);
      }
      this.deployers.addAll(getDefaultDeployers());
      if (customPostDeployers != null) {
        this.deployers.addAll(customPostDeployers);
      }
    }
    if (deploymentCache == null) {
      List<Deployer> deployers = new ArrayList<Deployer>();
      if (customPreDeployers != null) {
        deployers.addAll(customPreDeployers);
      }
      deployers.addAll(getDefaultDeployers());
      if (customPostDeployers != null) {
        deployers.addAll(customPostDeployers);
      }

      initCacheFactory();
      deploymentCache = new DeploymentCache(cacheFactory, cacheCapacity);
      deploymentCache.setDeployers(deployers);
    }
  }
578444
private synchronized void updateDeploymentMap(DigitalObject obj,
            Connection c, boolean isPurge) throws SQLException {

        String sDep = obj.getPid();
        Set<RelationshipTuple> sDefs =
                obj.getRelationships(Constants.MODEL.IS_DEPLOYMENT_OF, null);
        Set<RelationshipTuple> models =
                obj.getRelationships(Constants.MODEL.IS_CONTRACTOR_OF, null);

        /* Read in the new deployment map from the object */
        Set<ServiceContext> newContext = new HashSet<ServiceContext>();

        if (!isPurge) {
            for (RelationshipTuple sDefTuple : sDefs) {
                String sDef = sDefTuple.getObjectPID();
                for (RelationshipTuple cModelTuple : models) {
                    String cModel = cModelTuple.getObjectPID();
                    newContext.add(ServiceContext.getInstance(cModel, sDef));
                }
            }
        }

        /* Read in the old deployment map from the cache */
        Set<ServiceContext> oldContext =
                m_cModelDeploymentMap.getContextFor(sDep);

        /* Remove any obsolete deployments from the registry/cache */
        for (ServiceContext o : oldContext) {
            if (!newContext.contains(o)) {
                removeDeployment(o, obj, c);
            }
        }

        /* Add any new deployments from the registry/cache */
        for (ServiceContext n : newContext) {
            if (!oldContext.contains(n)) {
                addDeployment(n, obj, c);
            } else {
                updateDeployment(n, obj, c);
            }
        }
    }
1321568
private void removeDeployment(final String deploymentID, Handler<AsyncResult<Void>> doneHandler) {
    context.execute(new Action<Void>() {
      @Override
      public Void perform() {
        Collection<String> nodeDeployments = deployments.get(node);
        if (nodeDeployments != null) {
          String deployment = null;
          for (String sdeployment : nodeDeployments) {
            JsonObject info = new JsonObject(sdeployment);
            if (info.getString("id").equals(deploymentID)) {
              deployment = sdeployment;
              break;
            }
          }
          if (deployment != null) {
            deployments.remove(node, deployment);
          }
        }
        return null;
      }
    }, doneHandler);
  }
540944
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
        final ServicesAttachment servicesAttachment = deploymentUnit.getAttachment(Attachments.SERVICES);
        if (servicesAttachment == null || servicesAttachment.getServiceImplementations(ServiceActivator.class.getName()).isEmpty()) {
            return; // Skip it if it has not been marked
        }
        final Module module = deploymentUnit.getAttachment(Attachments.MODULE);
        if (module == null) {
            return; // Skip deployments with no module
        }

        AttachmentList<DeploymentUnit> duList = deploymentUnit.getAttachment(Attachments.SUB_DEPLOYMENTS);
        List<String> serviceAcitvatorList = new ArrayList<String>();
        if (duList!=null && !duList.isEmpty()) {
            for (DeploymentUnit du : duList) {
                ServicesAttachment duServicesAttachment = du.getAttachment(Attachments.SERVICES);
                for (String serv : duServicesAttachment.getServiceImplementations(ServiceActivator.class.getName())) {
                    serviceAcitvatorList.add(serv);
                }
            }
        }

        ServiceRegistry serviceRegistry = phaseContext.getServiceRegistry();
        if (WildFlySecurityManager.isChecking()) {
            //service registry allows you to modify internal server state across all deployments
            //if a security manager is present we use a version that has permission checks
            serviceRegistry = new SecuredServiceRegistry(serviceRegistry);
        }
        final ServiceActivatorContext serviceActivatorContext = new ServiceActivatorContextImpl(phaseContext.getServiceTarget(), serviceRegistry);

        final ClassLoader current = WildFlySecurityManager.getCurrentContextClassLoaderPrivileged();

        try {
            WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(module.getClassLoader());
            for (ServiceActivator serviceActivator : module.loadService(ServiceActivator.class)) {
                try {
                    for (String serv : servicesAttachment.getServiceImplementations(ServiceActivator.class.getName())) {
                        if (serv.compareTo(serviceActivator.getClass().getName()) == 0 && !serviceAcitvatorList.contains(serv)) {
                            serviceActivator.activate(serviceActivatorContext);
                            break;
                        }
                    }
                } catch (ServiceRegistryException e) {
                    throw new DeploymentUnitProcessingException(e);
                }
            }
        } finally {
            WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(current);
        }
    }
1361279
@SuppressWarnings("unchecked")
	public void contextInitialized(ServletContextEvent sce) {
		synchronized (Jaguar.class) {
			if (!running()) {
				bootstrap();
			}
		}
		
		assemble(this);
		WebContext<ServletContext> context = (WebContext<ServletContext>) container.component(container.contexts().get(Application.class));
		context.associate(sce.getServletContext());
		Class<?> deployment = deployment(sce.getServletContext());
		
		if (deployment != null) {
			Jaguar.deployment(deployment);
		}
		
		install(components(sce.getServletContext()));
	}
1337440
public void setDeploy(java.util.Collection<String> deploy) {
        if (deploy == null) {
            this.deploy = null;
            return;
        }

        this.deploy = new com.amazonaws.internal.SdkInternalList<String>(deploy);
    }
598005
private void deployInstance(final InstanceContext instance, final CountingCompletionHandler<Void> counter) {
    // First we need to select a node from the component's deployment group
    // to which to deploy the component.
    // If the component doesn't specify a group then deploy to any node in the cluster.
    if (instance.component().group() != null) {
      cluster.getGroup(instance.component().group(), new Handler<AsyncResult<Group>>() {
        @Override
        public void handle(AsyncResult<Group> result) {
          if (result.failed()) {
            counter.fail(result.cause());
          } else {
            result.result().selectNode(instance.address(), new Handler<AsyncResult<Node>>() {
              @Override
              public void handle(AsyncResult<Node> result) {
                if (result.failed()) {
                  counter.fail(result.cause());
                } else {
                  deployInstance(result.result(), instance, counter);
                }
              }
            });
          }
        }
      });
    } else {
      cluster.selectNode(instance.address(), new Handler<AsyncResult<Node>>() {
        @Override
        public void handle(AsyncResult<Node> result) {
          if (result.failed()) {
            counter.fail(result.cause());
          } else {
            deployInstance(result.result(), instance, counter);
          }
        }
      });
    }
  }
46579
public void cmsEvent(CmsEvent event) {

        if (!isStaticExportEnabled()) {
            if (LOG.isWarnEnabled()) {
                LOG.warn(Messages.get().getBundle().key(Messages.LOG_STATIC_EXPORT_DISABLED_0));
            }
            return;
        }
        I_CmsReport report = null;
        Map<String, Object> data = event.getData();
        if (data != null) {
            report = (I_CmsReport)data.get(I_CmsEventListener.KEY_REPORT);
        }
        if (report == null) {
            report = new CmsLogReport(CmsLocaleManager.getDefaultLocale(), getClass());
        }
        switch (event.getType()) {
            case I_CmsEventListener.EVENT_UPDATE_EXPORTS:
                scrubExportFolders(report);
                clearCaches(event);
                break;
            case I_CmsEventListener.EVENT_PUBLISH_PROJECT:
                if (data == null) {
                    if (LOG.isErrorEnabled()) {
                        LOG.error(Messages.get().getBundle().key(Messages.ERR_EMPTY_EVENT_DATA_0));
                    }
                    return;
                }
                // event data contains a list of the published resources
                CmsUUID publishHistoryId = new CmsUUID((String)data.get(I_CmsEventListener.KEY_PUBLISHID));
                if (LOG.isDebugEnabled()) {
                    LOG.debug(Messages.get().getBundle().key(Messages.LOG_EVENT_PUBLISH_PROJECT_1, publishHistoryId));
                }
                synchronized (m_lockCmsEvent) {
                    getHandler().performEventPublishProject(publishHistoryId, report);
                }
                clearCaches(event);

                if (LOG.isDebugEnabled()) {
                    LOG.debug(
                        Messages.get().getBundle().key(
                            Messages.LOG_EVENT_PUBLISH_PROJECT_FINISHED_1,
                            publishHistoryId));
                }

                break;
            case I_CmsEventListener.EVENT_CLEAR_CACHES:
                clearCaches(event);
                break;
            default:
                // no operation
        }
    }