라벨이 Java인 게시물 표시

Ubuntu Java Installation

apt-get --installed list sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java8-installer sudo update-alternatives --config java sudo gedit /etc/environment [sudo nano /etc/environment] [sudo vi /etc/environment] JAVA_HOME="/usr/lib/jvm/java-8-oracle" source /etc/environment

Maven Shade Plugin

<plugin>     <groupId>org.apache.maven.plugins</groupId>     <artifactId>maven-shade-plugin</artifactId>     <version>${maven.shade.plugin.version}</version>     <executions>         <execution>             <phase>package</phase>             <goals>                 <goal>shade</goal>             </goals>             <configuration>                 <finalName>${project.artifactId}</finalName>                 <minimizeJar>false</minimizeJar>                 <filters>               ...

Maven Assembly Plugin

<plugin>     <groupId>org.apache.maven.plugins</groupId>     <artifactId>maven-assembly-plugin</artifactId>     <executions>         <execution>             <id>create-jar</id>             <phase>package</phase>             <goals>                 <goal>single</goal>             </goals>             <configuration>                 <descriptorRefs>                     <descriptorRef>                         jar-with-dependencies                 ...

Scala Maven Example

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">     <modelVersion>4.0.0</modelVersion>     <groupId>kr.co.devlog</groupId>     <artifactId>scala-maven-example</artifactId>     <version>0.0.1-SNAPSHOT</version>     <packaging>jar</packaging>     <properties>        <!-- Project Properties -->         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>         <!-- Plug-in properties -->         <scala.version>2.11.7</scal...

스레드 풀 최적값 계산

N threads  = N cpu  * U cpu  * ( 1 + W / C ) N cpu  = Runtime.getRuntime().availableProcessors()가 반환하는 코어 수 U cpu  = CPU 활용율 (0~1 사이) W/C = 대기 시간 / 계산 시간 예시 코어 수 = 4 활용율 = 1 (100%) W/C = 80 / 20 = 4 최적 쓰레드 수 = 4 * 1 * 4 = 16 출처 - 자바 병렬 프로그래밍 (한글판 p255, 브라이언 게츠 공저) -  http://www.se.rit.edu/~tabeec/RIT_441/Schedule_files/Thread%20Pools.pdf

WebListener

Scope Listener Event Application ServletContextListener 시작, 종료 ServletContextAttributeListener 속성 추가, 수정, 삭제 Session HttpSessionListener 시작, 종료 HttpSessionActivationListener 활성, 비활성 HttpSessionAttributeListener 속성 추가, 수정, 삭제 Request ServletRequestListener 시작, 종료 ServletRequestAttributeListener 속성 추가, 수정, 삭제 사용법 web.xml에 등록 @WebListener 어노테이션 사용 (Servlet 3.0 이상만 가능) web.xml 방식 <listener>      <listener- class >com.example.CustomServletRequestListener</listener- class > </listener> @WebListener 방식 @WebListener public   class   CustomServletRequestListener  implements   ServletContextListener {      @Override      public   void   contextInitialized(ServletContextEvent sce) {          // TODO 어플리케이션 시작 시점 작업 구현      }      @Override ...

DBCP2

이미지
Parameter Description username The connection username to be passed to our JDBC driver to establish a connection. password The connection password to be passed to our JDBC driver to establish a connection. url The connection URL to be passed to our JDBC driver to establish a connection. driverClassName The fully qualified Java class name of the JDBC driver to be used. connectionProperties The connection properties that will be sent to our JDBC driver when establishing new connections. Format of the string must be [propertyName=property;]* NOTE  - The "user" and "password" properties will be passed explicitly, so they do not need to be included here. Parameter Default Description defaultAutoCommit driver default The default auto-commit state of connections created by this pool. If not set then the setAutoCommit method will not be called. defaultReadOnly driver default The default read-only state of connections created by this pool. If not set then the...