1 28 29 package org.apache.commons.transaction.file; 30 31 import java.io.InputStream ; 32 import java.io.OutputStream ; 33 34 import javax.transaction.Status ; 35 36 56 public interface ResourceManager extends Status { 57 58 61 public final static int ISOLATION_LEVEL_READ_UNCOMMITTED = 0; 62 63 66 public final static int ISOLATION_LEVEL_READ_COMMITTED = 10; 67 68 71 public final static int ISOLATION_LEVEL_REPEATABLE_READ = 50; 72 73 76 public final static int ISOLATION_LEVEL_SERIALIZABLE = 100; 77 78 81 public final static int SHUTDOWN_MODE_NORMAL = 0; 82 83 86 public final static int SHUTDOWN_MODE_ROLLBACK = 1; 87 88 91 public final static int SHUTDOWN_MODE_KILL = 2; 92 93 96 public final static int PREPARE_SUCCESS = 1; 97 98 101 public final static int PREPARE_SUCCESS_READONLY = 2; 102 103 106 public final static int PREPARE_FAILURE = -1; 107 108 114 public void start() throws ResourceManagerSystemException; 115 116 124 public boolean stop(int mode, long timeoutMSecs) throws ResourceManagerSystemException; 125 126 134 public boolean stop(int mode) throws ResourceManagerSystemException; 135 136 146 public boolean recover() throws ResourceManagerSystemException; 147 148 157 public int getDefaultIsolationLevel() throws ResourceManagerException; 158 159 169 public int[] getSupportedIsolationLevels() throws ResourceManagerException; 170 171 179 public boolean isIsolationLevelSupported(int level) throws ResourceManagerException; 180 181 191 public int getIsolationLevel(Object txId) throws ResourceManagerException; 192 193 206 public void setIsolationLevel(Object txId, int level) throws ResourceManagerException; 207 208 216 public long getDefaultTransactionTimeout() throws ResourceManagerException; 217 218 226 public long getTransactionTimeout(Object txId) throws ResourceManagerException; 227 228 236 public void setTransactionTimeout(Object txId, long mSecs) throws ResourceManagerException; 237 238 247 public void startTransaction(Object txId) throws ResourceManagerException; 248 249 264 public int prepareTransaction(Object txId) throws ResourceManagerException; 265 266 274 public void markTransactionForRollback(Object txId) throws ResourceManagerException; 275 276 284 public void rollbackTransaction(Object txId) throws ResourceManagerException; 285 286 294 public void commitTransaction(Object txId) throws ResourceManagerException; 295 296 305 public int getTransactionState(Object txId) throws ResourceManagerException; 306 307 326 public boolean lockResource( 327 Object resourceId, 328 Object txId, 329 boolean shared, 330 boolean wait, 331 long timeoutMSecs, 332 boolean reentrant) 333 throws ResourceManagerException; 334 335 345 public boolean lockResource(Object resourceId, Object txId, boolean shared) throws ResourceManagerException; 346 347 357 public boolean lockResource(Object resourceId, Object txId) throws ResourceManagerException; 358 359 367 public boolean resourceExists(Object txId, Object resourceId) throws ResourceManagerException; 368 369 377 public boolean resourceExists(Object resourceId) throws ResourceManagerException; 378 379 386 public void deleteResource(Object txId, Object resourceId) throws ResourceManagerException; 387 388 396 public void deleteResource(Object txId, Object resourceId, boolean assureOnly) throws ResourceManagerException; 397 398 405 public void createResource(Object txId, Object resourceId) throws ResourceManagerException; 406 407 415 public void createResource(Object txId, Object resourceId, boolean assureOnly) throws ResourceManagerException; 416 417 428 public InputStream readResource(Object txId, Object resourceId) throws ResourceManagerException; 429 430 440 public InputStream readResource(Object resourceId) throws ResourceManagerException; 441 442 453 public OutputStream writeResource(Object txId, Object resourceId) throws ResourceManagerException; 454 } 455 | Popular Tags |