📄 org_apache_catalina_startup_contextruleset--rosonsandy.htm
字号:
<P> digester.addObjectCreate(prefix +
"Context/Manager/Store",<BR>
null, // MUST be specified in the
element<BR>
"className");<BR>
digester.addSetProperties(prefix +
"Context/Manager/Store");<BR>
digester.addSetNext(prefix +
"Context/Manager/Store",<BR>
"setStore",<BR>
"org.apache.catalina.Store");</P>
<P> digester.addObjectCreate(prefix +
"Context/Parameter",<BR>
"org.apache.catalina.deploy.ApplicationParameter");<BR>
digester.addSetProperties(prefix +
"Context/Parameter");<BR>
digester.addSetNext(prefix +
"Context/Parameter",<BR>
"addApplicationParameter",<BR>
"org.apache.catalina.deploy.ApplicationParameter");</P>
<P> digester.addObjectCreate(prefix +
"Context/Realm",<BR>
null, // MUST be specified in the
element<BR>
"className");<BR>
digester.addSetProperties(prefix +
"Context/Realm");<BR>
digester.addSetNext(prefix +
"Context/Realm",<BR>
"setRealm",<BR>
"org.apache.catalina.Realm");</P>
<P> digester.addObjectCreate(prefix +
"Context/ResourceLink",<BR>
"org.apache.catalina.deploy.ContextResourceLink");<BR>
digester.addSetProperties(prefix +
"Context/ResourceLink");<BR>
digester.addSetNext(prefix +
"Context/ResourceLink",<BR>
"addResourceLink",<BR>
"org.apache.catalina.deploy.ContextResourceLink");</P>
<P> digester.addObjectCreate(prefix +
"Context/Resources",<BR>
"org.apache.naming.resources.FileDirContext",<BR>
"className");<BR>
digester.addSetProperties(prefix +
"Context/Resources");<BR>
digester.addSetNext(prefix +
"Context/Resources",<BR>
"setResources",<BR>
"javax.naming.directory.DirContext");</P>
<P> digester.addObjectCreate(prefix +
"Context/Valve",<BR>
null, // MUST be specified in the
element<BR>
"className");<BR>
digester.addSetProperties(prefix +
"Context/Valve");<BR>
digester.addSetNext(prefix +
"Context/Valve",<BR>
"addValve",<BR>
"org.apache.catalina.Valve");</P>
<P> digester.addCallMethod(prefix +
"Context/WrapperLifecycle",<BR>
"addWrapperLifecycle", 0);</P>
<P> digester.addCallMethod(prefix +
"Context/WrapperListener",<BR>
"addWrapperListener", 0);</P>
<P> }<BR>}</P>
<P><BR>// ----------------------------------------------------------- Private
Classes</P>
<P><BR>/**<BR> * Rule that creates a new <code>Loader</code>
instance, with the parent<BR> * class loader associated with the top object
on the stack (which must be<BR> * a <code>Container</code>),
and pushes it on to the stack.<BR> */</P>
<P>final class CreateLoaderRule extends Rule {</P>
<P> public CreateLoaderRule(Digester digester, String
loaderClass,<BR>
String attributeName) {</P>
<P>
super(digester);<BR> this.loaderClass
= loaderClass;<BR> this.attributeName
= attributeName;</P>
<P> }</P>
<P> private String attributeName;</P>
<P> private String loaderClass;</P>
<P> public void begin(Attributes attributes) throws Exception
{</P>
<P> // Look up the required parent
class loader<BR> ClassLoader
parentClassLoader = null;<BR> Object
ojb = digester.peek();<BR> if (ojb
instanceof Container)
{<BR>
parentClassLoader =
((Container)ojb).getParentClassLoader();<BR>
}</P>
<P> // Instantiate a new Loader
implementation object<BR> String
className = loaderClass;<BR> if
(attributeName != null)
{<BR> String
value =
attributes.getValue(attributeName);<BR>
if (value !=
null)<BR>
className = value;<BR>
}<BR> Class clazz =
Class.forName(className);<BR> Class
types[] = { ClassLoader.class };<BR>
Object args[] = { parentClassLoader
};<BR> Constructor constructor =
clazz.getDeclaredConstructor(types);<BR>
Loader loader = (Loader) constructor.newInstance(args);</P>
<P> // Push the new loader onto the
stack<BR>
digester.push(loader);<BR> if
(digester.getDebug() >=
1)<BR>
digester.log("new " + loader.getClass().getName());</P>
<P> }</P>
<P> public void end() throws Exception {</P>
<P> Loader loader = (Loader)
digester.pop();<BR> if
(digester.getDebug() >=
1)<BR>
digester.log("pop " + loader.getClass().getName());</P>
<P> }<BR>}<BR></P>
<P></P>
<P class=diaryFoot>- 作者: <A
onclick="window.open('http://publishblog.blogdriver.com/blog/postMessage.b?receiver=517836','发送短消息','width=520, height=455')"
href="javascript:void(0);">rosonsandy</A> 2005年08月8日, 星期一 16:01 </P></DIV>
<DIV class=operation><A name=trackback>
<H3>Trackback</H3></A>
<P class=trackback>你可以使用这个链接引用该篇日志
http://publishblog.blogdriver.com/blog/tb.b?diaryID=879859 </P></DIV>
<DIV class=operation><A name=comment>
<H3>回复</H3></A></DIV>
<DIV class=operation>
<TABLE class=comment cellSpacing=0 cellPadding=0 width=700 border=0>
<FORM id=replyForm method=post><INPUT type=hidden value=356891 name=blogID>
<INPUT type=hidden value=879859 name=diaryID> <INPUT type=hidden
value=rosonsandy name=blogDomino>
<SCRIPT>
if(getCookie('userID') == null){
document.write('<tr><td width="70">发布人:</td>');
document.write('<td width="150"> <input name="remark.authorNameFUI" type="text" size="20" class="inputStyle" maxlength="20"></td>');
document.write('<td width="70">邮箱:</td>');
document.write('<td width="435"> <input name="remark.authorEmail" type="text" size="20" class="inputStyle" maxlength="40"></td>');
document.write('</tr><tr><td>主 页:</td>');
document.write('<td colspan="3"> <input name="remark.authorURL" type="text" class="inputStyle" value="HTTP://" size="63" maxlength="40"></td></tr>');
}else{
document.write('<input type="hidden" name="remark.authorNameFUI" value="Blogdriver">');
}
</SCRIPT>
<TBODY>
<TR align=left>
<TD colSpan=4>评论内容:<BR><TEXTAREA class=textStyle id=remark name=remark.remarkFUI rows=8 cols=60> </TEXTAREA>
</TD></TR>
<TR align=left>
<TD colSpan=4> <INPUT onclick=reply() type=button value=提交>
<INPUT type=reset value=重置> </TD></TR></FORM></TBODY></TABLE></DIV></DIV>
<SCRIPT src="" type=text/javascript></SCRIPT>
<DIV id=footer><A href="http://www.blogdriver.com/jsp/reg/register.jsp"><IMG
class=logo
src="org_apache_catalina_startup_ContextRuleSet--rosonsandy.files/logo3.gif"
border=0></A><A href="http://www.blogdriver.com/">2003-2004 BLOGDRIVER.COM All
rights reserved</A></DIV></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -