Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
caopu16
whatsmars
提交
0416876f
W
whatsmars
项目概览
caopu16
/
whatsmars
与 Fork 源项目一致
Fork自
武汉红喜 / whatsmars
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
W
whatsmars
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0416876f
编写于
12月 23, 2017
作者:
武汉红喜
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
whatsmars-boot-sample-aop
上级
a67b38bb
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
75 addition
and
131 deletion
+75
-131
whatsmars-spring-boot-samples/pom.xml
whatsmars-spring-boot-samples/pom.xml
+11
-29
whatsmars-spring-boot-samples/whatsmars-boot-sample-aop/pom.xml
...ars-spring-boot-samples/whatsmars-boot-sample-aop/pom.xml
+3
-8
whatsmars-spring-boot-samples/whatsmars-boot-sample-aop/src/main/java/com/whatsmars/boot/sample/aop/SampleAopApplication.java
...a/com/whatsmars/boot/sample/aop/SampleAopApplication.java
+26
-0
whatsmars-spring-boot-samples/whatsmars-boot-sample-aop/src/main/java/com/whatsmars/boot/sample/aop/monitor/ServiceMonitor.java
...com/whatsmars/boot/sample/aop/monitor/ServiceMonitor.java
+18
-0
whatsmars-spring-boot-samples/whatsmars-boot-sample-aop/src/main/java/com/whatsmars/boot/sample/aop/service/HelloWorldService.java
.../whatsmars/boot/sample/aop/service/HelloWorldService.java
+16
-0
whatsmars-spring-boot-samples/whatsmars-boot-sample-aop/src/main/resources/application.yml
...tsmars-boot-sample-aop/src/main/resources/application.yml
+1
-0
whatsmars-spring-boot-samples/whatsmars-boot-samples-activemq/src/main/java/com/whatsmars/boot/samples/activemq/Consumer.java
...in/java/com/whatsmars/boot/samples/activemq/Consumer.java
+0
-14
whatsmars-spring-boot-samples/whatsmars-boot-samples-activemq/src/main/java/com/whatsmars/boot/samples/activemq/Producer.java
...in/java/com/whatsmars/boot/samples/activemq/Producer.java
+0
-29
whatsmars-spring-boot-samples/whatsmars-boot-samples-activemq/src/main/java/com/whatsmars/boot/samples/activemq/SampleActiveMQApplication.java
...mars/boot/samples/activemq/SampleActiveMQApplication.java
+0
-25
whatsmars-spring-boot-samples/whatsmars-boot-samples-activemq/src/main/resources/application.yml
...-boot-samples-activemq/src/main/resources/application.yml
+0
-6
whatsmars-spring-boot-samples/whatsmars-boot-samples-activemq/src/main/resources/logback.xml
...mars-boot-samples-activemq/src/main/resources/logback.xml
+0
-20
未找到文件。
whatsmars-spring-boot-samples/pom.xml
浏览文件 @
0416876f
...
...
@@ -3,45 +3,27 @@
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"
>
<parent>
<groupId>
com.whatsmars
</groupId>
<artifactId>
whatsmars-parent
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
1.5.2.RELEASE
</version>
<relativePath/>
<!-- lookup parent from repository -->
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
whatsmars-spring-boot-samples
</artifactId>
<groupId>
com.whatsmars
</groupId>
<version>
1.0-SNAPSHOT
</version>
<packaging>
pom
</packaging>
<name>
${project.artifactId}
</name>
<description>
Spring Boot Samples
</description>
<properties>
<main.basedir>
${basedir}/..
</main.basedir>
<java.version>
1.8
</java.version>
</properties>
<modules>
<module>
whatsmars-boot-sample
s-activemq
</module>
<module>
whatsmars-boot-sample
-aop
</module>
</modules>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-dependencies
</artifactId>
<version>
${spring-boot.version}
</version>
<type>
pom
</type>
<scope>
import
</scope>
</dependency>
<!--<properties>
<main.basedir>${basedir}/..</main.basedir>
<java.version>1.8</java.version>
</properties>-->
<dependency>
<groupId>
org.slf4j
</groupId>
<artifactId>
jcl-over-slf4j
</artifactId>
</dependency>
<dependency>
<groupId>
ch.qos.logback
</groupId>
<artifactId>
logback-classic
</artifactId>
</dependency>
</dependencies>
</dependencyManagement>
</project>
\ No newline at end of file
whatsmars-spring-boot-samples/whatsmars-boot-sample
s-activemq
/pom.xml
→
whatsmars-spring-boot-samples/whatsmars-boot-sample
-aop
/pom.xml
浏览文件 @
0416876f
...
...
@@ -3,25 +3,20 @@
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"
>
<parent>
<groupId>
com.whatsmars
</groupId>
<artifactId>
whatsmars-spring-boot-samples
</artifactId>
<groupId>
com.whatsmars
</groupId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
whatsmars-boot-sample
s-activemq
</artifactId>
<artifactId>
whatsmars-boot-sample
-aop
</artifactId>
<name>
${project.artifactId}
</name>
<description>
Spring Boot ActiveMQ Sample
</description>
<properties>
<main.basedir>
${basedir}/../..
</main.basedir>
</properties>
<dependencies>
<!-- Compile -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-a
ctivemq
</artifactId>
<artifactId>
spring-boot-starter-a
op
</artifactId>
</dependency>
<!-- Test -->
<dependency>
...
...
whatsmars-spring-boot-samples/whatsmars-boot-sample-aop/src/main/java/com/whatsmars/boot/sample/aop/SampleAopApplication.java
0 → 100644
浏览文件 @
0416876f
package
com.whatsmars.boot.sample.aop
;
import
com.whatsmars.boot.sample.aop.service.HelloWorldService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.CommandLineRunner
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
@SpringBootApplication
public
class
SampleAopApplication
implements
CommandLineRunner
{
// Simple example shows how an application can spy on itself with AOP
@Autowired
private
HelloWorldService
helloWorldService
;
@Override
public
void
run
(
String
...
args
)
{
System
.
out
.
println
(
this
.
helloWorldService
.
getHelloMessage
());
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
SpringApplication
.
run
(
SampleAopApplication
.
class
,
args
);
}
}
whatsmars-spring-boot-samples/whatsmars-boot-sample-aop/src/main/java/com/whatsmars/boot/sample/aop/monitor/ServiceMonitor.java
0 → 100644
浏览文件 @
0416876f
package
com.whatsmars.boot.sample.aop.monitor
;
import
org.aspectj.lang.JoinPoint
;
import
org.aspectj.lang.annotation.AfterReturning
;
import
org.aspectj.lang.annotation.Aspect
;
import
org.springframework.stereotype.Component
;
@Aspect
@Component
public
class
ServiceMonitor
{
@AfterReturning
(
"execution(* com.whatsmars.boot.sample..*Service.*(..))"
)
public
void
logServiceAccess
(
JoinPoint
joinPoint
)
{
System
.
out
.
println
(
"Completed: "
+
joinPoint
);
}
}
\ No newline at end of file
whatsmars-spring-boot-samples/whatsmars-boot-sample-aop/src/main/java/com/whatsmars/boot/sample/aop/service/HelloWorldService.java
0 → 100644
浏览文件 @
0416876f
package
com.whatsmars.boot.sample.aop.service
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
@Component
public
class
HelloWorldService
{
@Value
(
"${name:World}"
)
private
String
name
;
public
String
getHelloMessage
()
{
return
"Hello "
+
this
.
name
;
}
}
\ No newline at end of file
whatsmars-spring-boot-samples/whatsmars-boot-sample-aop/src/main/resources/application.yml
0 → 100644
浏览文件 @
0416876f
name
:
Phil
\ No newline at end of file
whatsmars-spring-boot-samples/whatsmars-boot-samples-activemq/src/main/java/com/whatsmars/boot/samples/activemq/Consumer.java
已删除
100644 → 0
浏览文件 @
a67b38bb
package
com.whatsmars.boot.samples.activemq
;
import
org.springframework.jms.annotation.JmsListener
;
import
org.springframework.stereotype.Component
;
@Component
public
class
Consumer
{
@JmsListener
(
destination
=
"sample.queue"
)
public
void
receiveQueue
(
String
text
)
{
System
.
out
.
println
(
text
);
}
}
\ No newline at end of file
whatsmars-spring-boot-samples/whatsmars-boot-samples-activemq/src/main/java/com/whatsmars/boot/samples/activemq/Producer.java
已删除
100644 → 0
浏览文件 @
a67b38bb
package
com.whatsmars.boot.samples.activemq
;
import
javax.jms.Queue
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.CommandLineRunner
;
import
org.springframework.jms.core.JmsMessagingTemplate
;
import
org.springframework.stereotype.Component
;
@Component
public
class
Producer
implements
CommandLineRunner
{
@Autowired
private
JmsMessagingTemplate
jmsMessagingTemplate
;
@Autowired
private
Queue
queue
;
@Override
public
void
run
(
String
...
args
)
throws
Exception
{
send
(
"Sample message"
);
System
.
out
.
println
(
"Message was sent to the Queue"
);
}
public
void
send
(
String
msg
)
{
this
.
jmsMessagingTemplate
.
convertAndSend
(
this
.
queue
,
msg
);
}
}
\ No newline at end of file
whatsmars-spring-boot-samples/whatsmars-boot-samples-activemq/src/main/java/com/whatsmars/boot/samples/activemq/SampleActiveMQApplication.java
已删除
100644 → 0
浏览文件 @
a67b38bb
package
com.whatsmars.boot.samples.activemq
;
import
javax.jms.Queue
;
import
org.apache.activemq.command.ActiveMQQueue
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.jms.annotation.EnableJms
;
@SpringBootApplication
@EnableJms
public
class
SampleActiveMQApplication
{
@Bean
public
Queue
queue
()
{
return
new
ActiveMQQueue
(
"sample.queue"
);
}
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
SampleActiveMQApplication
.
class
,
args
);
}
}
\ No newline at end of file
whatsmars-spring-boot-samples/whatsmars-boot-samples-activemq/src/main/resources/application.yml
已删除
100644 → 0
浏览文件 @
a67b38bb
---
spring
:
activemq
:
in-memory
:
true
pool
:
enabled
:
false
\ No newline at end of file
whatsmars-spring-boot-samples/whatsmars-boot-samples-activemq/src/main/resources/logback.xml
已删除
100644 → 0
浏览文件 @
a67b38bb
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<property
name=
"log.context.name"
value=
"sharding-jdbc-spring-namespace-mybatis-example"
/>
<property
name=
"log.charset"
value=
"UTF-8"
/>
<property
name=
"log.pattern"
value=
"[%-5level] %date --%thread-- [%logger] %msg %n"
/>
<contextName>
${log.context.name}
</contextName>
<appender
name=
"STDOUT"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<encoder
charset=
"${log.charset}"
>
<pattern>
${log.pattern}
</pattern>
</encoder>
</appender>
<root>
<level
value=
"INFO"
/>
<appender-ref
ref=
"STDOUT"
/>
</root>
</configuration>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录