1 23 package com.sun.enterprise.connectors.inflow; 24 25 import com.sun.enterprise.resource.PoolingException; 26 import com.sun.enterprise.resource.AbstractConnectorAllocator; 27 import com.sun.enterprise.resource.ResourceAllocator; 28 import com.sun.enterprise.resource.ResourceHandle; 29 import com.sun.enterprise.resource.ResourceSpec; 30 import com.sun.enterprise.resource.XAResourceWrapper; 31 import com.sun.logging.LogDomains; 32 33 import java.util.Set ; 34 import java.util.logging.Level ; 35 import java.util.logging.Logger ; 36 37 import javax.resource.ResourceException ; 38 import javax.transaction.xa.XAResource ; 39 40 public class BasicResourceAllocator extends AbstractConnectorAllocator { 41 42 private static Logger logger = 43 LogDomains.getLogger(LogDomains.RSR_LOGGER); 44 45 private static final String JMS_RESOURCE_FACTORY = "JMS"; 46 47 public BasicResourceAllocator () {} 48 49 public ResourceHandle createResource() 50 throws PoolingException { 51 throw new UnsupportedOperationException (); 52 } 53 54 public ResourceHandle createResource(XAResource xaResource) 55 throws PoolingException { 56 57 ResourceHandle resourceHandle = null; 58 ResourceSpec spec = 59 new ResourceSpec(JMS_RESOURCE_FACTORY, 60 ResourceSpec.JMS); 61 62 if (xaResource != null) { 63 64 logger.logp(Level.FINEST, 65 "BasicResourceAllocator", "createResource", 66 "NOT NULL", xaResource); 67 68 try { 69 resourceHandle = new ResourceHandle( 70 null, spec, 72 this, null); 73 74 if (logger.isLoggable(Level.FINEST)) { 75 xaResource = new XAResourceWrapper(xaResource); 76 } 77 78 resourceHandle.fillInResourceObjects(null, xaResource); 79 80 } catch (Exception e) { 81 throw (PoolingException) (new PoolingException()).initCause(e); 82 } 83 } else { 84 logger.logp(Level.FINEST, 85 "BasicResourceAllocator", "createResource", 86 "NULL", xaResource); 87 } 88 89 return resourceHandle; 90 } 91 92 93 public void closeUserConnection(ResourceHandle resourceHandle) 94 throws PoolingException { 95 throw new UnsupportedOperationException (); 96 } 97 98 99 public boolean matchConnection(ResourceHandle resourceHandle) { 100 return false; 101 } 102 103 public boolean supportsReauthentication() { 104 return false; 105 } 106 107 public void cleanup(ResourceHandle resourceHandle) 108 throws PoolingException { 109 throw new UnsupportedOperationException (); 110 } 111 112 public Set getInvalidConnections(Set connectionSet) throws ResourceException { 113 throw new UnsupportedOperationException (); 114 } 115 116 public boolean isConnectionValid( ResourceHandle resource ) { 117 throw new UnsupportedOperationException (); 118 } 119 120 } 121 | Popular Tags |