Helper method that generates the required evolution to properly run Ebean.

@param server the EbeanServer.
@return the complete migration generated by Ebean
494719
public static String generateEvolutionScript(EbeanServer server) {
        try {
            SpiEbeanServer spiServer = (SpiEbeanServer) server;
            CurrentModel ddl = new CurrentModel(spiServer);

            String ups = ddl.getCreateDdl();
            String downs = ddl.getDropAllDdl();

            if (ups == null || ups.trim().isEmpty()) {
                return null;
            }

            return
                "# --- Created by Ebean DDL\r\n" +
                "# To stop Ebean DDL generation, remove this comment and start using Evolutions\r\n" +
                "\r\n" +
                "# --- !Ups\r\n" +
                "\r\n" +
                ups +
                "\r\n" +
                "# --- !Downs\r\n" +
                "\r\n" +
                downs;
        } catch (IOException ex) {
            throw new RuntimeException(ex);
        }
    }
1183122
public static boolean migrate(final Session session, final MigrationResources resources) {
        return MigrationEngine.withSession(session).migrate(resources);
    }
1281888
public static Server getServer() throws InitializationException {
        if (server == null) {
            server =
                    RebuildServer.getRebuildInstance(new File(
                            Constants.FEDORA_HOME));
        }
        return server;
    }
507324
@ExceptionHandler(Exception.class)
    @RequestMapping(value = "api/edit/server/{id}", method = RequestMethod.POST)
    public
    @ResponseBody
    ServerRedirect updateServer(Model model, @PathVariable int id,
                                @RequestParam(required = false) Boolean enabled) throws Exception {
        logger.info("updating Server");
        if (enabled != null) {
            if (enabled) {
                Client.enableHost(ServerRedirectService.getInstance().getRedirect(id).getSrcUrl());
            } else {
                Client.disableHost(ServerRedirectService.getInstance().getRedirect(id).getSrcUrl());
            }
        }
        return ServerRedirectService.getInstance().getRedirect(id);
    }
905514
public JSONArray construct(boolean server){
        JSONArray jobArray = new JSONArray();
        String cron = generateCron();
        if (cron == null) return null;
        jobArray.put(cron);
        if (server) {
            if (job == null) return null;
            jobArray.put(job);
        } else {
            JSONArray empty = new JSONArray();
            empty.put("");
            empty.put("");
            jobArray.put(empty);
        }
        JSONArray timer = new JSONArray();
        timer.put(ID);
        if (server) timer.put(getOnOff());
        timer.put(jobArray);
        return timer;
    }
1345165
static MBeanServer registerJolokiaMBeanServerHolderMBean(MBeanServer pServer) {
        JolokiaMBeanServerHolder holder = new JolokiaMBeanServerHolder();
        ObjectName holderName = createObjectName(JolokiaMBeanServerHolderMBean.OBJECT_NAME);
        MBeanServer jolokiaMBeanServer;
        try {
            pServer.registerMBean(holder,holderName);
            jolokiaMBeanServer = holder.getJolokiaMBeanServer();
        } catch (InstanceAlreadyExistsException e) {
            // If the instance already exist, we look it up and fetch the MBeanServerHolder from there.
            // Might happen in race conditions.
            try {
                jolokiaMBeanServer = (MBeanServer) pServer.getAttribute(holderName,JOLOKIA_MBEAN_SERVER_ATTRIBUTE);
            } catch (JMException e1) {
                throw new IllegalStateException("Internal: Cannot get JolokiaMBean server in fallback JMX lookup " +
                                                "while trying to register the holder MBean: " + e1,e1);
            }
        } catch (JMException e) {
            throw new IllegalStateException("Internal: JolokiaMBeanHolder cannot be registered to JMX: " + e,e);
        }
        return jolokiaMBeanServer;
    }
254651
public Server run() throws Exception {
        if (server == null) {
            server = new Server(port);
            String basePath = "/druid";
            buildSwagger(basePath);
            HandlerList handlers = new HandlerList();
            handlers.addHandler(buildContext(basePath));
            server.setHandler(handlers);
            server.start();
        } else {
            throw new IllegalStateException("Server already running");
        }
        return server;
    }
122138
protected static BeanDefinition getServerConfigurationBeanDefinition(){
        String className = ServerConfiguration.class.getName();
        GenericBeanDefinition result = new GenericBeanDefinition();
        result.setAutowireCandidate(true);
        result.setScope(BeanDefinition.SCOPE_SINGLETON);
        result.setBeanClass(Server.class);
        result.setFactoryMethodName("getConfig");
        result.setAttribute("id", className);
        result.setAttribute("name", className);
        return result;
    }
626955
public FtpServerBuilder server(org.apache.ftpserver.FtpServer server) {
        endpoint.setFtpServer(server);
        return this;
    }
1226110
public int getServerMajorVersion() {
    try {
      StringTokenizer versionTokens = new StringTokenizer(queryExecutor.getServerVersion(), "."); // aaXbb.ccYdd
      return integerPart(versionTokens.nextToken()); // return X
    } catch (NoSuchElementException e) {
      return 0;
    }
  }
525503
public HttpServerActionBuilder server(String httpServer) {
		Assert.notNull(applicationContext, "Citrus application context is not initialized!");
		HttpServerActionBuilder serverAction = new HttpServerActionBuilder(action, applicationContext.getBean(httpServer, Endpoint.class))
				.withApplicationContext(applicationContext);
		return serverAction;
	}
269567
public ServerHandle detect(MBeanServerExecutor pMBeanServerExecutor) {
        Class serverClass = ClassUtil.classForName("org.mortbay.jetty.Server",false);
        if (serverClass != null) {
            return new ServerHandle("Mortbay", "jetty", getVersion(serverClass), null);
        }
        serverClass = ClassUtil.classForName("org.eclipse.jetty.server.Server",false);
        if (serverClass != null) {
            return new ServerHandle("Eclipse", "jetty", getVersion(serverClass), null);
        }
        return null;
    }
556552
protected DefaultServerDolphin createServerDolphin() {
        ServerModelStore modelStore = createServerModelStore();
        ServerConnector connector = createServerConnector(modelStore, createCodec());
        return new DefaultServerDolphin(modelStore, connector);
    }
1047
public static String getServer() {
        final StringBuilder serverBuilder = new StringBuilder(getServerScheme()).append("://").append(getServerHost());
        final String port = getServerPort();
        if (StringUtils.isNotBlank(port) && !"80".equals(port) && !"443".equals(port)) {
            serverBuilder.append(':').append(port);
        }

        return serverBuilder.toString();
    }
710111
public static SSLContext getInstance(boolean server) throws GeneralSecurityException {
        SSLContext retInstance = null;
        if (server) {
            if (serverInstance == null) {
                synchronized (BogusSslContextFactory.class) {
                    if (serverInstance == null) {
                        try {
                            serverInstance = createBougusServerSslContext();
                        } catch (Exception ioe) {
                            throw new GeneralSecurityException("Can't create Server SSLContext:" + ioe);
                        }
                    }
                }
            }
            retInstance = serverInstance;
        } else {
            if (clientInstance == null) {
                synchronized (BogusSslContextFactory.class) {
                    if (clientInstance == null) {
                        clientInstance = createBougusClientSslContext();
                    }
                }
            }
            retInstance = clientInstance;
        }
        return retInstance;
    }
887487
private Server __buildServer() {
        Server mServer = new Server();

        // Connectors...
        Connector[] connectors = getConnectors(mServer);
        if (connectors == null || connectors.length == 0)
            throw new RuntimeException("Missing connectors");

        for (Connector connector : connectors) {
            mServer.addConnector(connector);
        }

        ServletContextHandler handler = new ServletContextHandler(ServletContextHandler.SESSIONS);
        handler.setContextPath("/");
        handler.setResourceBase(System.getProperty("java.io.tmpdir"));

        // Filters...
        for (Map.Entry<String, List<Class<? extends Filter>>> filterEntry : filterMap.entrySet()) {
            for (Class<? extends Filter> filterClass : filterEntry.getValue()) {
                handler.addFilter(filterClass, filterEntry.getKey(), EnumSet.of(DispatcherType.REQUEST));
            }
        }

        // Servlets...
        for (Map.Entry<String, Class<? extends HttpServlet>> servletEntry : servletMap.entrySet()) {
            handler.addServlet(servletEntry.getValue(), servletEntry.getKey());
        }

        // Event listeners...
        for (Class<? extends EventListener> eventListenerClass : servletContextListenerSet) {
            try {
                EventListener eventListener = eventListenerClass.newInstance();
                handler.addEventListener(eventListener);
            } catch (IllegalAccessException | InstantiationException ex) {
                throw new RuntimeException(ex);
            }
        }

        // Error handler...
        if (errorHandler != null)
            handler.setErrorHandler(errorHandler);

        mServer.setHandler(handler);
        return mServer;
    }
501126
public Optional<Server> chooseRoundRobinAfterFiltering(List<Server> servers) {
        List<Server> eligible = getEligibleServers(servers);
        if (eligible.size() == 0) {
            return Optional.absent();
        }
        return Optional.of(eligible.get(incrementAndGetModulo(eligible.size())));
    }