Skip to content

Instantly share code, notes, and snippets.

@Configuration
public class EnvConfig {
Logger logger = LoggerFactory.getLogger(EnvConfig.class);
@Autowired
private EnvRepository envRepository;
@Bean
public EnvironmentRepository getEnvironmentRepository(){
@Override
public Object intercept(Invocation invocation) throws Throwable {
Object[] args = invocation.getArgs();
MappedStatement ms = (MappedStatement)args[0];
Object param = (Object)args[1];
BoundSql boundSql = ms.getBoundSql(param);
List<ParameterMapping> parameterMappings = boundSql.getParameterMappings();
TypeHandlerRegistry typeHandlerRegistry = ms.getConfiguration().getTypeHandlerRegistry();
@Slf4j
@Intercepts (
{
@Signature(type = Executor.class, method = "update", args = {MappedStatement.class, Object.class})
}
)
@Component
public class UpdateInterceptor implements Interceptor {
@Configuration
public class ResourceVersioningDialectConfig {
@Bean
public ResourceVersioningDialect getResourceVersioningDialect() {
return new ResourceVersioningDialect();
}
# 특정상황시 nginx 에서 reverse-proxy 하지 않고 차단하기 위한 conf
server {
listen 80;
server_name test.circlee7.com;
charset utf-8;
root /home/nginx/www;
index index.html;
import lombok.AllArgsConstructor;
import lombok.Data;
@AllArgsConstructor
public @Data class LocalDateTest {
public String name = "";
public LocalDateTimeYMD timeYmd;
import lombok.AllArgsConstructor;
import lombok.Data;
@AllArgsConstructor
public @Data class LocalDateTest {
public String name = "";
public LocalDateTimeYMD timeYmd;
// JavaScript
function sortObject(object){
if(!object) {
return object;
}
var sortedObj = {},
keys = Object.keys(object);
keys.sort(function(key1, key2){
Option and Default Value Description
-XX:-CITime Prints time spent in JIT Compiler. (Introduced in 1.4.0.)
-XX:ErrorFile=./hs_err_pid<pid>.log If an error occurs, save the error data to this file. (Introduced in 6.)
-XX:-ExtendedDTraceProbes Enable performance-impacting dtrace probes. (Introduced in 6. Relevant to Solaris only.)
-XX:HeapDumpPath=./java_pid<pid>.hprof Path to directory or filename for heap dump. Manageable. (Introduced in 1.4.2 update 12, 5.0 update 7.)
-XX:-HeapDumpOnOutOfMemoryError Dump heap to file when java.lang.OutOfMemoryError is thrown. Manageable. (Introduced in 1.4.2 update 12, 5.0 update 7.)
-XX:OnError=<cmd args>;<cmd args> Run user-defined commands on fatal error. (Introduced in 1.4.2 update 9.)
-XX:OnOutOfMemoryError=<cmd args>; <cmd args> Run user-defined commands when an OutOfMemoryError is first thrown. (Introduced in 1.4.2 update 12, 6)
-XX:-PrintClassHistogram Print a histogram of class instances on Ctrl-Break. Manageable. (Introduced in 1.4.2.) The jmap -histo command provi
Option and Default Value Description
-XX:+AggressiveOpts Turn on point performance compiler optimizations that are expected to be default in upcoming releases. (Introduced in 5.0 update 6.)
-XX:CompileThreshold=10000 Number of method invocations/branches before compiling [-client: 1,500]
-XX:LargePageSizeInBytes=4m Sets the large page size used for the Java heap. (Introduced in 1.4.0 update 1.) [amd64: 2m.]
-XX:MaxHeapFreeRatio=70 Maximum percentage of heap free after GC to avoid shrinking.
-XX:MaxNewSize=size Maximum size of new generation (in bytes). Since 1.4, MaxNewSize is computed as a function of NewRatio. [1.3.1 Sparc: 32m; 1.3.1 x86: 2.5m.]
-XX:MaxPermSize=64m Size of the Permanent Generation. [5.0 and newer: 64 bit VMs are scaled 30% larger; 1.4 amd64: 96m; 1.3.1 -client: 32m.]
-XX:MinHeapFreeRatio=40 Minimum percentage of heap free after GC to avoid expansion.
-XX:NewRatio=2 Ratio of old/new generation sizes. [Sparc -client: 8; x86 -server: 8; x86 -client: 12.]-client: 4 (1.3) 8 (1.3.1+), x86: 12]