/* (non-Javadoc)
@see org.jboss.arquillian.impl.configuration.ArquillianDescriptorImpl#container(java.lang.String)
544464
@Override
    public ContainerDef container(String name) {
        return new GroupContainerDefImpl(getDescriptorName(), getRootNode(), group,
            group.getOrCreate("container@qualifier=" + name));
    }
1074523
public synchronized void registerContainer(String containerId,
                                               ImageConfiguration imageConfig,
                                               GavLabel gavLabel) {
        ContainerShutdownDescriptor descriptor = new ContainerShutdownDescriptor(imageConfig, containerId);
        shutdownDescriptorPerContainerMap.put(containerId, descriptor);
        updatePomLabelMap(gavLabel, descriptor);
        updateImageToContainerMapping(imageConfig, containerId);
    }
362697
public com.google.protobuf.ByteString
      getContainerBytes() {
    java.lang.Object ref = container_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      container_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }
958140
@Override
    public Map<String, String> getContainerProperties() {
        Node props = container.getSingle("configuration");
        Map<String, String> properties = new HashMap<String, String>();

        if (props != null) {
            for (Node prop : props.get("property")) {
                properties.put(prop.getAttribute("name"), prop.getText());
            }
        }
        return properties;
    }
1267863
public function setContainer(ContainerInterface $container = null)
    {
        $this->container = $container;
        $this->application = null !== $container ? $this->container->get('bbapp') : null;
    }
926403
public static ServletContainer defaultContainer() {
        if (container != null) {
            return container;
        }
        synchronized (Servlets.class) {
            if (container != null) {
                return container;
            }
            return container = ServletContainer.Factory.newInstance();
        }
    }
242492
@Override
    public ArtifactContainer createContainer(File cacheDir, Object containerData) {
        if ( !(containerData instanceof File) ) {
            return null;
        }

        File fileContainerData = (File) containerData;
        if ( !FileUtils.fileIsFile(fileContainerData) ) {
            return null;
        }

        if ( !isZip(fileContainerData) ) {
            return null;
        }

        return new ZipFileContainer(cacheDir, fileContainerData, this);
    }
253702
public void setContainer(Container container) {
		this.container = container;

		Map<String, TemplateEngine> map = new HashMap<String, TemplateEngine>();

		// loading TemplateEngine class from DI Container.
		Set<String> prefixes = container.getInstanceNames(TemplateEngine.class);
		for (String prefix : prefixes) {
			TemplateEngine engine = (TemplateEngine) container.getInstance(TemplateEngine.class, prefix);
			map.put(prefix, engine);
		}
		this.templateEngines = Collections.unmodifiableMap(map);
	}
356824
private Container getContainer(final GeneratorContext context) {
		List<Container> containers = StartupUtil
				.getAllPublishedContainers(context.getServletContext());
		// TODO: here we assume there is only one DWR Servlet / Container ... we
		// should find a way to math the container with the DWR mapping config
		for (Container container : containers) {
			return container;
		}
		throw new RuntimeException("FATAL: unable to find DWR Container!");
	}
502047
@SuppressWarnings("unchecked")
    public <T extends XPathBuilder> T setContainer(WebLocator container) {
        this.container = container;
        return (T) this;
    }
1060289
private ContainerCreateConfig add(String name, String value) {
        if (value != null) {
            createConfig.addProperty(name, value);
        }
        return this;
    }
1248567
private void callDoLayout(Container container)
    {
        container.doLayout();
        int n = container.getComponentCount();
        for (int i=0; i<n; i++)
        {
            Component component = container.getComponent(i);
            if (component instanceof Container)
            {
                Container subContainer = (Container)component;
                callDoLayout(subContainer);
            }
        }
    }
873206
protected void registerBinder(ResourceConfig configuration) {
        configuration.register(new AbstractBinder() {
            @Override
            protected void configure() {
                bind(Container.this).to(Container.class).proxy(false);
            }
        });
        configuration.registerInstances(new ContainerLifecycleListener() {
            @Override
            public void onStartup(org.glassfish.jersey.server.spi.Container container) {
                SystemEventBus.publish(new StartupEvent(Container.this, application));
                logger.trace(Messages.get("info.container.startup"));
            }

            @Override
            public void onReload(org.glassfish.jersey.server.spi.Container container) {
                SystemEventBus.publish(new ReloadedEvent(Container.this, application));
                logger.trace(Messages.get("info.container.reload"));
            }

            @Override
            public void onShutdown(org.glassfish.jersey.server.spi.Container container) {
                logger.info("Container onShutdown");
                SystemEventBus.publish(new ShutdownEvent(Container.this, application));
                logger.trace(Messages.get("info.container.shutdown"));
            }
        });
    }
1323208
public static TestContainer createContainer(String configurationClassName) throws Exception {
        Option[] options = getConfigurationOptions(configurationClassName);
        ExamSystem system = DefaultExamSystem.create(options);
        TestContainer testContainer = PaxExamRuntime.createContainer(system);
        testContainer.start();
        return testContainer;
    }
514397
synchronized void add(final Container container) {
    final String containerId = container.getId().toString();
    if (this.hasContainer(containerId)) {
      throw new RuntimeException("Trying to add a Container that is already known: " + containerId);
    }
    this.containers.put(containerId, container);
  }
240310
public ContainerConfig containerConfig(final ImageInfo imageInfo,
                                         final Optional<String> dockerVersion) {
    final ContainerConfig.Builder builder = ContainerConfig.builder();

    builder.image(job.getImage());
    builder.cmd(job.getCommand());
    builder.hostname(job.getHostname());
    builder.env(containerEnvStrings());
    builder.exposedPorts(containerExposedPorts());
    builder.volumes(volumes().keySet());
    builder.labels(job.getLabels());

    for (final ContainerDecorator decorator : containerDecorators) {
      decorator.decorateContainerConfig(job, imageInfo, dockerVersion, builder);
    }

    return builder.build();
  }
491702
@Override
   public void addToContainer(Element container, Element element) throws DocumentException, VectorPrintException {
      if (container instanceof TextElementArray) {
         if (element instanceof Image) {
            ((TextElementArray) container).add(new Chunk((Image) element, 0, 0, true));
         } else {
            ((TextElementArray) container).add(element);
         }
      } else if (container instanceof PdfPTable) {
         if (element instanceof PdfPCell) {
            ((PdfPTable) container).addCell((PdfPCell) element);
         } else if (element instanceof Phrase) {
            ((PdfPTable) container).addCell((Phrase) element);
         } else if (element instanceof PdfPTable) {
            ((PdfPTable) container).addCell((PdfPTable) element);
         } else if (element instanceof Image) {
            ((PdfPTable) container).addCell((Image) element);
         } else {
            throw new VectorPrintException(String.format("don't know how to add %s to %s", (element == null) ? "null" : element.getClass().getName(), (container == null) ? "null" : container.getClass().getName()));
         }
      } else if (container instanceof PdfPCell) {
         if (element instanceof PdfPTable) {
            throw new VectorPrintException(String.format("use %s.%s if you want to nest tables", CONTAINER_ELEMENT.class.getName(), CONTAINER_ELEMENT.NESTED_TABLE));
         }
         ((PdfPCell) container).addElement(element);
      } else if (container instanceof ColumnText) {
         ((ColumnText) container).addElement(element);
      } else {
         throw new VectorPrintException(String.format("don't know how to add %s to %s", (element == null) ? "null" : element.getClass().getName(), (container == null) ? "null" : container.getClass().getName()));
      }
   }