1 5 package org.ozoneDB; 6 7 import org.ozoneDB.tools.OPP.OPP; 8 9 43 44 public final class OzoneObjectFactory extends AbstractFactory { 45 46 private static class Info implements org.ozoneDB.FactoryClassInfo { 47 public final void defaultDatabaseUrlChanged() { 48 defaultInstance = null; 49 } 50 } 51 52 static { 53 addFactoryClassInfo(new Info()); 54 } 55 56 private static OzoneObjectFactory defaultInstance = null; 57 58 65 public static synchronized OzoneObjectFactory getDefault() throws Exception { 66 if (defaultInstance == null) { 67 defaultInstance = new OzoneObjectFactory(); 68 } 69 return defaultInstance; 70 } 71 72 76 public OzoneObjectFactory() throws Exception { 77 } 78 79 90 public OzoneObjectFactory(String url) throws Exception { 91 super(url); 92 } 93 94 99 public OzoneObjectFactory(AbstractFactory factory) { 100 super(factory); 101 } 102 103 107 protected void defaultClosed() { 108 defaultInstance = null; 109 } 110 111 117 public OzoneRemote objectForHandle(String handle) throws Exception { 118 return (OzoneRemote) getDatabase().objectForHandle(handle); 119 } 120 121 124 public OzoneRemote objectForName(String name) throws Exception { 125 return (OzoneRemote) getDatabase().objectForName(name); 126 } 127 128 } 129 | Popular Tags |