1 17 18 package org.apache.geronimo.transaction; 19 20 import java.util.HashMap ; 21 import java.util.Map ; 22 import java.util.Set ; 23 24 25 31 public class DefaultInstanceContext implements InstanceContext { 32 private final Map connectionManagerMap = new HashMap (); 33 private final Set unshareableResources; 34 private final Set applicationManagedSecurityResources; 35 private int callDepth; 36 private boolean dead = false; 37 38 public DefaultInstanceContext(Set unshareableResources, Set applicationManagedSecurityResources) { 39 this.unshareableResources = unshareableResources; 40 this.applicationManagedSecurityResources = applicationManagedSecurityResources; 41 } 42 43 public Object getId() { 44 return null; 45 } 46 47 public Object getContainerId() { 48 return null; 49 } 50 51 public void associate() throws Exception { 52 } 53 54 public void flush() throws Exception { 55 } 56 57 public void beforeCommit() throws Exception { 58 } 59 60 public void afterCommit(boolean status) throws Exception { 61 } 62 63 public void unassociate() throws Throwable { 64 } 65 66 public Map getConnectionManagerMap() { 67 return connectionManagerMap; 68 } 69 70 public Set getUnshareableResources() { 71 return unshareableResources; 72 } 73 74 public Set getApplicationManagedSecurityResources() { 75 return applicationManagedSecurityResources; 76 } 77 78 public boolean isInCall() { 79 return callDepth > 0; 80 } 81 82 public void enter() { 83 callDepth++; 84 } 85 86 public void exit() { 87 assert isInCall(); 88 callDepth--; 89 } 90 91 public boolean isDead() { 92 return dead; 93 } 94 95 public void die() { 96 dead = true; 97 } 98 } 99 | Popular Tags |