This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.net.UnknownHostException; | |
import java.util.ArrayList; | |
import java.util.List; | |
import org.apache.commons.pool2.impl.GenericObjectPool; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; | |
import org.springframework.boot.autoconfigure.redis.RedisProperties; | |
import org.springframework.boot.autoconfigure.redis.RedisProperties.Sentinel; | |
import org.springframework.boot.context.properties.EnableConfigurationProperties; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.eclipse.jetty.server.LowResourceMonitor; | |
import org.eclipse.jetty.server.Server; | |
import org.eclipse.jetty.util.thread.QueuedThreadPool; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.beans.factory.annotation.Value; | |
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; | |
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; | |
import org.springframework.boot.context.embedded.jetty.JettyEmbeddedServletContainerFactory; | |
import org.springframework.boot.context.properties.EnableConfigurationProperties; | |
import org.springframework.context.annotation.Bean; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.lang.management.ManagementFactory; | |
import java.lang.management.RuntimeMXBean; | |
import java.util.Collection; | |
import java.util.LinkedHashSet; | |
import org.springframework.boot.actuate.endpoint.PublicMetrics; | |
import org.springframework.boot.actuate.metrics.Metric; | |
import org.springframework.core.Ordered; | |
import com.sun.management.OperatingSystemMXBean; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Configuration | |
public class JettyConfig { | |
@Autowired | |
private MetricRegistry metricRegistry; | |
public Server jettyServer(int maxThreads, int minThreads, int idleTimeout) { | |
QueuedThreadPool threadPool = new InstrumentedQueuedThreadPool(metricRegistry); | |
threadPool.setMaxThreads(maxThreads); | |
threadPool.setMinThreads(minThreads); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Modeled after {@link org.springframework.cloud.netflix.servo.ServoMetricCollector} | |
// employed explicitly for publication of AWS CloudWatch metrics | |
public class CloudWatchMetricCollector { | |
private final Logger log = LoggerFactory.getLogger(getClass()); | |
@Value("${spring.aws.cloudwatch.metrics.polling.timeUnit:SECONDS}") | |
private String timeUnit; | |
@Value("${spring.aws.cloudwatch.metrics.polling.interval:5}") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static SSLContext obtainTrustSelfSignedSSL() { | |
TrustManager[] trustAllCerts = new TrustManager[]{ | |
new X509TrustManager() { | |
@Override | |
public java.security.cert.X509Certificate[] getAcceptedIssuers() { | |
return null; | |
} | |
@Override | |
public void checkClientTrusted(java.security.cert.X509Certificate[] arg0, String arg1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Map; | |
import javax.servlet.http.HttpServletRequest; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.boot.autoconfigure.web.BasicErrorController; | |
import org.springframework.boot.autoconfigure.web.ErrorAttributes; | |
import org.springframework.dao.DataIntegrityViolationException; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2014 The original authors | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2014 The original authors | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Set; | |
import javax.validation.ConstraintViolation; | |
import org.spp.im.mui.gwt.client.module.common.widget.grid.ValidatableInputCell.ValidationData; | |
import org.spp.im.mui.gwt.shared.i18n.UiMessages; | |
import com.google.gwt.cell.client.FieldUpdater; | |
import com.google.gwt.user.cellview.client.AbstractHasData; | |
import com.google.gwt.view.client.ProvidesKey; |