1 26 27 package org.objectweb.openccm.pss.runtime.common.lib; 28 29 30 38 39 public abstract class ConnectorBase 40 extends org.omg.CORBA.LocalObject 41 implements org.objectweb.openccm.pss.runtime.common.api.Connector 42 { 43 49 52 protected String _implementation_id; 53 54 57 protected java.util.Map _storage_object_factories; 58 59 62 protected java.util.Map _storage_home_factories; 63 64 67 protected int _free_id; 68 69 75 80 public ConnectorBase(String id) 81 { 82 _implementation_id = id; 83 _storage_object_factories = new java.util.HashMap (); 84 _storage_home_factories = new java.util.HashMap (); 85 _free_id = 0; 86 } 87 88 94 100 106 111 public String implementation_id() 112 { 113 return _implementation_id; 114 } 115 116 119 public byte[] 120 get_pid(java.lang.Object obj) 121 { 122 return ((org.omg.CosPersistentState.StorageObject) obj).get_pid(); 123 } 124 125 128 public byte[] 129 get_short_pid(java.lang.Object obj) 130 { 131 return ((org.omg.CosPersistentState.StorageObject) obj).get_short_pid(); 132 } 133 134 137 public abstract org.omg.CosPersistentState.Session 138 create_basic_session(short access_mode, 139 org.omg.CosPersistentState.Parameter[] additional_parameters); 140 141 144 public abstract org.omg.CosPersistentState.TransactionalSession 145 create_transactional_session(short access_mode, 146 short default_isolation_level, 147 org.omg.CosPersistentState.EndOfAssociationCallback callback, 148 org.omg.CosPersistentState.Parameter[] additional_parameters); 149 150 153 public abstract org.omg.CosPersistentState.SessionPool 154 create_session_pool(short access_mode, 155 short tx_policy, 156 org.omg.CosPersistentState.Parameter[] additional_parameters); 157 158 161 public abstract org.omg.CosPersistentState.TransactionalSession 162 current_session(); 163 164 167 public abstract org.omg.CosPersistentState.TransactionalSession[] 168 sessions(org.omg.CosTransactions.Coordinator transaction); 169 170 173 public java.lang.Class 174 register_storage_object_factory(String storage_type_name, 175 java.lang.Class storage_object_factory) 176 { 177 java.lang.Class previous = null; 178 179 previous = (Class ) _storage_object_factories.get(storage_type_name); 180 if ( previous != null ) 181 _storage_object_factories.remove(storage_type_name); 182 183 _storage_object_factories.put(storage_type_name, storage_object_factory); 184 return previous; 185 } 186 187 190 public java.lang.Class 191 register_storage_home_factory(String storage_home_type_name, 192 java.lang.Class storage_home_factory) 193 { 194 java.lang.Class previous = null; 195 196 previous = (Class ) _storage_home_factories.get(storage_home_type_name); 197 if ( previous != null ) 198 _storage_home_factories.remove(storage_home_type_name); 199 200 _storage_home_factories.put(storage_home_type_name, storage_home_factory); 201 return previous; 202 } 203 204 207 public java.lang.Class 208 register_session_factory(java.lang.Class session_factory) 209 { 210 return null; 212 } 213 214 217 public java.lang.Class 218 register_session_pool_factory(java.lang.Class session_pool_factory) 219 { 220 return null; 222 } 223 224 230 233 public java.lang.Class 234 get_storage_object_factory(String storage_type_name) 235 { 236 return (Class ) _storage_object_factories.get(storage_type_name); 237 } 238 239 242 public java.lang.Class 243 get_storage_home_factory(String storage_home_type_name) 244 { 245 return (Class ) _storage_home_factories.get(storage_home_type_name); 246 } 247 248 251 public int 252 get_free_id() 253 { 254 return _free_id++; 255 } 256 } 257 | Popular Tags |