<p>setInjector.</p>

@param applicationName a {@link java.lang.String} object.
@param newInjector a {@link org.ops4j.pax.wicket.api.PaxWicketInjector} object.
345145
public static void setInjector(String applicationName, PaxWicketInjector newInjector) {
        synchronized (instance.injectorMap) {
            instance.injectorMap.put(applicationName, newInjector);
        }
        LOGGER.debug("registered Injector for application {}", applicationName);
    }
649739
public void setName(String name) {
        SystemAssert.requireArgument(name != null && !name.isEmpty(), "Dashboard Name cannot be null or empty");
        this.name = name;
    }
1203476
public static Injector createInjector(final PropertyFile configuration, final GuiceSetup setup)
	{
		return new GuiceBuilder().withConfig(configuration).withSetup(setup).build();
	}
550601
protected static final Injector init(final String commandName, final String[] args) {
        String usage = commandName + USAGE_PARAMS;
        Switch about = new Switch("a", "about", "display about message");
        Switch help = new Switch("h", "help", "display help message");
        final StringArgument namespace = new StringArgument("s", "namespace", "namespace", true);
        final FileArgument glstringFile = new FileArgument("g", "glstrings", "glstring input file", false);
        final FileArgument identifierFile = new FileArgument("i", "identifiers", "identifier output file", false);
        final StringArgument client = new StringArgument("c", "client", "client implementation, json or xml, default json", false);

        ArgumentList arguments = new ArgumentList(about, help, namespace, glstringFile, identifierFile, client);
        CommandLine commandLine = new CommandLine(args);
        try
        {
            CommandLineParser.parse(commandLine, arguments);
            if (about.wasFound()) {
                About.about(System.out);
                System.exit(0);
            }
            if (help.wasFound()) {
                Usage.usage(usage, null, commandLine, arguments, System.out);
                System.exit(0);
            }
        }
        catch (CommandLineParseException e) {
            if (about.wasFound()) {
                About.about(System.out);
                System.exit(0);
            }
            if (help.wasFound()) {
                Usage.usage(usage, null, commandLine, arguments, System.out);
                System.exit(0);
            }
            Usage.usage(usage, e, commandLine, arguments, System.err);
            System.exit(-1);
        }

        return Guice.createInjector(new CacheGlClientModule(), new AbstractModule() {
            @Override
            protected void configure() {
                bind(String.class).annotatedWith(Namespace.class).toInstance(namespace.getValue());

                if (glstringFile.wasFound()) {
                    bind(File.class).annotatedWith(GlstringFile.class).toInstance(glstringFile.getValue());
                }
                else {
                    bind(File.class).annotatedWith(GlstringFile.class).toProvider(Providers.of((File) null));
                }

                if (identifierFile.wasFound()) {
                    bind(File.class).annotatedWith(IdentifierFile.class).toInstance(identifierFile.getValue());
                }
                else {
                    bind(File.class).annotatedWith(IdentifierFile.class).toProvider(Providers.of((File) null));
                }

                bind(HttpClient.class).to(RestAssuredHttpClient.class);

                if ("xml".equals(client.getValue("json"))) {
                    bind(GlClient.class).to(XmlGlClient.class);
                }
                else {
                    bind(GlClient.class).to(JsonGlClient.class);
                }
            }
        });
    }
417106
public AbstractEndpointBuilder<T> applicationContext(ApplicationContext applicationContext) {
        if (getEndpoint() instanceof ApplicationContextAware) {
            ((ApplicationContextAware) getEndpoint()).setApplicationContext(applicationContext);
        }

        if (getEndpoint() instanceof BeanFactoryAware) {
            ((BeanFactoryAware) getEndpoint()).setBeanFactory(applicationContext);
        }

        return this;
    }
762867
@Override
    public void setApplicationContext(ApplicationContext appContext) throws BeansException {
        try (InputStream is = originalResource.getInputStream();) {
            ConfigurableListableBeanFactory beanFactory = ((AbstractRefreshableApplicationContext) appContext)
                    .getBeanFactory();
            StringBuilder sb = new StringBuilder();
            Iterator<String> iter = IOUtils.lineIterator(is, "UTF-8");
            boolean transformed = false;
            
            while (iter.hasNext()) {
                String line = iter.next();
                
                if (line.contains("${")) {
                    transformed = true;
                    line = beanFactory.resolveEmbeddedValue(line);
                }
                
                sb.append(line);
            }
            
            transformedResource = !transformed ? originalResource : new ByteArrayResource(sb.toString().getBytes());
        } catch (IOException e) {
            throw MiscUtil.toUnchecked(e);
        }
    }
62849
@SuppressWarnings("unused")
    @Internal
    protected final void injectBeanField(BeanResolutionContext resolutionContext, DefaultBeanContext context, int index, Object bean) {
        FieldInjectionPoint fieldInjectionPoint = fieldInjectionPoints.get(index);
        boolean isInject = fieldInjectionPoint.getAnnotationMetadata().hasDeclaredAnnotation(Inject.class);
        try {
            Object value;
            if (isInject) {
                value = getBeanForField(resolutionContext, context, fieldInjectionPoint);
            } else {
                value = getValueForField(resolutionContext, context, index);
            }
            if (value != null) {
                //noinspection unchecked
                fieldInjectionPoint.set(bean, value);
            }
        } catch (Throwable e) {
            if (e instanceof BeanContextException) {
                throw (BeanContextException) e;
            } else {
                throw new DependencyInjectionException(resolutionContext, fieldInjectionPoint, "Error setting field value: " + e.getMessage(), e);
            }
        }
    }
1069230
private void setXMLBeanInterface(String homeInterfaceName, String interfaceName) // F743-32443
    throws InjectionException
    {
        // If a home or business interface was specified in XML, then set that as
        // the injection type.  Both may be null if the XML just provides an
        // override of an annotation to add <ejb-link>... in which case the
        // injection class type will be set when the annotation is processed.

        // For performance, there is no need to load these classes until first
        // accessed, which might be never if there is a binding file, so just the
        // name will be set here. getInjectionClassType() is then overridden to load
        // the class when needed. Prior to EJB 3.0 these interfaces were completely
        // ignored, so this behavior allows EJB 2.1 apps to continue to function
        // even if they had garbage in their deployment descriptor.        d739281
        if (homeInterfaceName != null && homeInterfaceName.length() != 0) // d668376
        {
            ivHomeInterface = true;
            setInjectionClassTypeName(homeInterfaceName);

            if (isValidationLoggable())
            {
                loadClass(homeInterfaceName, isValidationFailable());
                loadClass(interfaceName, isValidationFailable());
            }
        }
        else if (interfaceName != null && interfaceName.length() != 0) // d668376
        {
            ivBeanInterface = true;
            setInjectionClassTypeName(interfaceName);

            if (isValidationLoggable())
            {
                loadClass(interfaceName, isValidationFailable());
            }
        }
    }
764414
public AssertSoapFaultBuilder validator(String validatorName, ApplicationContext applicationContext) {
        action.setValidator(applicationContext.getBean(validatorName, SoapFaultValidator.class));
        return this;
    }
162518
public final void setApplicationName(String applicationName) {
        synchronized (lock) {
            if (applicationName == null) {
                serviceProperties.remove(APPLICATION_NAME);
                bundleAnalysingComponentInstantiationListener = null;
            } else {
                serviceProperties.put(APPLICATION_NAME, applicationName);
                bundleAnalysingComponentInstantiationListener =
                    new BundleAnalysingComponentInstantiationListener(bundleContext, injectionSource, factoryTracker);
            }

            if (serviceRegistration != null) {
                serviceRegistration.setProperties(serviceProperties);
            }
        }
    }
266182
public synchronized void setUserAgent(String applicationName,
            String applicationVersion, String programmingLanguage,
            String... additionalNameValuePairs) {
        checkUpdatable();
        StringBuilder b = new StringBuilder();
        b.append(applicationName);
        b.append("/");
        b.append(applicationVersion);
        b.append(" (Language=");
        b.append(programmingLanguage);
        int i = 0;
        while (i < additionalNameValuePairs.length) {
            String name = additionalNameValuePairs[i];
            String value = additionalNameValuePairs[i + 1];
            b.append("; ");
            b.append(name);
            b.append("=");
            b.append(value);
            i += 2;
        }
        b.append(")");
        this.userAgent = b.toString();
    }
935100
public static void run(String aplicationName, String applicationDisplayName, String applicationVersion, Builder<Pcap, Void> builder) {
        Validate.notIllegalArgument(builder != null,
                new IllegalArgumentException("Pcap builder should be not null."));
        instance.context = new ApplicationContext(aplicationName, applicationDisplayName, applicationVersion, builder);
    }
1053015
public void init (Injector injector)
        throws Exception
    {
        // output general system information
        SystemInfo si = new SystemInfo();
        log.info("Starting up", "server", getClass().getSimpleName(), "os", si.osToString(),
            "jvm", si.jvmToString());

        registerSignalHandlers(injector);

        // initialize our deprecated legacy static references
        omgr = _omgr;
        invmgr = _invmgr;

        // configure the dobject manager with our access controller
        _omgr.setDefaultAccessController(createDefaultObjectAccessController());

        // start the main and auth invoker threads
        ((PresentsInvoker)_invoker).start(this);
        _authInvoker.start();
        ((PresentsInvoker)_invoker).addInterdependentInvoker(_authInvoker);

        // provide our client manager with the injector it needs
        _clmgr.setInjector(injector);

        // Create our socket opening objects now that we know what ports we're using.
        _lifecycle.addComponent(_socketAcceptor = createSocketAcceptor());
        _datagramReader =
            new DatagramChannelReader(getDatagramHostname(), getDatagramPorts(), _conmgr);
        _lifecycle.addComponent(_datagramReader);

        // initialize the time base services
        TimeBaseProvider.init(_invmgr, _omgr);

        // make the client manager shut down before the invoker and dobj threads; this helps
        // application code to avoid long chains of shutdown constraints
        _lifecycle.addShutdownConstraint(
            _clmgr, Lifecycle.Constraint.RUNS_BEFORE, (PresentsInvoker)_invoker);

        // initialize all of our registered components
        _lifecycle.init();
    }
1344540
public void setEnvEntryType(ResourceImpl annotation, Object type) // F743-32443
    throws InjectionException
    {
        if (type instanceof String)
        {
            setInjectionClassTypeName((String) type);
        }
        else
        {
            Class<?> classType = (Class<?>) type;
            annotation.ivType = classType;
            annotation.ivIsSetType = true;
            setInjectionClassType(classType);
        }
    }
1359002
@SuppressWarnings("unchecked")
    public void injectNonContextualInstance(final Object instance) {
        if (instance != null) {
            CreationalContext<Object> creationalContext = manager.createCreationalContext(null);
            InjectionTarget<Object> injectionTarget = (InjectionTarget<Object>) manager
                    .createInjectionTarget(getAnnotatedType(instance));
            injectionTarget.inject(instance, creationalContext);
        }
    }
1360158
@Override
    public InjectionBinding<JMSConnectionFactoryDefinition> createInjectionBinding(JMSConnectionFactoryDefinition annotation, Class<?> instanceClass, Member member, String jndiName) throws InjectionException {
        InjectionBinding<JMSConnectionFactoryDefinition> injectionBinding =
                        new JMSConnectionFactoryDefinitionInjectionBinding(jndiName, ivNameSpaceConfig);
        injectionBinding.merge(annotation, instanceClass, null);
        return injectionBinding;
    }
1183827
public final void setName(String newName)
                    throws ObjectManagerException {
        final String methodName = "setName";
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this, cclass, methodName, new Object[] { newName, storeName });

        objectManagerState.renameObjectStore(this, newName);

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this, cclass, methodName);
    }