1 23 package com.sun.enterprise; 24 25 import java.util.Vector ; 26 import java.util.HashMap ; 27 import java.util.Properties ; 28 import java.util.concurrent.ConcurrentHashMap ; 29 import java.security.Principal ; 30 import javax.transaction.Transaction ; 31 import javax.sql.XAConnection ; 32 import com.sun.enterprise.resource.*; 33 import com.sun.enterprise.deployment.ResourceReferenceDescriptor; 34 import com.sun.enterprise.deployment.ConnectorDescriptor; 35 import javax.security.auth.Subject ; 36 import javax.transaction.xa.Xid ; 37 import javax.naming.Reference ; 38 import javax.resource.spi.ManagedConnection ; 39 import javax.resource.ResourceException ; 40 41 import com.sun.enterprise.connectors.ConnectorConnectionPool; 42 import com.sun.enterprise.connectors.ConnectorConstants.PoolType; 43 44 49 public interface PoolManager { 50 51 static public final int NO_TRANSACTION = 0; 53 static public final int LOCAL_TRANSACTION = 1; 54 static public final int XA_TRANSACTION = 2; 55 56 static public final int BASIC_PASSWORD = 0; 58 static public final int KERBV5 = 1; 59 60 static public final String PASSWORD_CREDENTIAL = "javax.resource.spi.security.PasswordCredential"; 62 static public final String GENERIC_CREDENTIAL = "javax.resource.spi.security.GenericCredential"; 63 64 76 Object getResource(ResourceSpec spec, ResourceAllocator alloc, 77 ClientSecurityInfo info) 78 throws PoolingException; 79 80 ResourceReferenceDescriptor 81 getResourceReference(String jndiName); 82 83 void resourceEnlisted(Transaction tran, ResourceHandle res) 84 throws IllegalStateException ; 85 86 void resourceClosed(ResourceHandle res); 87 88 void resourceErrorOccurred(ResourceHandle res); 89 90 void transactionCompleted(Transaction tran, int status); 91 92 public void putbackResourceToPool(ResourceHandle h, 93 boolean errorOccurred); 94 95 public void putbackDirectToPool(ResourceHandle h, String poolName); 96 97 public ResourceHandle getResourceFromPool(ResourceSpec spec, 98 ResourceAllocator alloc, 99 ClientSecurityInfo info, 100 Transaction tran) 101 throws PoolingException; 102 103 public void registerResource(ResourceHandle resource) 104 throws PoolingException; 105 106 public void unregisterResource(ResourceHandle resource, 107 int xaresFlag); 108 109 public void emptyResourcePool(ResourceSpec spec); 110 111 public void killPool( String poolName ); 112 113 public void reconfigPoolProperties( ConnectorConnectionPool ccp ) 114 throws PoolingException; 115 116 public void disableMonitoring( String poolName); 118 public void setMonitoringEnabledHigh( String poolName); 119 public void setMonitoringEnabledLow( String poolName); 120 121 public ConcurrentHashMap getPoolTable(); 123 124 public void initializeMonitoring(); 126 127 public boolean switchOnMatching(String poolName); 128 129 public void killAllPools(); 130 131 public void killFreeConnectionsInPools(); 132 133 public void createEmptyConnectionPool(String name, 134 PoolType pt) throws PoolingException; 135 136 public ResourcePool getPool( String poolName ); 137 138 public void setSelfManaged( String poolName, boolean flag ); 139 140 public void lazyEnlist( ManagedConnection mc ) throws ResourceException ; 141 142 public void postInvoke(); 143 } 144 145 | Popular Tags |