diff --git a/docs/spring/cs6384cb18-ebda-11ee-8dc9-acde48001122.java b/docs/spring/cs6384cb18-ebda-11ee-8dc9-acde48001122.java new file mode 100644 index 00000000..65751512 --- /dev/null +++ b/docs/spring/cs6384cb18-ebda-11ee-8dc9-acde48001122.java @@ -0,0 +1,42 @@ +/** + * Copyright 2009-2015 the original author or 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 + * 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); + } +} diff --git a/docs/spring/cs63da3f6c-ebda-11ee-8dc9-acde48001122.java b/docs/spring/cs63da3f6c-ebda-11ee-8dc9-acde48001122.java new file mode 100644 index 00000000..7bb027f1 --- /dev/null +++ b/docs/spring/cs63da3f6c-ebda-11ee-8dc9-acde48001122.java @@ -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; + +/** + *

Title : SpringLoad2

+ *

Description :

+ * + * @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(); + + } + } + +} diff --git a/docs/spring/cs642e9ad0-ebda-11ee-8dc9-acde48001122.java b/docs/spring/cs642e9ad0-ebda-11ee-8dc9-acde48001122.java new file mode 100644 index 00000000..cc6d3d17 --- /dev/null +++ b/docs/spring/cs642e9ad0-ebda-11ee-8dc9-acde48001122.java @@ -0,0 +1,10 @@ +package com.huifer.utils.factory; + +public class AbsTransform { + private Object value; + + public Object getValue() { + return value; + } + +} diff --git a/docs/spring/cs6486c5f2-ebda-11ee-8dc9-acde48001122.java b/docs/spring/cs6486c5f2-ebda-11ee-8dc9-acde48001122.java new file mode 100644 index 00000000..dde15b3d --- /dev/null +++ b/docs/spring/cs6486c5f2-ebda-11ee-8dc9-acde48001122.java @@ -0,0 +1,27 @@ +package com.huifer.design.adapter.login; + +/** + *

Title : LoginTest

+ *

Description :

+ * + * @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); + + } + +}