01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: *
17: */
18: package org.apache.lenya.cms.repository;
19:
20: import org.apache.avalon.framework.logger.AbstractLogEnabled;
21: import org.apache.avalon.framework.service.ServiceException;
22: import org.apache.avalon.framework.service.ServiceManager;
23: import org.apache.avalon.framework.service.Serviceable;
24: import org.apache.avalon.framework.thread.ThreadSafe;
25:
26: /**
27: * Factory to create source nodes.
28: *
29: * @version $Id: SourceNodeFactory.java 567725 2007-08-20 15:10:20Z andreas $
30: */
31: public class SourceNodeFactory extends AbstractLogEnabled implements
32: NodeFactory, Serviceable, ThreadSafe {
33:
34: private ServiceManager manager;
35:
36: /**
37: * Ctor.
38: */
39: public SourceNodeFactory() {
40: }
41:
42: public RepositoryItem buildItem(Session session, String key)
43: throws RepositoryException {
44: Node node = new SourceNode(session, key, this .manager,
45: getLogger());
46: return node;
47: }
48:
49: public String getItemType() {
50: return Node.IDENTIFIABLE_TYPE;
51: }
52:
53: /**
54: * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
55: */
56: public void service(ServiceManager manager) throws ServiceException {
57: this.manager = manager;
58: }
59:
60: }
|