Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
21679ed3
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,发现更多精彩内容 >>
提交
21679ed3
编写于
1月 13, 2012
作者:
F
Frankie Wu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add logview page
上级
883de335
变更
14
显示空白变更内容
内联
并排
Showing
14 changed file
with
229 addition
and
17 deletion
+229
-17
cat-core/src/main/java/com/dianping/cat/message/spi/internal/DefaultMessageStorage.java
...nping/cat/message/spi/internal/DefaultMessageStorage.java
+18
-15
cat-home/src/main/java/com/dianping/cat/report/ReportModule.java
...e/src/main/java/com/dianping/cat/report/ReportModule.java
+3
-1
cat-home/src/main/java/com/dianping/cat/report/ReportPage.java
...ome/src/main/java/com/dianping/cat/report/ReportPage.java
+2
-0
cat-home/src/main/java/com/dianping/cat/report/page/logview/Action.java
...ain/java/com/dianping/cat/report/page/logview/Action.java
+26
-0
cat-home/src/main/java/com/dianping/cat/report/page/logview/Context.java
...in/java/com/dianping/cat/report/page/logview/Context.java
+7
-0
cat-home/src/main/java/com/dianping/cat/report/page/logview/Handler.java
...in/java/com/dianping/cat/report/page/logview/Handler.java
+41
-0
cat-home/src/main/java/com/dianping/cat/report/page/logview/JspFile.java
...in/java/com/dianping/cat/report/page/logview/JspFile.java
+17
-0
cat-home/src/main/java/com/dianping/cat/report/page/logview/JspViewer.java
.../java/com/dianping/cat/report/page/logview/JspViewer.java
+18
-0
cat-home/src/main/java/com/dianping/cat/report/page/logview/Model.java
...main/java/com/dianping/cat/report/page/logview/Model.java
+15
-0
cat-home/src/main/java/com/dianping/cat/report/page/logview/Payload.java
...in/java/com/dianping/cat/report/page/logview/Payload.java
+59
-0
cat-home/src/main/java/com/dianping/garden/view/NavigationBar.java
...src/main/java/com/dianping/garden/view/NavigationBar.java
+3
-1
cat-home/src/main/resources/META-INF/plexus/components.xml
cat-home/src/main/resources/META-INF/plexus/components.xml
+13
-0
cat-home/src/main/resources/META-INF/wizard/webapp/wizard.xml
...home/src/main/resources/META-INF/wizard/webapp/wizard.xml
+1
-0
cat-home/src/main/webapp/jsp/report/logview.jsp
cat-home/src/main/webapp/jsp/report/logview.jsp
+6
-0
未找到文件。
cat-core/src/main/java/com/dianping/cat/message/spi/internal/DefaultMessageStorage.java
浏览文件 @
21679ed3
...
...
@@ -44,6 +44,8 @@ public class DefaultMessageStorage implements MessageStorage, LogEnabled {
public
String
store
(
MessageTree
tree
)
{
String
path
=
m_builder
.
getLogViewPath
(
tree
);
File
file
=
new
File
(
m_builder
.
getLogViewBaseDir
(),
path
);
if
(!
file
.
exists
())
{
ChannelBuffer
buf
=
ChannelBuffers
.
dynamicBuffer
(
8192
);
FileOutputStream
fos
=
null
;
...
...
@@ -64,6 +66,7 @@ public class DefaultMessageStorage implements MessageStorage, LogEnabled {
}
}
}
}
return
path
;
}
...
...
cat-home/src/main/java/com/dianping/cat/report/ReportModule.java
浏览文件 @
21679ed3
...
...
@@ -11,7 +11,9 @@ com.dianping.cat.report.page.home.Handler.class,
com
.
dianping
.
cat
.
report
.
page
.
transaction
.
Handler
.
class
,
com
.
dianping
.
cat
.
report
.
page
.
failure
.
Handler
.
class
com
.
dianping
.
cat
.
report
.
page
.
failure
.
Handler
.
class
,
com
.
dianping
.
cat
.
report
.
page
.
logview
.
Handler
.
class
,
})
public
class
ReportModule
extends
AbstractModule
{
...
...
cat-home/src/main/java/com/dianping/cat/report/ReportPage.java
浏览文件 @
21679ed3
...
...
@@ -11,6 +11,8 @@ public enum ReportPage implements Page {
FAILURE
(
"f"
,
"Failure"
,
true
),
LOGVIEW
(
"m"
,
"Logview"
,
true
),
;
private
String
m_name
;
...
...
cat-home/src/main/java/com/dianping/cat/report/page/logview/Action.java
0 → 100644
浏览文件 @
21679ed3
package
com.dianping.cat.report.page.logview
;
public
enum
Action
implements
com
.
site
.
web
.
mvc
.
Action
{
VIEW
(
"view"
);
private
String
m_name
;
private
Action
(
String
name
)
{
m_name
=
name
;
}
public
static
Action
getByName
(
String
name
,
Action
defaultAction
)
{
for
(
Action
action
:
Action
.
values
())
{
if
(
action
.
getName
().
equals
(
name
))
{
return
action
;
}
}
return
defaultAction
;
}
@Override
public
String
getName
()
{
return
m_name
;
}
}
cat-home/src/main/java/com/dianping/cat/report/page/logview/Context.java
0 → 100644
浏览文件 @
21679ed3
package
com.dianping.cat.report.page.logview
;
import
com.dianping.cat.report.ReportContext
;
public
class
Context
extends
ReportContext
<
Payload
>
{
}
cat-home/src/main/java/com/dianping/cat/report/page/logview/Handler.java
0 → 100644
浏览文件 @
21679ed3
package
com.dianping.cat.report.page.logview
;
import
java.io.IOException
;
import
java.util.Arrays
;
import
javax.servlet.ServletException
;
import
com.dianping.cat.report.ReportPage
;
import
com.site.lookup.annotation.Inject
;
import
com.site.web.mvc.PageHandler
;
import
com.site.web.mvc.annotation.InboundActionMeta
;
import
com.site.web.mvc.annotation.OutboundActionMeta
;
import
com.site.web.mvc.annotation.PayloadMeta
;
public
class
Handler
implements
PageHandler
<
Context
>
{
@Inject
private
JspViewer
m_jspViewer
;
@Override
@PayloadMeta
(
Payload
.
class
)
@InboundActionMeta
(
name
=
"m"
)
public
void
handleInbound
(
Context
ctx
)
throws
ServletException
,
IOException
{
// display only, no action here
}
@Override
@OutboundActionMeta
(
name
=
"m"
)
public
void
handleOutbound
(
Context
ctx
)
throws
ServletException
,
IOException
{
Model
model
=
new
Model
(
ctx
);
model
.
setAction
(
Action
.
VIEW
);
model
.
setPage
(
ReportPage
.
LOGVIEW
);
Payload
payload
=
ctx
.
getPayload
();
System
.
out
.
println
(
payload
.
getIdentifier
());
System
.
out
.
println
(
Arrays
.
asList
(
payload
.
getPath
()));
m_jspViewer
.
view
(
ctx
,
model
);
}
}
cat-home/src/main/java/com/dianping/cat/report/page/logview/JspFile.java
0 → 100644
浏览文件 @
21679ed3
package
com.dianping.cat.report.page.logview
;
public
enum
JspFile
{
VIEW
(
"/jsp/report/logview.jsp"
),
;
private
String
m_path
;
private
JspFile
(
String
path
)
{
m_path
=
path
;
}
public
String
getPath
()
{
return
m_path
;
}
}
cat-home/src/main/java/com/dianping/cat/report/page/logview/JspViewer.java
0 → 100644
浏览文件 @
21679ed3
package
com.dianping.cat.report.page.logview
;
import
com.dianping.cat.report.ReportPage
;
import
com.site.web.mvc.view.BaseJspViewer
;
public
class
JspViewer
extends
BaseJspViewer
<
ReportPage
,
Action
,
Context
,
Model
>
{
@Override
protected
String
getJspFilePath
(
Context
ctx
,
Model
model
)
{
Action
action
=
model
.
getAction
();
switch
(
action
)
{
case
VIEW:
return
JspFile
.
VIEW
.
getPath
();
}
throw
new
RuntimeException
(
"Unknown action: "
+
action
);
}
}
cat-home/src/main/java/com/dianping/cat/report/page/logview/Model.java
0 → 100644
浏览文件 @
21679ed3
package
com.dianping.cat.report.page.logview
;
import
com.dianping.cat.report.ReportPage
;
import
com.site.web.mvc.ViewModel
;
public
class
Model
extends
ViewModel
<
ReportPage
,
Action
,
Context
>
{
public
Model
(
Context
ctx
)
{
super
(
ctx
);
}
@Override
public
Action
getDefaultAction
()
{
return
Action
.
VIEW
;
}
}
cat-home/src/main/java/com/dianping/cat/report/page/logview/Payload.java
0 → 100644
浏览文件 @
21679ed3
package
com.dianping.cat.report.page.logview
;
import
com.dianping.cat.report.ReportPage
;
import
com.site.web.mvc.ActionContext
;
import
com.site.web.mvc.ActionPayload
;
import
com.site.web.mvc.payload.annotation.FieldMeta
;
import
com.site.web.mvc.payload.annotation.PathMeta
;
public
class
Payload
implements
ActionPayload
<
ReportPage
,
Action
>
{
private
ReportPage
m_page
;
@FieldMeta
(
"op"
)
private
Action
m_action
;
@FieldMeta
(
"id"
)
private
int
m_identifier
;
@PathMeta
(
"path"
)
private
String
[]
m_path
;
public
void
setAction
(
Action
action
)
{
m_action
=
action
;
}
public
int
getIdentifier
()
{
return
m_identifier
;
}
public
void
setIdentifier
(
int
identifier
)
{
m_identifier
=
identifier
;
}
@Override
public
Action
getAction
()
{
return
m_action
;
}
public
String
[]
getPath
()
{
return
m_path
;
}
public
void
setPath
(
String
[]
path
)
{
m_path
=
path
;
}
@Override
public
ReportPage
getPage
()
{
return
m_page
;
}
@Override
public
void
setPage
(
String
page
)
{
m_page
=
ReportPage
.
getByName
(
page
,
ReportPage
.
LOGVIEW
);
}
@Override
public
void
validate
(
ActionContext
<?>
ctx
)
{
}
}
cat-home/src/main/java/com/dianping/garden/view/NavigationBar.java
浏览文件 @
21679ed3
...
...
@@ -11,7 +11,9 @@ public class NavigationBar {
ReportPage
.
FAILURE
,
ReportPage
.
TRANSACTION
ReportPage
.
TRANSACTION
,
ReportPage
.
LOGVIEW
};
}
...
...
cat-home/src/main/resources/META-INF/plexus/components.xml
浏览文件 @
21679ed3
...
...
@@ -99,5 +99,18 @@
<role>
com.dianping.cat.report.page.failure.JspViewer
</role>
<implementation>
com.dianping.cat.report.page.failure.JspViewer
</implementation>
</component>
<component>
<role>
com.dianping.cat.report.page.logview.Handler
</role>
<implementation>
com.dianping.cat.report.page.logview.Handler
</implementation>
<requirements>
<requirement>
<role>
com.dianping.cat.report.page.logview.JspViewer
</role>
</requirement>
</requirements>
</component>
<component>
<role>
com.dianping.cat.report.page.logview.JspViewer
</role>
<implementation>
com.dianping.cat.report.page.logview.JspViewer
</implementation>
</component>
</components>
</plexus>
cat-home/src/main/resources/META-INF/wizard/webapp/wizard.xml
浏览文件 @
21679ed3
...
...
@@ -4,6 +4,7 @@
<page
name=
"home"
description=
"Home"
default=
"true"
/>
<page
name=
"transaction"
description=
"Transaction"
/>
<page
name=
"failure"
description=
"Failure"
/>
<page
name=
"logview"
description=
"Logview"
/>
</module>
</wizard>
cat-home/src/main/webapp/jsp/report/logview.jsp
0 → 100644
浏览文件 @
21679ed3
<%@ page
contentType=
"text/html; charset=utf-8"
%>
<jsp:useBean
id=
"ctx"
type=
"com.dianping.cat.report.page.logview.Context"
scope=
"request"
/>
<jsp:useBean
id=
"payload"
type=
"com.dianping.cat.report.page.logview.Payload"
scope=
"request"
/>
<jsp:useBean
id=
"model"
type=
"com.dianping.cat.report.page.logview.Model"
scope=
"request"
/>
View of logview page under report
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录