1 9 package org.jboss.portal.cms; 10 11 import org.apache.slide.common.NamespaceAccessToken; 12 13 import javax.transaction.TransactionManager ; 14 15 19 public class NodeFactory 20 { 21 22 23 private NamespaceAccessToken nat; 24 25 NodeFactory(NamespaceAccessToken nat) 26 { 27 this.nat = nat; 28 } 29 30 void close() 31 { 32 nat = null; 33 } 34 35 38 public Node getNode(NamespaceAccessToken nat, String uri) throws NodeException 39 { 40 return new Node(nat, uri, null, "root"); 41 } 42 43 46 public TransactionManager getTransactionManager() throws IllegalStateException 47 { 48 NamespaceAccessToken nat = this.nat; 49 if (nat == null) 50 { 51 throw new IllegalStateException ("Factory closed"); 52 } 53 return nat.getTransactionManager(); 54 } 55 56 60 public Node getNode(String uri) throws NodeException, IllegalStateException 61 { 62 NamespaceAccessToken nat = this.nat; 63 if (nat == null) 64 { 65 throw new IllegalStateException ("Factory closed"); 66 } 67 return new Node(nat, uri, null, "root"); 68 } 69 70 } 71 | Popular Tags |