boot

spring底层原理解析

∥☆過路亽.° 提交于 2019-12-11 17:43:31
​ 一、概念 1、Spring Spring是一个开放源代码的设计层面框架,他解决的是业务逻辑层和其他各层的松耦合问题,因此它将面向接口的编程思想贯穿整个系统应用。可以接管web层,业务层,dao层,持久层的组件,并且可以配置各种bean,和维护bean与bean之间的关系。其核心就是控制反转(IOC),和面向切面(AOP) ,简单来说,Spring是一个分层的JavaSE/EE full-stack(一站式) 轻量级开源框架。 2、SpringMVC Spring 框架提供了构建 Web 应用程序的全功能 MVC 模块。使用 Spring 可插入的 MVC 架构,可以选择是使用内置的 Spring Web 框架还是 Struts 这样的 Web 框架。通过策略接口,Spring 框架是高度可配置的,而且包含多种视图技术,例如 JavaServer Pages(JSP)技术、Velocity、Tiles、iText 和 POI。Spring MVC 框架并不知道使用的视图,所以不会强迫您只使用 JSP 技术。Spring MVC 分离了控制器、模型对象、分派器以及处理程序对象的角色,这种分离让它们更容易进行定制。 3、SpringBoot Springboot是一个微服务框架,延续了spring框架的核心思想IOC和AOP,简化了应用的开发和部署。Spring

Spring Boot排除自动配置的方法

╄→尐↘猪︶ㄣ 提交于 2019-12-11 16:29:55
Spring Boot 提供的自动配置非常强大,某些情况下,自动配置的功能可能不符合我们的需求,需要我们自定义配置,这个时候就需要排除/禁用 Spring Boot 某些类的自动化配置了。比如:数据源、邮件,这些都是提供了自动配置的,我们需要排除 Spring Boot 的自动化配置,交给我们自己来自定义。 方法1 使用 @SpringBootApplication 注解的时候,使用 exclude 属性进行排除指定的类: @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, MailSenderAutoConfiguration.class}) public class Application { // ... } 自动配置类不在类路径下的时候,使用 excludeName 属性进行排除指定的类名全路径: @SpringBootApplication(excludeName = {"org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration", "org.springframework.boot.autoconfigure.mail.MailSenderAutoConfiguration"}) public

idea 远程docker部署 Spring Boot 项目

二次信任 提交于 2019-12-11 15:19:05
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 前言 饭要一口一口吃的嘛,在进入玩什么saas啊,k8s这些听上去就很牛的东西之前,我们总归是要知道小微应用的简单部署不是。 设置docker开启远程访问功能 PS : 首先我们不建议在真正应用领域使用这种本文的方式来部署应用,虽然简单方便,但是安全性很低。主要原因就在于,我们需要开启dokcer的远程操作权限。这就会导致任何人都能通过指定端口访问我们的docker服务,进行一些破坏性操作。 PS : 在真正使用的时候,我们可能通过将spring boot产生的jar包直接拷贝到docker宿主机上进行操作。 docker环境 ubuntu的宿主机 开启远程访问 sudo vim /lib/systemd/system/docker.service 修改ExecStart这行 ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock systemctl daemon-reload #重新加载配置文件 systemctl restart docker.service # 重启服务 netstat -nlpt #查看 2375端口是否处于监听状态。 PS:可以修改2375端口值,因为2375是默认端口,大家都知道

Creating an android service to run in the background using python

感情迁移 提交于 2019-12-11 13:19:32
问题 I would like to know if it is possible to run an android service in the background (and possibly on boot) without rooting the device, using python and sl4a and if so how would i go about doing that. 回答1: For running a service in background or on boot you have to define a Broadcast Receiver which will basically start the service. Please refer code snippets mentioned in the answer of below question. Android BroadcastReceiver on startup - keep running when Activity is in Background I have seen

spring boot 集成 dubbo starter 实现多注册中心配置(yaml配置)

岁酱吖の 提交于 2019-12-11 12:24:47
spring boot 集成 dubbo后yml配置如何写呢,下面就跟我一起看看。 三个module: spring-boot-dubbo-share spring-boot-dubbo-provider spring-boot-dubbo-consumer 首先在spring-boot-dubbo-share模块中定义个一个接口 【强调】 : zookeeper的地址,替换成你们自己的,如果没有则写 N/A package com.share.service; /** * @Author: zj * @Date: 2019-09-23 * @Version 1.0 */ public interface IDubboPrintService { String print(String string); } 完成之后,记得maven点击clean->package->install,方便后面的provder和consumer模块引用。 然后在spring-boot-dubbo-provider提供服务 首先pom.xml配置如下( 注意:把第一步中的share模块引入进去 ),我这里没写出来,毕竟你的jar包名跟我的不一样 ...... <properties> <project.build.sourceEncoding>UTF-8</project.build

Spring Boot 介绍

做~自己de王妃 提交于 2019-12-11 11:57:56
Spring Boot 介绍 随着动态语言的流行(Ruby、Scala、Node.js), Java的开发显得格外的笨重;繁多的配置、低下的开发效率、复杂的部署流程以及第三方技术整合难度大。 在上述环境下,Spring Boot由此诞生,它的设计是为了使您能够尽可能快地启动和运行。它使用 “习惯优于 配置” (项目中存在大量的配置,而 Spring Boot 内置一个习惯性的配置,让你无须手动进行配置)的理念让 你的项目快速运行起来。使用 Spring Boot 很容易创建一个独立运行(运行jar,内嵌 Servlet 容器)、准生产 强力的基于 Spring 框架的项目,使用 Spring Boot你可以不用或者只需要很少的 Spring 配置。提供了 J2EE 开发的一站式解决方案。 Spring Boot 优点 1、快速构建独立运行的Spring项目; 2、无须依赖外部Servlet容器,应用无需打成WAR包;项目可以打成jar包独自运行; 3、提供 一系列 starter pom 来简化 Maven 的依赖加载; 4、大量的自动配置,对主流开发框架的无配置集成; 5、无须配置XML,开箱即用,简化开发,同时也可以修改默认值来满足特定的需求; 6、Spring Boot 并不是对 Spring 功能上的增强,而是提供了一种快速使用 Spring 的方式; 7、极大提高了开发

bootlin kernel doesn't boot from UBIFS

我的未来我决定 提交于 2019-12-11 10:59:32
问题 following bootlin embedded linux course and faced an issue (similar to UBI layout volume not found but my problem is further than original one) I am creating rootfs and data volume images: mkfs.ubifs -d ./www/upload -o ../data.ubifs -e 124KiB -m 2048 -c 66 mkfs.ubifs -d ./ -o ../rootfs.ubifs -e 124KiB -m 2048 -c 66 then ubinize all that stuff via config [dtb-volume] peb=0x20000 min_io_size=0x800 mode=ubi image=at91-sama5d3_xplained.dtb vol_id=0 vol_size=128KiB vol_type=static vol_name=dtb vol

冬天OS(一):BOOT

微笑、不失礼 提交于 2019-12-11 09:17:07
-------------------------------------------------------- boot 加载loader 到内存 跳转到 loader -------------------------------------------------------- 一,一个符合 FAT12 文件系统格式的简单 boot 扇区 ; ---------------------------- ; <boot.asm> ; Jack Zheng 11.26 ; ---------------------------- org 07c00h ; ---------------------------- BS_OEMName DB 'ForrestY' ; OEM String, 必须 8 个字节 BPB_BytsPerSec DW 512 ; 每扇区字节数 BPB_SecPerClus DB 1 ; 每簇多少扇区 BPB_RsvdSecCnt DW 1 ; Boot 记录占用多少扇区 BPB_NumFATs DB 2 ; 共有多少 FAT 表 BPB_RootEntCnt DW 224 ; 根目录文件数最大值 BPB_TotSec16 DW 2880 ; 逻辑扇区总数 BPB_Media DB 0xF0 ; 媒体描述符 BPB_FATSz16 DW 9 ; 每FAT扇区数

Making this code work on boot

为君一笑 提交于 2019-12-11 07:59:26
问题 I have been stuck on this for weeks now...I can not get this to work. What I am trying to do is for my app to recognize when a user plugs in there earphones/headphones into the phone, and when they do, for it to show a notification icon. Here is my class. I have added the public class ItudeMobileBroadcastReceiver extends BroadcastReceiver { int NOTIFICATION_ID = 1234567890; NotificationManager mNotificationManager; @Override public void onReceive(Context context, Intent intent) { /* Only

Broadcast Receiver not receiving ACTION_BOOT_COMPLETED if app hasn't been run?

泪湿孤枕 提交于 2019-12-11 06:38:53
问题 I have been trying to create an app service that does not have an Activity and i ran into some issues. I want the service to run from boot, so naturally used a BroadcastReciever to catch ACTION_BOOT_COMPLETED this is no problem while testing. I used an Activity to start and stop the service to test it was working then rebooted to see if the boot receiver worked, it did, happy days. Removed the test Activity and from the application and used the below manifest. <manifest xmlns:android="http:/