KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > catalina > storeconfig > PersistentManagerSF


1 /*
2  * Copyright 1999-2001,2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.apache.catalina.storeconfig;
18
19 import java.io.PrintWriter JavaDoc;
20
21 import org.apache.catalina.Store;
22 import org.apache.catalina.session.PersistentManager;
23 import org.apache.commons.logging.Log;
24 import org.apache.commons.logging.LogFactory;
25
26 /**
27  * store server.xml PersistentManager element with nested "Store"
28  *
29  * @author Peter Rossbach
30  */

31 public class PersistentManagerSF extends StoreFactoryBase {
32
33     private static Log log = LogFactory.getLog(PersistentManagerSF.class);
34
35     /**
36      * Store the specified PersistentManager properties.
37      *
38      * @param aWriter
39      * PrintWriter to which we are storing
40      * @param indent
41      * Number of spaces to indent this element
42      * @param aManager
43      * PersistentManager whose properties are being stored
44      *
45      * @exception Exception
46      * if an exception occurs while storing
47      */

48     public void storeChilds(PrintWriter JavaDoc aWriter, int indent, Object JavaDoc aManager,
49             StoreDescription parentDesc) throws Exception JavaDoc {
50         if (aManager instanceof PersistentManager) {
51             PersistentManager manager = (PersistentManager) aManager;
52
53             // Store nested <Manager> elements
54
Store store = manager.getStore();
55             storeElement(aWriter, indent, store);
56
57         }
58     }
59
60 }
Popular Tags