Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
8e3a7a28
C
cat
项目概览
梦中观雨
/
cat
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
cat
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8e3a7a28
编写于
10月 30, 2012
作者:
Y
youyong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify the alert info
上级
2da8a882
变更
23
隐藏空白更改
内联
并排
Showing
23 changed file
with
338 addition
and
124 deletion
+338
-124
cat-home/pom.xml
cat-home/pom.xml
+35
-0
cat-home/src/main/java/com/dianping/cat/build/AlarmComponentConfigurator.java
...va/com/dianping/cat/build/AlarmComponentConfigurator.java
+7
-5
cat-home/src/main/java/com/dianping/cat/build/CatDatabaseConfigurator.java
.../java/com/dianping/cat/build/CatDatabaseConfigurator.java
+1
-1
cat-home/src/main/java/com/dianping/cat/helper/CatString.java
...home/src/main/java/com/dianping/cat/helper/CatString.java
+2
-2
cat-home/src/main/java/com/dianping/cat/system/alarm/AlarmTask.java
...rc/main/java/com/dianping/cat/system/alarm/AlarmTask.java
+15
-8
cat-home/src/main/java/com/dianping/cat/system/alarm/alert/AlertInfo.java
...n/java/com/dianping/cat/system/alarm/alert/AlertInfo.java
+7
-7
cat-home/src/main/java/com/dianping/cat/system/alarm/alert/AlertManager.java
...ava/com/dianping/cat/system/alarm/alert/AlertManager.java
+29
-14
cat-home/src/main/java/com/dianping/cat/system/alarm/connector/impl/ThresholdConnector.java
...g/cat/system/alarm/connector/impl/ThresholdConnector.java
+4
-5
cat-home/src/main/java/com/dianping/cat/system/alarm/threshold/ThresholdRule.java
...om/dianping/cat/system/alarm/threshold/ThresholdRule.java
+0
-3
cat-home/src/main/java/com/dianping/cat/system/alarm/threshold/ThresholdRuleManager.java
...ping/cat/system/alarm/threshold/ThresholdRuleManager.java
+1
-1
cat-home/src/main/java/com/dianping/cat/system/alarm/threshold/listener/ExceptionDataListener.java
...ystem/alarm/threshold/listener/ExceptionDataListener.java
+10
-15
cat-home/src/main/java/com/dianping/cat/system/alarm/threshold/listener/ServiceDataListener.java
.../system/alarm/threshold/listener/ServiceDataListener.java
+2
-0
cat-home/src/main/java/com/dianping/cat/system/alarm/threshold/listener/ThresholdAlertListener.java
...stem/alarm/threshold/listener/ThresholdAlertListener.java
+51
-25
cat-home/src/main/java/com/dianping/cat/system/notify/ScheduledMailTask.java
...ava/com/dianping/cat/system/notify/ScheduledMailTask.java
+2
-1
cat-home/src/main/java/com/dianping/cat/system/page/alarm/RuleManager.java
.../java/com/dianping/cat/system/page/alarm/RuleManager.java
+1
-10
cat-home/src/main/java/com/dianping/cat/system/page/alarm/ScheduledManager.java
.../com/dianping/cat/system/page/alarm/ScheduledManager.java
+22
-24
cat-home/src/main/java/com/dianping/cat/system/tool/MailSMSImpl.java
...c/main/java/com/dianping/cat/system/tool/MailSMSImpl.java
+86
-3
cat-home/src/main/resources/META-INF/dal/jdbc/user-codegen.xml
...ome/src/main/resources/META-INF/dal/jdbc/user-codegen.xml
+1
-0
cat-home/src/main/resources/META-INF/plexus/components.xml
cat-home/src/main/resources/META-INF/plexus/components.xml
+11
-0
cat-home/src/main/resources/freemaker/exceptionAlarm.ftl
cat-home/src/main/resources/freemaker/exceptionAlarm.ftl
+12
-0
cat-home/src/main/resources/freemaker/serviceAlarm.ftl
cat-home/src/main/resources/freemaker/serviceAlarm.ftl
+12
-0
cat-home/src/main/resources/spring/applicationContext.properties
...e/src/main/resources/spring/applicationContext.properties
+0
-0
cat-home/src/main/resources/spring/remoteService.xml
cat-home/src/main/resources/spring/remoteService.xml
+27
-0
未找到文件。
cat-home/pom.xml
浏览文件 @
8e3a7a28
...
...
@@ -11,6 +11,41 @@
<name>
CAT Home
</name>
<packaging>
war
</packaging>
<dependencies>
<dependency>
<groupId>
com.dianping.dpsf
</groupId>
<artifactId>
dpsf-net
</artifactId>
<version>
1.7.3
</version>
</dependency>
<dependency>
<groupId>
com.dianping.hawk
</groupId>
<artifactId>
hawk-client
</artifactId>
<version>
0.6.7
</version>
</dependency>
<dependency>
<groupId>
com.dianping.lion
</groupId>
<artifactId>
lion-client
</artifactId>
<version>
0.2.2
</version>
</dependency>
<dependency>
<groupId>
com.dianping
</groupId>
<artifactId>
mail-api
</artifactId>
<version>
1.0.0
</version>
</dependency>
<dependency>
<groupId>
com.dianping
</groupId>
<artifactId>
sms-api
</artifactId>
<version>
1.0.2
</version>
</dependency>
<dependency>
<groupId>
com.dianping.lion
</groupId>
<artifactId>
lion-${env}
</artifactId>
<version>
1.0.0
</version>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring
</artifactId>
<version>
2.5.6
</version>
</dependency>
<dependency>
<groupId>
com.dianping.cat
</groupId>
<artifactId>
cat-consumer
</artifactId>
...
...
cat-home/src/main/java/com/dianping/cat/build/AlarmComponentConfigurator.java
浏览文件 @
8e3a7a28
...
...
@@ -3,6 +3,7 @@ package com.dianping.cat.build;
import
java.util.ArrayList
;
import
java.util.List
;
import
com.dianping.cat.configuration.ServerConfigManager
;
import
com.dianping.cat.home.dal.alarm.AlarmRuleDao
;
import
com.dianping.cat.home.dal.alarm.AlarmTemplateDao
;
import
com.dianping.cat.home.dal.alarm.MailRecordDao
;
...
...
@@ -15,9 +16,9 @@ import com.dianping.cat.system.alarm.alert.AlertManager;
import
com.dianping.cat.system.alarm.connector.Connector
;
import
com.dianping.cat.system.alarm.connector.impl.ThresholdConnector
;
import
com.dianping.cat.system.alarm.threshold.ThresholdRuleManager
;
import
com.dianping.cat.system.alarm.threshold.listener.ExceptionDataListener
;
import
com.dianping.cat.system.alarm.threshold.listener.ServiceDataListener
;
import
com.dianping.cat.system.alarm.threshold.listener.ThresholdAlertListener
;
import
com.dianping.cat.system.alarm.threshold.listener.ExceptionDataListener
;
import
com.dianping.cat.system.event.DefaultEventDispatcher
;
import
com.dianping.cat.system.event.DefaultEventListenerRegistry
;
import
com.dianping.cat.system.event.EventDispatcher
;
...
...
@@ -42,7 +43,7 @@ public class AlarmComponentConfigurator extends AbstractResourceConfigurator {
.
req
(
AlarmRuleDao
.
class
,
AlarmTemplateDao
.
class
,
ScheduledReportDao
.
class
)
//
.
req
(
ModelService
.
class
,
"event"
));
all
.
add
(
C
(
MailSMS
.
class
,
MailSMSImpl
.
class
));
all
.
add
(
C
(
MailSMS
.
class
,
MailSMSImpl
.
class
)
.
req
(
ServerConfigManager
.
class
)
);
all
.
add
(
C
(
ReportRender
.
class
,
ReportRenderImpl
.
class
));
...
...
@@ -58,16 +59,17 @@ public class AlarmComponentConfigurator extends AbstractResourceConfigurator {
all
.
add
(
C
(
Connector
.
class
,
ThresholdConnector
.
class
));
all
.
add
(
C
(
AlertManager
.
class
).
req
(
MailRecordDao
.
class
));
all
.
add
(
C
(
AlertManager
.
class
).
//
req
(
MailRecordDao
.
class
,
MailSMS
.
class
,
ServerConfigManager
.
class
));
all
.
add
(
C
(
ThresholdRuleManager
.
class
).
//
req
(
AlarmTemplateDao
.
class
,
AlarmRuleDao
.
class
));
all
.
add
(
C
(
ExceptionDataListener
.
class
).
//
req
(
EventDispatcher
.
class
,
ThresholdRuleManager
.
class
));
req
(
EventDispatcher
.
class
,
ThresholdRuleManager
.
class
));
all
.
add
(
C
(
ServiceDataListener
.
class
).
//
req
(
EventDispatcher
.
class
,
ThresholdRuleManager
.
class
));
req
(
EventDispatcher
.
class
,
ThresholdRuleManager
.
class
));
all
.
add
(
C
(
ThresholdAlertListener
.
class
).
//
req
(
AlertManager
.
class
,
RuleManager
.
class
));
...
...
cat-home/src/main/java/com/dianping/cat/build/CatDatabaseConfigurator.java
浏览文件 @
8e3a7a28
...
...
@@ -12,7 +12,7 @@ final class CatDatabaseConfigurator extends AbstractJdbcResourceConfigurator {
List
<
Component
>
all
=
new
ArrayList
<
Component
>();
all
.
add
(
defineJdbcDataSourceConfigurationManagerComponent
(
"datasources.xml"
));
all
.
add
(
defineJdbcDataSourceComponent
(
"cat"
,
"com.mysql.jdbc.Driver"
,
"jdbc:mysql://1
92.168.7.43
:3306/cat"
,
"root"
,
""
,
"<![CDATA[useUnicode=true&autoReconnect=true]]>"
));
all
.
add
(
defineJdbcDataSourceComponent
(
"cat"
,
"com.mysql.jdbc.Driver"
,
"jdbc:mysql://1
27.0.0.1
:3306/cat"
,
"root"
,
""
,
"<![CDATA[useUnicode=true&autoReconnect=true]]>"
));
defineSimpleTableProviderComponents
(
all
,
"cat"
,
com
.
dianping
.
cat
.
home
.
dal
.
report
.
_INDEX
.
getEntityClasses
());
defineDaoComponents
(
all
,
com
.
dianping
.
cat
.
home
.
dal
.
report
.
_INDEX
.
getDaoClasses
());
...
...
cat-home/src/main/java/com/dianping/cat/helper/CatString.java
浏览文件 @
8e3a7a28
...
...
@@ -15,7 +15,7 @@ public class CatString {
public
static
final
String
CAT
=
"Cat"
;
public
static
final
String
EXCEPTION
=
" 异常过多告警"
;
public
static
final
String
EXCEPTION
=
"
CAT
异常过多告警"
;
public
static
final
String
SERVICE
=
" 服务调用告警"
;
public
static
final
String
SERVICE
=
"
CAT
服务调用告警"
;
}
cat-home/src/main/java/com/dianping/cat/system/alarm/AlarmTask.java
浏览文件 @
8e3a7a28
...
...
@@ -3,6 +3,7 @@ package com.dianping.cat.system.alarm;
import
java.util.List
;
import
com.dianping.cat.Cat
;
import
com.dianping.cat.message.Event
;
import
com.dianping.cat.message.Transaction
;
import
com.dianping.cat.system.alarm.connector.Connector
;
import
com.dianping.cat.system.alarm.threshold.ThresholdDataEntity
;
...
...
@@ -58,18 +59,22 @@ public class AlarmTask implements Task {
private
void
processServiceRule
()
{
List
<
ThresholdRule
>
rules
=
m_manager
.
getAllServiceRules
();
Transaction
t
=
Cat
.
newTransaction
(
"
Syste
m"
,
"ProcessServiceRule"
);
Transaction
t
=
Cat
.
newTransaction
(
"
Alar
m"
,
"ProcessServiceRule"
);
for
(
ThresholdRule
rule
:
rules
)
{
try
{
ThresholdDataEntity
entity
=
m_connector
.
fetchAlarmData
(
rule
.
getConnectUrl
());
String
connectUrl
=
rule
.
getConnectUrl
();
ThresholdDataEntity
entity
=
m_connector
.
fetchAlarmData
(
connectUrl
);
if
(
entity
!=
null
)
{
entity
.
setDomain
(
rule
.
getDomain
());
String
domain
=
rule
.
getDomain
();
entity
.
setDomain
(
domain
);
Cat
.
getProducer
().
logEvent
(
"AlarmRule"
,
domain
+
"["
+
rule
.
getRuleId
()
+
"]"
,
Event
.
SUCCESS
,
entity
.
toString
());
ServiceDataEvent
event
=
new
ServiceDataEvent
(
entity
);
m_dispatcher
.
dispatch
(
event
);
t
.
addData
(
event
.
toString
());
}
}
catch
(
Exception
e
)
{
t
.
setStatus
(
e
);
...
...
@@ -82,25 +87,27 @@ public class AlarmTask implements Task {
private
void
processExceptionRule
()
{
List
<
ThresholdRule
>
rules
=
m_manager
.
getAllExceptionRules
();
Transaction
t
=
Cat
.
newTransaction
(
"
Syste
m"
,
"ProcessExceptionRule"
);
Transaction
t
=
Cat
.
newTransaction
(
"
Alar
m"
,
"ProcessExceptionRule"
);
for
(
ThresholdRule
rule
:
rules
)
{
try
{
ThresholdDataEntity
entity
=
m_connector
.
fetchAlarmData
(
rule
.
getConnectUrl
());
String
connectUrl
=
rule
.
getConnectUrl
();
ThresholdDataEntity
entity
=
m_connector
.
fetchAlarmData
(
connectUrl
);
if
(
entity
!=
null
)
{
entity
.
setDomain
(
rule
.
getDomain
());
Cat
.
getProducer
().
logEvent
(
"AlarmUrl"
,
connectUrl
,
Event
.
SUCCESS
,
entity
.
toString
());
ExceptionDataEvent
event
=
new
ExceptionDataEvent
(
entity
);
m_dispatcher
.
dispatch
(
event
);
t
.
addData
(
event
.
toString
());
}
t
.
setStatus
(
Transaction
.
SUCCESS
);
}
catch
(
Exception
e
)
{
t
.
setStatus
(
e
);
Cat
.
logError
(
e
);
}
}
t
.
setStatus
(
Transaction
.
SUCCESS
);
t
.
complete
();
}
...
...
cat-home/src/main/java/com/dianping/cat/system/alarm/alert/AlertInfo.java
浏览文件 @
8e3a7a28
...
...
@@ -18,6 +18,8 @@ public class AlertInfo {
public
static
final
int
SMS_TYPE
=
1
;
private
int
m_alertType
;
private
String
m_content
;
private
Date
m_date
;
...
...
@@ -29,10 +31,12 @@ public class AlertInfo {
private
int
m_ruleId
;
private
String
m_ruleType
;
private
String
m_title
;
private
int
m_alertType
;
private
String
m_title
;
public
int
getAlertType
()
{
return
m_alertType
;
}
public
String
getContent
()
{
return
m_content
;
...
...
@@ -68,10 +72,6 @@ public class AlertInfo {
return
m_title
;
}
public
int
getAlertType
()
{
return
m_alertType
;
}
public
void
setAlertType
(
int
alertType
)
{
m_alertType
=
alertType
;
}
...
...
cat-home/src/main/java/com/dianping/cat/system/alarm/alert/AlertManager.java
浏览文件 @
8e3a7a28
package
com.dianping.cat.system.alarm.alert
;
import
java.util.List
;
import
java.util.concurrent.BlockingQueue
;
import
java.util.concurrent.LinkedBlockingQueue
;
import
java.util.concurrent.TimeUnit
;
...
...
@@ -8,9 +9,10 @@ import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
import
org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException
;
import
com.dianping.cat.Cat
;
import
com.dianping.cat.configuration.ServerConfigManager
;
import
com.dianping.cat.home.dal.alarm.MailRecord
;
import
com.dianping.cat.home.dal.alarm.MailRecordDao
;
import
com.dianping.cat.
message.Transaction
;
import
com.dianping.cat.
system.tool.MailSMS
;
import
com.site.helper.Threads
;
import
com.site.helper.Threads.Task
;
import
com.site.lookup.annotation.Inject
;
...
...
@@ -19,18 +21,26 @@ public class AlertManager implements Initializable {
private
final
BlockingQueue
<
AlertInfo
>
m_alarmInfos
=
new
LinkedBlockingQueue
<
AlertInfo
>(
1000
);
@Inject
private
ServerConfigManager
m_configManager
;
@Inject
private
MailRecordDao
m_mailRecordDao
;
@Inject
private
MailSMS
m_mailSms
;
public
void
addAlarmInfo
(
AlertInfo
info
)
{
m_alarmInfos
.
offer
(
info
);
}
@Override
public
void
initialize
()
throws
InitializationException
{
SendAlarmTask
sendAlarmTask
=
new
SendAlarmTask
();
if
(
m_configManager
.
isJobMachine
())
{
SendAlarmTask
sendAlarmTask
=
new
SendAlarmTask
();
Threads
.
forGroup
(
"Cat"
).
start
(
sendAlarmTask
);
Threads
.
forGroup
(
"Cat"
).
start
(
sendAlarmTask
);
}
}
private
void
insert
(
AlertInfo
info
,
int
type
,
boolean
sendResult
)
{
...
...
@@ -41,6 +51,7 @@ public class AlertManager implements Initializable {
record
.
setRuleId
(
info
.
getRuleId
());
record
.
setReceivers
(
info
.
getMails
().
toString
());
if
(
sendResult
)
{
record
.
setStatus
(
1
);
}
else
{
record
.
setStatus
(
0
);
...
...
@@ -54,18 +65,13 @@ public class AlertManager implements Initializable {
}
}
public
class
SendAlarmTask
implements
Task
,
Initializable
{
public
class
SendAlarmTask
implements
Task
{
@Override
public
String
getName
()
{
return
"Send-Notifycation"
;
}
@Override
public
void
initialize
()
throws
InitializationException
{
}
@Override
public
void
run
()
{
boolean
active
=
true
;
...
...
@@ -75,19 +81,28 @@ public class AlertManager implements Initializable {
AlertInfo
entity
=
m_alarmInfos
.
poll
(
5
,
TimeUnit
.
MILLISECONDS
);
if
(
entity
!=
null
)
{
Transaction
t
=
Cat
.
newTransaction
(
"System"
,
"Email"
);
String
alarmType
=
entity
.
getRuleType
();
int
alertType
=
entity
.
getAlertType
();
String
title
=
entity
.
getTitle
();
String
content
=
entity
.
getContent
();
boolean
sendResult
=
false
;
if
(
alertType
==
AlertInfo
.
EMAIL_TYPE
)
{
List
<
String
>
mails
=
entity
.
getMails
();
sendResult
=
m_mailSms
.
sendEmail
(
title
,
content
,
mails
);
}
else
if
(
alertType
==
AlertInfo
.
SMS_TYPE
)
{
List
<
String
>
phones
=
entity
.
getPhones
();
sendResult
=
m_mailSms
.
sendSMS
(
content
,
phones
);
}
if
(
alarmType
.
equals
(
AlertInfo
.
EXCEPTION
))
{
insert
(
entity
,
2
,
sendResult
);
}
else
if
(
alarmType
.
equals
(
AlertInfo
.
SERVICE
))
{
insert
(
entity
,
3
,
sendResult
);
}
t
.
addData
(
entity
.
getContent
()
+
entity
.
getTitle
());
t
.
setStatus
(
Transaction
.
SUCCESS
);
t
.
complete
();
}
else
{
try
{
Thread
.
sleep
(
2
*
1000
);
...
...
cat-home/src/main/java/com/dianping/cat/system/alarm/connector/impl/ThresholdConnector.java
浏览文件 @
8e3a7a28
...
...
@@ -7,7 +7,6 @@ import java.util.Date;
import
java.util.Map
;
import
com.dianping.cat.Cat
;
import
com.dianping.cat.message.Event
;
import
com.dianping.cat.system.alarm.connector.Connector
;
import
com.dianping.cat.system.alarm.threshold.ThresholdDataEntity
;
import
com.google.gson.Gson
;
...
...
@@ -16,10 +15,10 @@ import com.site.helper.Files;
public
class
ThresholdConnector
implements
Connector
{
public
static
long
index
=
1000
;
static
long
index
=
1000
;
@Override
public
ThresholdDataEntity
fetchAlarmData
(
String
url
)
{
Cat
.
getProducer
().
logEvent
(
"System"
,
"AlarmUrl"
,
Event
.
SUCCESS
,
url
);
try
{
return
getContent
(
url
);
}
catch
(
Exception
e
)
{
...
...
@@ -51,9 +50,9 @@ public class ThresholdConnector implements Connector {
data
.
setCount
(
Long
.
parseLong
(
count
));
}
index
+=
100
;
data
.
setCount
(
index
);
index
+=
100
;
data
.
setCount
(
index
);
String
timestamp
=
obj
.
get
(
"timestamp"
);
if
(
timestamp
!=
null
)
{
data
.
setDate
(
new
Date
(
Long
.
parseLong
(
timestamp
)));
...
...
cat-home/src/main/java/com/dianping/cat/system/alarm/threshold/ThresholdRule.java
浏览文件 @
8e3a7a28
...
...
@@ -8,7 +8,6 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.Map
;
import
com.dianping.cat.Cat
;
import
com.dianping.cat.helper.TimeUtil
;
import
com.dianping.cat.home.template.entity.Duration
;
import
com.dianping.cat.home.template.entity.Param
;
...
...
@@ -63,8 +62,6 @@ public class ThresholdRule {
if
(
needAlarm
(
entity
,
duration
))
{
m_lastAlarmTime
.
put
(
duration
.
getId
(),
date
.
getTime
());
Cat
.
getProducer
().
logEvent
(
"System"
,
"Domain"
,
"Alarm"
,
"RealCount:"
+
count
+
" Min:"
+
duration
.
getMin
()
+
" Max:"
+
duration
.
getMax
());
return
meta
;
}
return
null
;
...
...
cat-home/src/main/java/com/dianping/cat/system/alarm/threshold/ThresholdRuleManager.java
浏览文件 @
8e3a7a28
...
...
@@ -353,7 +353,7 @@ public class ThresholdRuleManager implements Initializable {
boolean
active
=
true
;
while
(
active
)
{
Transaction
t
=
Cat
.
newTransaction
(
"
Syste
m"
,
"RefreshRule"
);
Transaction
t
=
Cat
.
newTransaction
(
"
Alar
m"
,
"RefreshRule"
);
t
.
setStatus
(
Transaction
.
SUCCESS
);
try
{
...
...
cat-home/src/main/java/com/dianping/cat/system/alarm/threshold/listener/ExceptionDataListener.java
浏览文件 @
8e3a7a28
...
...
@@ -3,13 +3,13 @@ package com.dianping.cat.system.alarm.threshold.listener;
import
java.util.List
;
import
com.dianping.cat.Cat
;
import
com.dianping.cat.message.
Transaction
;
import
com.dianping.cat.message.
Message
;
import
com.dianping.cat.system.alarm.alert.AlertInfo
;
import
com.dianping.cat.system.alarm.threshold.ThresholdDataEntity
;
import
com.dianping.cat.system.alarm.threshold.ThresholdRule
;
import
com.dianping.cat.system.alarm.threshold.ThresholdRuleManager
;
import
com.dianping.cat.system.alarm.threshold.event.ThresholdAlertEvent
;
import
com.dianping.cat.system.alarm.threshold.event.ExceptionDataEvent
;
import
com.dianping.cat.system.alarm.threshold.event.ThresholdAlertEvent
;
import
com.dianping.cat.system.alarm.threshold.template.ThresholdAlarmMeta
;
import
com.dianping.cat.system.event.Event
;
import
com.dianping.cat.system.event.EventDispatcher
;
...
...
@@ -41,22 +41,17 @@ public class ExceptionDataListener implements EventListener {
List
<
ThresholdRule
>
rules
=
m_manager
.
getExceptionRuleByDomain
(
data
.
getDomain
());
for
(
ThresholdRule
rule
:
rules
)
{
ThresholdAlarmMeta
alarmMeta
=
rule
.
addData
(
data
,
AlertInfo
.
EXCEPTION
);
ThresholdAlarmMeta
alarmMeta
=
rule
.
addData
(
data
,
AlertInfo
.
EXCEPTION
);
if
(
alarmMeta
!=
null
)
{
Transaction
t
=
Cat
.
newTransaction
(
"SendAlarm"
,
"Exception"
);
t
.
addData
(
alarmMeta
.
toString
());
try
{
ThresholdAlertEvent
alertEvent
=
new
ThresholdAlertEvent
(
alarmMeta
);
m_dispatcher
.
dispatch
(
alertEvent
);
t
.
setStatus
(
Transaction
.
SUCCESS
);
}
catch
(
Exception
e
)
{
t
.
setStatus
(
e
);
}
finally
{
t
.
complete
();
}
ThresholdAlertEvent
alertEvent
=
new
ThresholdAlertEvent
(
alarmMeta
);
Cat
.
getProducer
().
logEvent
(
"ExceptionAlarm"
,
"Domain"
,
Message
.
SUCCESS
,
alarmMeta
.
getRuleId
()
+
""
);
m_dispatcher
.
dispatch
(
alertEvent
);
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
}
}
}
...
...
cat-home/src/main/java/com/dianping/cat/system/alarm/threshold/listener/ServiceDataListener.java
浏览文件 @
8e3a7a28
...
...
@@ -3,6 +3,7 @@ package com.dianping.cat.system.alarm.threshold.listener;
import
java.util.List
;
import
com.dianping.cat.Cat
;
import
com.dianping.cat.message.Message
;
import
com.dianping.cat.message.Transaction
;
import
com.dianping.cat.system.alarm.alert.AlertInfo
;
import
com.dianping.cat.system.alarm.threshold.ThresholdDataEntity
;
...
...
@@ -50,6 +51,7 @@ public class ServiceDataListener implements EventListener {
try
{
ThresholdAlertEvent
alertEvent
=
new
ThresholdAlertEvent
(
alarmMeta
);
Cat
.
getProducer
().
logEvent
(
"ServiceAlarm"
,
"Domain"
,
Message
.
SUCCESS
,
alarmMeta
.
getRuleId
()
+
""
);
m_dispatcher
.
dispatch
(
alertEvent
);
t
.
setStatus
(
Transaction
.
SUCCESS
);
}
catch
(
Exception
e
)
{
...
...
cat-home/src/main/java/com/dianping/cat/system/alarm/threshold/listener/ThresholdAlertListener.java
浏览文件 @
8e3a7a28
...
...
@@ -13,6 +13,7 @@ import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationExce
import
com.dianping.cat.Cat
;
import
com.dianping.cat.helper.CatString
;
import
com.dianping.cat.helper.TimeUtil
;
import
com.dianping.cat.home.template.entity.Duration
;
import
com.dianping.cat.system.alarm.alert.AlertInfo
;
import
com.dianping.cat.system.alarm.alert.AlertManager
;
import
com.dianping.cat.system.alarm.threshold.event.ThresholdAlertEvent
;
...
...
@@ -36,10 +37,37 @@ public class ThresholdAlertListener implements EventListener, Initializable {
@Inject
private
RuleManager
m_ruleManager
;
private
String
buildAlarmContent
(
ThresholdAlarmMeta
meta
)
{
private
String
buildAlarmTitle
(
ThresholdAlarmMeta
meta
)
{
String
type
=
meta
.
getType
();
if
(
type
.
equalsIgnoreCase
(
AlertInfo
.
EXCEPTION
))
{
return
CatString
.
EXCEPTION
+
"[ "
+
String
.
valueOf
(
meta
.
getDomain
())
+
" ]"
;
}
else
if
(
type
.
equalsIgnoreCase
(
AlertInfo
.
SERVICE
))
{
return
CatString
.
SERVICE
+
"[ "
+
String
.
valueOf
(
meta
.
getDomain
())
+
" ]"
;
}
return
"Default"
;
}
private
AlertInfo
buildAlertInfo
(
ThresholdAlarmMeta
meta
,
String
title
,
String
content
,
String
ruleType
,
List
<
String
>
address
)
{
AlertInfo
info
=
new
AlertInfo
();
info
.
setContent
(
content
);
info
.
setTitle
(
title
);
info
.
setRuleId
(
meta
.
getRuleId
());
info
.
setDate
(
meta
.
getDate
());
info
.
setRuleType
(
ruleType
);
info
.
setMails
(
address
);
return
info
;
}
private
String
buildEmailAlarmContent
(
ThresholdAlarmMeta
meta
)
{
Map
<
Object
,
Object
>
root
=
new
HashMap
<
Object
,
Object
>();
StringWriter
sw
=
new
StringWriter
(
5000
);
root
.
put
(
"rule"
,
buildRuleMeta
(
meta
.
getDuration
()));
root
.
put
(
"count"
,
meta
.
getRealCount
());
root
.
put
(
"domain"
,
meta
.
getDomain
());
root
.
put
(
"date"
,
meta
.
getDate
());
root
.
put
(
"url"
,
buildProblemUrl
(
meta
.
getBaseUrl
(),
meta
.
getDomain
(),
meta
.
getDate
()));
...
...
@@ -62,18 +90,6 @@ public class ThresholdAlertListener implements EventListener, Initializable {
return
sw
.
toString
();
}
private
String
buildAlarmTitle
(
ThresholdAlarmMeta
meta
)
{
String
type
=
meta
.
getType
();
if
(
type
.
equalsIgnoreCase
(
AlertInfo
.
EXCEPTION
))
{
return
CatString
.
EXCEPTION
+
"[ "
+
String
.
valueOf
(
meta
.
getDomain
())
+
" ]"
;
}
else
if
(
type
.
equalsIgnoreCase
(
AlertInfo
.
SERVICE
))
{
return
CatString
.
SERVICE
+
"[ "
+
String
.
valueOf
(
meta
.
getDomain
())
+
" ]"
;
}
return
"Default"
;
}
private
String
buildProblemUrl
(
String
baseUrl
,
String
domain
,
Date
date
)
{
long
time
=
date
.
getTime
();
...
...
@@ -87,6 +103,15 @@ public class ThresholdAlertListener implements EventListener, Initializable {
return
sb
.
toString
();
}
private
Object
buildRuleMeta
(
Duration
duration
)
{
StringBuilder
sb
=
new
StringBuilder
(
100
);
sb
.
append
(
"[ Interval:"
).
append
(
duration
.
getInterval
()).
append
(
";"
);
sb
.
append
(
" Min:"
).
append
(
duration
.
getMin
()).
append
(
";"
);
sb
.
append
(
" Max:"
).
append
(
duration
.
getMax
()).
append
(
"]"
);
return
sb
.
toString
();
}
@Override
public
void
initialize
()
throws
InitializationException
{
m_configuration
=
new
Configuration
();
...
...
@@ -113,7 +138,7 @@ public class ThresholdAlertListener implements EventListener, Initializable {
ThresholdAlarmMeta
meta
=
alertEvent
.
getAlarmMeta
();
String
title
=
buildAlarmTitle
(
meta
);
String
content
=
buildAlarmContent
(
meta
);
String
content
=
build
Email
AlarmContent
(
meta
);
String
alertType
=
meta
.
getDuration
().
getAlarm
().
toLowerCase
();
String
ruleType
=
meta
.
getType
();
...
...
@@ -121,25 +146,26 @@ public class ThresholdAlertListener implements EventListener, Initializable {
String
[]
types
=
alertType
.
split
(
","
);
for
(
String
type
:
types
)
{
AlertInfo
info
=
new
AlertInfo
();
info
.
setContent
(
content
);
info
.
setTitle
(
title
);
info
.
setRuleId
(
meta
.
getRuleId
());
info
.
setDate
(
meta
.
getDate
());
info
.
setRuleType
(
ruleType
);
if
(
type
.
equalsIgnoreCase
(
AlertInfo
.
EMAIL
))
{
List
<
String
>
address
=
m_ruleManager
.
queryUserMailsByRuleId
(
meta
.
getRuleId
());
AlertInfo
info
=
buildAlertInfo
(
meta
,
title
,
content
,
ruleType
,
address
);
info
.
setAlertType
(
AlertInfo
.
EMAIL_TYPE
);
info
.
setMails
(
address
);
m_alertManager
.
addAlarmInfo
(
info
);
}
else
if
(
type
.
equalsIgnoreCase
(
AlertInfo
.
SMS
))
{
}
if
(
type
.
equalsIgnoreCase
(
AlertInfo
.
SMS
))
{
List
<
String
>
emails
=
m_ruleManager
.
queryUserMailsByRuleId
(
meta
.
getRuleId
());
AlertInfo
emailsInfo
=
buildAlertInfo
(
meta
,
title
,
content
,
ruleType
,
emails
);
emailsInfo
.
setAlertType
(
AlertInfo
.
EMAIL_TYPE
);
m_alertManager
.
addAlarmInfo
(
emailsInfo
);
List
<
String
>
address
=
m_ruleManager
.
queryUserPhonesByRuleId
(
meta
.
getRuleId
());
AlertInfo
info
=
buildAlertInfo
(
meta
,
title
,
title
,
ruleType
,
address
);
info
.
setAlertType
(
AlertInfo
.
SMS_TYPE
);
info
.
setPhones
(
address
);
m_alertManager
.
addAlarmInfo
(
info
);
}
}
...
...
cat-home/src/main/java/com/dianping/cat/system/notify/ScheduledMailTask.java
浏览文件 @
8e3a7a28
...
...
@@ -108,7 +108,7 @@ public class ScheduledMailTask implements Task {
}
private
String
renderTitle
(
String
names
,
String
domain
)
{
return
"
Daily Report
[ "
+
domain
+
" ]"
;
return
"
CAT 日常报表
[ "
+
domain
+
" ]"
;
}
@Override
...
...
@@ -139,6 +139,7 @@ public class ScheduledMailTask implements Task {
List
<
String
>
emails
=
m_scheduledManager
.
queryEmailsBySchReportId
(
report
.
getId
());
boolean
result
=
m_mailSms
.
sendEmail
(
title
,
content
,
emails
);
insertMailLog
(
report
.
getId
(),
content
,
title
,
result
,
emails
);
t
.
setStatus
(
Transaction
.
SUCCESS
);
Cat
.
getProducer
().
logEvent
(
"ScheduledReport"
,
"Email"
,
Event
.
SUCCESS
,
emails
.
toString
());
...
...
cat-home/src/main/java/com/dianping/cat/system/page/alarm/RuleManager.java
浏览文件 @
8e3a7a28
...
...
@@ -36,10 +36,6 @@ public class RuleManager {
@Inject
private
DpAdminLoginDao
m_dpAdminLoginDao
;
private
final
static
String
DEFAULT_EMAIL_ADDRESS
=
"yong.you@dianping.com"
;
private
final
static
String
DEFAULT_PHONE_ADDRESS
=
"18616671676"
;
public
void
queryExceptionRuleList
(
Model
model
,
int
userId
)
{
List
<
UserAlarmSubState
>
userRules
=
new
ArrayList
<
UserAlarmSubState
>();
try
{
...
...
@@ -127,8 +123,6 @@ public class RuleManager {
Cat
.
logError
(
e
);
}
mails
.
clear
();
mails
.
add
(
DEFAULT_EMAIL_ADDRESS
);
return
mails
;
}
...
...
@@ -143,8 +137,7 @@ public class RuleManager {
try
{
DpAdminLogin
entity
=
m_dpAdminLoginDao
.
findByPK
(
userId
,
DpAdminLoginEntity
.
READSET_FULL
);
// TODO
phones
.
add
(
entity
.
getEmail
());
phones
.
add
(
entity
.
getMobileNo
());
}
catch
(
Exception
e
)
{
}
}
...
...
@@ -153,8 +146,6 @@ public class RuleManager {
Cat
.
logError
(
e
);
}
phones
.
clear
();
phones
.
add
(
DEFAULT_PHONE_ADDRESS
);
return
phones
;
}
...
...
cat-home/src/main/java/com/dianping/cat/system/page/alarm/ScheduledManager.java
浏览文件 @
8e3a7a28
...
...
@@ -23,49 +23,47 @@ public class ScheduledManager {
@Inject
private
ScheduledReportDao
m_scheduledReportDao
;
@Inject
private
ScheduledReportSubscriptionDao
m_scheduledReportSubscriptionDao
;
@Inject
private
DpAdminLoginDao
m_loginDao
;
public
List
<
ScheduledReport
>
queryScheduledReports
()
throws
DalException
{
public
List
<
ScheduledReport
>
queryScheduledReports
()
throws
DalException
{
List
<
ScheduledReport
>
reports
=
m_scheduledReportDao
.
findAll
(
ScheduledReportEntity
.
READSET_FULL
);
return
reports
;
}
public
List
<
String
>
queryEmailsBySchReportId
(
int
scheduledReportId
)
throws
DalException
{
List
<
String
>
emails
=
new
ArrayList
<
String
>();
List
<
ScheduledReportSubscription
>
subscriptions
=
m_scheduledReportSubscriptionDao
.
findByScheduledReportId
(
scheduledReportId
,
ScheduledReportSubscriptionEntity
.
READSET_FULL
);
List
<
ScheduledReportSubscription
>
subscriptions
=
m_scheduledReportSubscriptionDao
.
findByScheduledReportId
(
scheduledReportId
,
ScheduledReportSubscriptionEntity
.
READSET_FULL
);
for
(
ScheduledReportSubscription
subscription
:
subscriptions
)
{
try
{
DpAdminLogin
login
=
m_loginDao
.
findByPK
(
subscription
.
getUserId
(),
DpAdminLoginEntity
.
READSET_FULL
);
emails
.
add
(
login
.
getEmail
());
}
catch
(
Exception
e
)
{
}
}
if
(
emails
.
size
()
==
0
)
{
emails
.
add
(
"yong.you@dianping.com"
);
DpAdminLogin
login
=
m_loginDao
.
findByPK
(
subscription
.
getUserId
(),
DpAdminLoginEntity
.
READSET_FULL
);
emails
.
add
(
login
.
getEmail
());
}
catch
(
Exception
e
)
{
}
}
return
emails
;
}
public
void
queryScheduledReports
(
Model
model
,
int
userId
)
{
public
void
queryScheduledReports
(
Model
model
,
int
userId
)
{
List
<
UserReportSubState
>
userRules
=
new
ArrayList
<
UserReportSubState
>();
try
{
List
<
ScheduledReport
>
lists
=
m_scheduledReportDao
.
findAll
(
ScheduledReportEntity
.
READSET_FULL
);
for
(
ScheduledReport
report
:
lists
)
{
int
scheduledReportId
=
report
.
getId
();
UserReportSubState
userSubState
=
new
UserReportSubState
(
report
);
userRules
.
add
(
userSubState
);
try
{
m_scheduledReportSubscriptionDao
.
findByPK
(
scheduledReportId
,
userId
,
ScheduledReportSubscriptionEntity
.
READSET_FULL
);
m_scheduledReportSubscriptionDao
.
findByPK
(
scheduledReportId
,
userId
,
ScheduledReportSubscriptionEntity
.
READSET_FULL
);
userSubState
.
setSubscriberState
(
1
);
}
catch
(
DalNotFoundException
nfe
)
{
}
catch
(
DalException
e
)
{
...
...
@@ -76,11 +74,10 @@ public class ScheduledManager {
}
catch
(
DalException
e
)
{
Cat
.
logError
(
e
);
}
Collections
.
sort
(
userRules
,
new
UserReportSubStateCompartor
());
Collections
.
sort
(
userRules
,
new
UserReportSubStateCompartor
());
model
.
setUserReportSubStates
(
userRules
);
}
public
void
scheduledReportAdd
(
Payload
payload
,
Model
model
)
{
List
<
String
>
domains
=
new
ArrayList
<
String
>();
...
...
@@ -90,7 +87,7 @@ public class ScheduledManager {
public
void
scheduledReportAddSubmit
(
Payload
payload
,
Model
model
)
{
String
domain
=
payload
.
getDomain
();
String
content
=
payload
.
getContent
();
ScheduledReport
entity
=
m_scheduledReportDao
.
createLocal
();
entity
.
setNames
(
content
);
entity
.
setDomain
(
domain
);
...
...
@@ -115,8 +112,8 @@ public class ScheduledManager {
Cat
.
logError
(
e
);
}
}
public
void
scheduledReportSub
(
Payload
payload
,
int
loginId
)
{
public
void
scheduledReportSub
(
Payload
payload
,
int
loginId
)
{
int
subState
=
payload
.
getUserSubState
();
int
scheduledReportId
=
payload
.
getScheduledReportId
();
...
...
@@ -148,6 +145,7 @@ public class ScheduledManager {
Cat
.
logError
(
e
);
}
}
public
void
scheduledReportUpdateSubmit
(
Payload
payload
,
Model
model
)
{
int
id
=
payload
.
getScheduledReportId
();
String
content
=
payload
.
getContent
();
...
...
cat-home/src/main/java/com/dianping/cat/system/tool/MailSMSImpl.java
浏览文件 @
8e3a7a28
package
com.dianping.cat.system.tool
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
org.codehaus.plexus.logging.LogEnabled
;
import
org.codehaus.plexus.logging.Logger
;
import
org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable
;
import
org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException
;
import
org.springframework.beans.BeansException
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.support.ClassPathXmlApplicationContext
;
public
class
MailSMSImpl
implements
MailSMS
{
import
com.dianping.cat.Cat
;
import
com.dianping.cat.configuration.ServerConfigManager
;
import
com.dianping.mailremote.remote.MailService
;
import
com.dianping.sms.biz.SMSService
;
import
com.dianping.sms.biz.SMSType
;
import
com.site.lookup.annotation.Inject
;
public
class
MailSMSImpl
implements
MailSMS
,
Initializable
,
LogEnabled
{
private
final
static
int
DEFAULT_EMAIL_TYPE
=
15
;
private
final
SMSType
DEFAULT_MESSAGE_TYPE
=
SMSType
.
MONITOR
;
private
Logger
m_logger
;
private
MailService
m_mailService
;
@Inject
private
ServerConfigManager
m_serverConfig
;
private
SMSService
m_smsService
;
@Override
public
void
enableLogging
(
Logger
logger
)
{
m_logger
=
logger
;
}
@Override
public
void
initialize
()
throws
InitializationException
{
if
(
m_serverConfig
.
isJobMachine
())
{
try
{
ApplicationContext
ctx
=
new
ClassPathXmlApplicationContext
(
"spring/remoteService.xml"
);
m_mailService
=
(
MailService
)
ctx
.
getBean
(
"mailService"
);
m_smsService
=
(
SMSService
)
ctx
.
getBean
(
"smsService"
);
}
catch
(
BeansException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
}
@Override
public
boolean
sendEmail
(
String
title
,
String
content
,
List
<
String
>
emails
)
{
return
false
;
boolean
sendResult
=
false
;
if
(
m_serverConfig
.
isJobMachine
())
{
if
(
emails
.
size
()
>
0
)
{
for
(
String
mail
:
emails
)
{
try
{
m_mailService
.
send
(
DEFAULT_EMAIL_TYPE
,
mail
,
title
,
content
);
sendResult
=
true
;
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
}
}
else
{
m_logger
.
info
(
"CAT email has no recevers ! "
+
title
);
}
}
return
sendResult
;
}
@Override
public
boolean
sendSMS
(
String
content
,
List
<
String
>
phones
)
{
return
false
;
boolean
sendResult
=
false
;
if
(
m_serverConfig
.
isJobMachine
())
{
if
(
phones
!=
null
&&
phones
.
size
()
>
0
)
{
for
(
String
phone
:
phones
)
{
try
{
Map
<
String
,
String
>
pair
=
new
HashMap
<
String
,
String
>();
pair
.
put
(
"content"
,
content
);
m_smsService
.
send
(
DEFAULT_MESSAGE_TYPE
,
phone
,
pair
);
sendResult
=
true
;
}
catch
(
Exception
e
)
{
Cat
.
logError
(
e
);
}
}
}
else
{
m_logger
.
info
(
"CAT sms has no recevers ! "
+
content
);
}
}
return
sendResult
;
}
}
cat-home/src/main/resources/META-INF/dal/jdbc/user-codegen.xml
浏览文件 @
8e3a7a28
...
...
@@ -7,6 +7,7 @@
<member
name=
"password"
field=
"Password"
value-type=
"String"
length=
"96"
/>
<member
name=
"email"
field=
"Email"
value-type=
"String"
length=
"120"
/>
<member
name=
"real-name"
field=
"RealName"
value-type=
"String"
length=
"48"
/>
<member
name=
"mobile-no"
field=
"MobileNo"
value-type=
"String"
length=
"12"
/>
<primary-key
/>
<readsets>
<readset
name=
"FULL"
all=
"true"
/>
...
...
cat-home/src/main/resources/META-INF/plexus/components.xml
浏览文件 @
8e3a7a28
...
...
@@ -2526,6 +2526,11 @@
<component>
<role>
com.dianping.cat.system.tool.MailSMS
</role>
<implementation>
com.dianping.cat.system.tool.MailSMSImpl
</implementation>
<requirements>
<requirement>
<role>
com.dianping.cat.configuration.ServerConfigManager
</role>
</requirement>
</requirements>
</component>
<component>
<role>
com.dianping.cat.system.notify.ReportRender
</role>
...
...
@@ -2576,6 +2581,12 @@
<requirement>
<role>
com.dianping.cat.home.dal.alarm.MailRecordDao
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.system.tool.MailSMS
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.configuration.ServerConfigManager
</role>
</requirement>
</requirements>
</component>
<component>
...
...
cat-home/src/main/resources/freemaker/exceptionAlarm.ftl
浏览文件 @
8e3a7a28
...
...
@@ -14,6 +14,18 @@
<td>${date?string("yyyy-MM-dd HH:mm:ss")}</td>
<td></td>
</tr>
<tr>
<td></td>
<td>告警规则</td>
<td>${rule}</td>
<td></td>
</tr>
<tr>
<td></td>
<td>错误个数</td>
<td>${count}</td>
<td></td>
</tr>
<tr>
<td></td>
<td>CAT链接</td>
...
...
cat-home/src/main/resources/freemaker/serviceAlarm.ftl
浏览文件 @
8e3a7a28
...
...
@@ -14,6 +14,18 @@
<td>${date?string("yyyy-MM-dd HH:mm:ss")}</td>
<td></td>
</tr>
<tr>
<td></td>
<td>告警规则</td>
<td>${rule}</td>
<td></td>
</tr>
<tr>
<td></td>
<td>错误个数</td>
<td>${count}</td>
<td></td>
</tr>
<tr>
<td></td>
<td>CAT链接</td>
...
...
cat-home/src/main/resources/spring/applicationContext.properties
0 → 100644
浏览文件 @
8e3a7a28
cat-home/src/main/resources/spring/remoteService.xml
0 → 100644
浏览文件 @
8e3a7a28
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans
default-autowire=
"byName"
default-lazy-init=
"false"
>
<bean
name=
"placeholder"
lazy-init=
"false"
class=
"com.dianping.lion.client.SpringConfig"
>
<property
name=
"propertiesPath"
value=
"spring/applicationContext.properties"
/>
</bean>
<bean
id=
"mailService"
class=
"com.dianping.dpsf.spring.ProxyBeanFactory"
init-method=
"init"
>
<property
name=
"serviceName"
value=
"http://service.dianping.com/mailService/mailService_1.0.0"
/>
<property
name=
"iface"
value=
"com.dianping.mailremote.remote.MailService"
/>
<property
name=
"serialize"
value=
"java"
/>
<property
name=
"callMethod"
value=
"oneway"
/>
<property
name=
"timeout"
value=
"5000"
/>
</bean>
<bean
id=
"smsService"
class=
"com.dianping.dpsf.spring.ProxyBeanFactory"
init-method=
"init"
>
<property
name=
"serviceName"
value=
"http://service.dianping.com/smsService/smsRemoteService_1.0.0"
/>
<property
name=
"iface"
value=
"com.dianping.sms.biz.SMSService"
/>
<property
name=
"serialize"
value=
"java"
/>
<property
name=
"callMethod"
value=
"oneway"
/>
<property
name=
"timeout"
value=
"5000"
/>
</bean>
</beans>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录