自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(10)
  • 收藏
  • 关注

原创 Java深拷贝

public class DeepCopy { public static Object copy(Object orig) throws NotSerializableException { Object obj = null; try { // Write the object out to a byte array ...

2018-11-27 17:39:51 199

原创 RateLimiter做限流

<dependency> <groupId>com.google.inject.extensions</groupId> <artifactId>guice-multibindings</artifactId> <version>RELEASE</version></dep

2018-11-26 14:41:10 240

原创 使用WebAsyncTask与Callable实现异步Http接口

1.实现一个接口@RestControllerpublic class LocalController { private static final Log log = LogFactory.getLog(MethodHandles.lookup().lookupClass()); @RequestMapping("/ac") public WebAsyncTas...

2018-11-15 17:36:30 1343

原创 Spring使用EnvironmentPostProcessor自定义启动配置项

public class MyEnvironmentPostProcessor implements EnvironmentPostProcessor { private static final String PROPERTY_SOURCE_NAME = "defaultProperties"; @Override public void postProcessEn...

2018-11-15 16:37:45 7410

原创 Spring Cloud使用BootstrapConfiguration配置启动加载项

使用BootstrapConfiguration加载,等同于bootstrap.yml中的配置使用PropertySourceLocator接口@Configurationpublic class BootstrapConfigurer implements PropertySourceLocator { private static final Logger log = L...

2018-11-15 16:11:42 14389 1

原创 Spring使用DeferredResult实现长连接

@RestController@RequestMapping("/notifications")public class NotificationResource implements ReleaseMessageListener { private static final Logger logger = LoggerFactory.getLogger(NotificationRe...

2018-11-15 16:00:46 4967 1

原创 根据profile切换resouce

去除resource<resources> <resource> <directory>src/main/resources</directory> <excludes> <exclude>dev/*</exclude> &

2017-12-22 09:19:25 189

原创 抽象类的单例模式

/* * 单例模式 * 建立在类加载时,所以天生对多线程友好 */public class SingleInstance {        private SingleInstance() {    System.out.println("is create");    }        private static class SingleHolder {    ...

2017-11-09 19:43:59 264

原创 spring cloud 随笔记录

Server的配置在ServerProperties中。

2017-11-09 10:09:33 175

原创 Spring Cloud项目启动,Tomcat报端口已被使用

因为用feign,所以引用了另一个Spring Cloud项目。而另外一个项目的server.port写在application.properties中。替换了本地项目的配置文件。把另外一个项目server.port写在bootstrap.properties中。再次引用,问题解决。...

2017-11-09 09:53:03 1431

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除