Skip to content

Commit

Permalink
write a line into test.file
Browse files Browse the repository at this point in the history
  • Loading branch information
huifer committed Mar 27, 2024
1 parent e85d261 commit 29e89d2
Show file tree
Hide file tree
Showing 4 changed files with 167 additions and 0 deletions.
42 changes: 42 additions & 0 deletions docs/spring/cs6384cb18-ebda-11ee-8dc9-acde48001122.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/**
* Copyright 2009-2015 the original author or authors.
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.ibatis.exceptions;

/**
* mybatis 异常
* @author Clinton Begin
*/
@SuppressWarnings("deprecation")
public class PersistenceException extends IbatisException {

private static final long serialVersionUID = -7537395265357977271L;

public PersistenceException() {
super();
}

public PersistenceException(String message) {
super(message);
}

public PersistenceException(String message, Throwable cause) {
super(message, cause);
}

public PersistenceException(Throwable cause) {
super(cause);
}
}
88 changes: 88 additions & 0 deletions docs/spring/cs63da3f6c-ebda-11ee-8dc9-acde48001122.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
package com.huifer.jdk.thread;

import java.util.concurrent.CompletionService;
import java.util.concurrent.ExecutorCompletionService;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;

/**
* <p>Title : SpringLoad2 </p>
* <p>Description : </p>
*
* @author huifer
* @date 2019-05-27
*/
public class SpringLoad2 {

public static void main(String[] args) {
SpringLoad2 springLoad2 = new SpringLoad2();
springLoad2.loadProject();
}

public void loadProject() {
try {
long start = System.currentTimeMillis();
ExecutorService service = Executors.newFixedThreadPool(3);
CompletionService completionService = new ExecutorCompletionService(service);

completionService.submit(this::loadSpringMvc, null);
completionService.submit(this::loadMyBatis, null);
completionService.submit(this::loadSpring, null);


int count = 0;
while (count < 3) {
if (completionService.poll() != null) {
count++;
}
}

service.shutdown();
System.out.println(System.currentTimeMillis() - start);

} catch (Exception e) {
e.printStackTrace();

}
}


private void loadSpringMvc() {
loadXML("spring-mvc.xml", 1);
}


private void loadMyBatis() {
loadXML("mybatis.xml", 2);
}

private void loadSpring() {
loadXML("spring.xml", 3);
}


/***
* 加载文件
* @param xml
* @param loadSec
*/
private void loadXML(String xml, int loadSec) {
try {
long startTime = System.currentTimeMillis();
long milliseconds = TimeUnit.SECONDS.toMillis(loadSec);
Thread.sleep(milliseconds);
long endTime = System.currentTimeMillis();

System.out.printf("[线程 : %s] 加载%s 耗时: %d 毫秒\n",
Thread.currentThread().getName(),
xml,
endTime - startTime
);
} catch (Exception e) {
e.printStackTrace();

}
}

}
10 changes: 10 additions & 0 deletions docs/spring/cs642e9ad0-ebda-11ee-8dc9-acde48001122.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.huifer.utils.factory;

public class AbsTransform {
private Object value;

public Object getValue() {
return value;
}

}
27 changes: 27 additions & 0 deletions docs/spring/cs6486c5f2-ebda-11ee-8dc9-acde48001122.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.huifer.design.adapter.login;

/**
* <p>Title : LoginTest </p>
* <p>Description : </p>
*
* @author huifer
* @date 2019-05-21
*/
public class LoginTest {

public static void main(String[] args) {
LoginService loginService = new LoginService();
ResultMsg registA = loginService.regist("a", "1");
System.out.println(registA);
ResultMsg loginA = loginService.login("a", "1");
System.out.println(loginA);

NewLoginService newLoginService = new NewLoginService();
ResultMsg resultMsg = newLoginService.loginForQQ("QQ登陆测试");
System.out.println(resultMsg);

System.out.println(LoginService.menberList);

}

}

0 comments on commit 29e89d2

Please sign in to comment.