Convenient method used to build and return a new {@link Server}.

@param iJettyConfiguration
Jetty Configuration
@return Server
180869
protected Server createServer(IJettyConfiguration iJettyConfiguration) {
        LOG.trace("Create Jetty Server...");

        Server server = new Server(new QueuedThreadPool(iJettyConfiguration.getMaxThreads()));
        server.setStopAtShutdown(false); // Reimplemented. See
                                         // @IJettyConfiguration.stopAtShutdown
        server.setStopTimeout(iJettyConfiguration.getStopTimeout());

        return server;
    }
376417
public OperationFuture<ServerMetadata> create(CreateServerConfig config) {
        BaseServerResponse response = client.create(
            serverConverter.buildCreateServerRequest(
                config,
                config.getCustomFields().isEmpty() ?
                    null :
                    client.getCustomFields())
        );

        return postProcessBuildServerResponse(response, config);
    }
1163130
public static DomainCommandBuilder of(final Path wildflyHome) {
        return new DomainCommandBuilder(Environment.validateWildFlyDir(wildflyHome), Jvm.current());
    }
913413
@Bean
	public TomcatServletWebServerFactory servletWebServerFactory() {
		return new TomcatServletWebServerFactory() {

			@Override
			protected void prepareContext(Host host,
					ServletContextInitializer[] initializers) {
				super.prepareContext(host, initializers);
				StandardContext child = new StandardContext();
				child.addLifecycleListener(new Tomcat.FixContextListener());
				child.setPath("/cloudfoundryapplication");
				ServletContainerInitializer initializer = getServletContextInitializer(
						getContextPath());
				child.addServletContainerInitializer(initializer, Collections.emptySet());
				child.setCrossContext(true);
				host.addChild(child);
			}

		};
	}
48562
public static ServerConfiguration load(URL url) throws Exception
    {
        config = new ServerConfiguration();
        config.loadConfig(url);
        return config;
    }
171932
@NotNull
    @ObjectiveCName("build")
    public Configuration build() {
        if (endpoints.size() == 0) {
            throw new RuntimeException("Endpoints not set");
        }
        if (phoneBookProvider == null) {
            throw new RuntimeException("Phonebook Provider not set");
        }
        if (apiConfiguration == null) {
            throw new RuntimeException("Api Configuration not set");
        }
        if (deviceCategory == null) {
            throw new RuntimeException("Device Category not set");
        }
        if (platformType == null) {
            throw new RuntimeException("App Category not set");
        }
        if (trustedKeys.size() == 0) {
            Log.w("ConfigurationBuilder", "No Trusted keys set. Using anonymous server authentication.");
        }
        return new Configuration(endpoints.toArray(new ConnectionEndpoint[endpoints.size()]),
                phoneBookProvider, notificationProvider,
                apiConfiguration, enableContactsLogging, enableNetworkLogging,
                enableFilesLogging, deviceCategory, platformType,
                minDelay, maxDelay, maxFailureCount,
                timeZone, preferredLanguages.toArray(new String[preferredLanguages.size()]),
                customAppName,
                trustedKeys.toArray(new TrustedKey[trustedKeys.size()]),
                isPhoneBookImportEnabled,
                isOnClientPrivacyEnabled,
                callsProvider,
                rawUpdatesHandler,
                voiceCallsEnabled,
                videoCallsEnabled,
                isEnabledGroupedChatList,
                autoJoinGroups.toArray(new String[autoJoinGroups.size()]),
                autoJoinType);
    }
1134449
public SoapServerActionBuilder server(WebServiceServer soapServer) {
		SoapServerActionBuilder serverAction = new SoapServerActionBuilder(action, soapServer)
				.withApplicationContext(applicationContext);
		return serverAction;
	}
1203816
@SuppressWarnings("static-method")
	@Provides
	@Singleton
	public IJavaBatchCompiler providesJavaBatchCompiler(Injector injector, Provider<SarlConfig> config) {
		final SarlConfig cfg = config.get();
		final IJavaBatchCompiler compiler = cfg.getCompiler().getJavaCompiler().newCompilerInstance();
		injector.injectMembers(compiler);
		return compiler;
	}
892452
@RequestMapping(value = "configurations/create", method = RequestMethod.POST)
    public SVNConfiguration newConfiguration(@RequestBody SVNConfiguration configuration) {
        return svnConfigurationService.newConfiguration(configuration);
    }
622451
public OperationFuture<ServerMetadata> importServer(ImportServerConfig config) {
        BaseServerResponse response = client.importServer(
            serverConverter.buildImportServerRequest(
                config,
                config.getCustomFields().isEmpty() ?
                    null :
                    client.getCustomFields()
            )
        );

        return postProcessBuildServerResponse(response, config);
    }
730993
public static void main(String[] arg)
    {
        String[] dftConfig={"etc/jetty.xml"};
        
        if (arg.length==0)
        {
            log.info("Using default configuration: etc/jetty.xml");
            arg=dftConfig;
        }

        final Server[] servers=new Server[arg.length];

        // create and start the servers.
        for (int i=0;i<arg.length;i++)
        {
            try
            {
                servers[i] = new Server(arg[i]);
                servers[i].setStopAtShutdown(true);
                servers[i].start();

            }
            catch(Exception e)
            {
                log.warn(LogSupport.EXCEPTION,e);
            }
        }
        
        // create and start the servers.
        for (int i=0;i<arg.length;i++)
        {
            try{servers[i].join();}
            catch (Exception e){LogSupport.ignore(log,e);}
        }
    }
1338369
protected ILaunchConfiguration createConfiguration(INode type,
			String projectName)
	{
		ILaunchConfiguration config = null;
		ILaunchConfigurationWorkingCopy wc = null;
		try
		{
			
			ILaunchConfigurationType configType = getConfigurationType();
			wc = configType.newInstance(null, getLaunchManager().generateLaunchConfigurationName(projectName+" "+AstNameUtil.getName(type)));
			wc.setAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_PROJECT, projectName);
			wc.setAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_CREATE_COVERAGE, true);

			wc.setAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_DEFAULT, getModuleName( type));
			wc.setAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_OPERATION, getOperationName( type)
					+ "()");
			if (isStaticAccessRequired(type))
			{
				wc.setAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_MODULE, getModuleName(type));
				wc.setAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_EXPRESSION, getModuleName(type)
						+ "`" + getOperationName(type) + "()");
			} else
			{
				wc.setAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_MODULE, getModuleNameLaunch(type));
				wc.setAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_EXPRESSION, "new "
						+ getModuleNameLaunch(type)
						+ "."
						+ getOperationName(type) + "()");
			}
			wc.setAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_STATIC_OPERATION, isStaticAccessRequired(type));

			wc.setAttribute(IDebugConstants.VDM_LAUNCH_CONFIG_ENABLE_LOGGING, false);

			config = wc.doSave();
		} catch (CoreException exception)
		{

			MessageDialog.openError(VdmDebugPlugin.getActiveWorkbenchShell(), LauncherMessages.VdmLaunchShortcut_3, exception.getStatus().getMessage());
		}
		return config;
	}
385104
public static ServerConfiguration loadConfiguration() {
        final ServerConfiguration configuration = createConfiguration();
        Assert.requireNonNull(configuration, "configuration");

        final ServiceLoader<ConfigurationProvider> serviceLoader = ServiceLoader.load(ConfigurationProvider.class);
        for(final ConfigurationProvider provider : serviceLoader) {
            final Map<String, String> additionalStringProperties = provider.getStringProperties();
            for(final Map.Entry<String, String> property : additionalStringProperties.entrySet()) {
                if(!configuration.containsProperty(property.getKey())) {
                    configuration.setProperty(property.getKey(), property.getValue());
                }
            }
            final Map<String, List<String>> additionalListProperties = provider.getListProperties();
            for(final Map.Entry<String, List<String>> property : additionalListProperties.entrySet()) {
                if(!configuration.containsProperty(property.getKey())) {
                    configuration.setListProperty(property.getKey(), property.getValue());
                }
            }
            final Map<String, Boolean> additionalBooleanProperties = provider.getBooleanProperties();
            for(final Map.Entry<String, Boolean> property : additionalBooleanProperties.entrySet()) {
                if(!configuration.containsProperty(property.getKey())) {
                    configuration.setBooleanProperty(property.getKey(), property.getValue());
                }
            }
            final Map<String, Integer> additionalIntegerProperties = provider.getIntegerProperties();
            for(final Map.Entry<String, Integer> property : additionalIntegerProperties.entrySet()) {
                if(!configuration.containsProperty(property.getKey())) {
                    configuration.setIntProperty(property.getKey(), property.getValue());
                }
            }
            final Map<String, Long> additionalLongProperties = provider.getLongProperties();
            for(final Map.Entry<String, Long> property : additionalLongProperties.entrySet()) {
                if(!configuration.containsProperty(property.getKey())) {
                    configuration.setLongProperty(property.getKey(), property.getValue());
                }
            }
        }
        LOG.debug("Configuration created with {} properties", configuration.getPropertyKeys().size());
        if(LOG.isTraceEnabled()) {
            for(final String key : configuration.getPropertyKeys()) {
                LOG.debug("Dolphin Platform configured with '{}'='{}'", key, configuration.getProperty(key, null));
            }
        }

        return configuration;
    }
301420
@Override
    public Server addServer(String serverName, String hostAddress, int port, IpChannelType ipChannelType,
            boolean acceptAnonymousConnections, int maxConcurrentConnectionsCount, String[] extraHostAddresses)
            throws Exception {
        if (!this.started) {
            throw new Exception(String.format("Management=%s not started", this.name));
        }

        if (serverName == null) {
            throw new Exception("Server name cannot be null");
        }

        if (hostAddress == null) {
            throw new Exception("Server host address cannot be null");
        }

        if (port < 1) {
            throw new Exception("Server host port cannot be less than 1");
        }

        synchronized (this) {
            for (FastList.Node<Server> n = this.servers.head(), end = this.servers.tail(); (n = n.getNext()) != end;) {
                Server serverTemp = n.getValue();
                if (serverName.equals(serverTemp.getName())) {
                    throw new Exception(String.format("Server name=%s already exist", serverName));
                }

                if (hostAddress.equals(serverTemp.getHostAddress()) && port == serverTemp.getHostport()) {
                    throw new Exception(String.format("Server name=%s is already bound to %s:%d", serverTemp.getName(),
                            serverTemp.getHostAddress(), serverTemp.getHostport()));
                }
            }

            NettyServerImpl server = new NettyServerImpl(serverName, hostAddress, port, ipChannelType,
                    acceptAnonymousConnections, maxConcurrentConnectionsCount, extraHostAddresses);
            server.setManagement(this);

            FastList<Server> newServers = new FastList<Server>();
            newServers.addAll(this.servers);
            newServers.add(server);
            this.servers = newServers;
            // this.servers.add(server);

            this.store();

            for (ManagementEventListener lstr : managementEventListeners) {
                try {
                    lstr.onServerAdded(server);
                } catch (Throwable ee) {
                    logger.error("Exception while invoking onServerAdded", ee);
                }
            }

            if (logger.isInfoEnabled()) {
                logger.info(String.format("Created Server=%s", server.getName()));
            }

            return server;
        }
    }
1273433
@SuppressWarnings("deprecation")
	ServerConfig buildServerConfig() {
		vallidateServerConfig();
		final int serverPort = SimpleOptional.ofNullable(port).orElse(transportStrategy.getDefaultServerPort());
		return new ServerConfigImpl(assumeNonNull(getHost()), serverPort, getUsername(), getPassword());
	}
1250742
@NonNull
    public static Server.Builder serverBuilder(@NonNull String group) {
        return Server.newBuilder(group);
    }
43959
@NotNull
    @ObjectiveCName("addEndpoint:")
    public ConfigurationBuilder addEndpoint(@NotNull String url) {
        try {
            endpoints.addEndpoint(url);
        } catch (ConnectionEndpointArray.UnknownSchemeException e) {
            throw new RuntimeException(e.getMessage());
        }
        return this;
    }