FileDocCategorySizeDatePackage
SystemResourceManagerImpl.javaAPI DocGlassfish v2 API5722Fri May 04 22:35:16 BST 2007com.sun.enterprise.resource

SystemResourceManagerImpl

public class SystemResourceManagerImpl extends Object implements ResourceManager
SystemResourceManagerImpl manages the resource requests from system
author
Binod PG

Fields Summary
private static Logger
_logger
Constructors Summary
Methods Summary
public voiddelistResource(ResourceHandle h, int xaresFlag)
delist the ResourceHandle from the transaction

param
h ResourceHandle object
param
xaresFlag flag indicating transaction success. This can be XAResource.TMSUCCESS or XAResource.TMFAIL
exception
PoolingException

        try {
            J2EETransactionManager tm =
                Switch.getSwitch().getTransactionManager();
            Transaction tran = tm.getTransaction();
	    if (tran != null) {
                tm.delistResource(tran, h, xaresFlag);
            }		
        } catch (SystemException ex) {
            _logger.log(Level.WARNING,"poolmgr.system_exception",ex);
        } catch (IllegalStateException ex) {
            // ignore
        }            
    
public voidenlistResource(ResourceHandle handle)
Register the ResourceHandle in the transaction

param
handle ResourceHandle object
exception
PoolingException If there is any error while enlisting.

        try {
            J2EETransactionManager tm =
                Switch.getSwitch().getTransactionManager();
            Transaction tran = tm.getTransaction();
	    if (tran != null) {
                tm.enlistResource(tran, handle);
            }
	} catch (Exception ex) {
            _logger.log(Level.SEVERE,"poolmgr.unexpected_exception",ex);
            throw new PoolingException(ex.toString(), ex);
        }           
    
public java.lang.ObjectgetComponent()
Return null for System Resource.

        
        return null;
    
public javax.transaction.TransactiongetTransaction()
Returns the transaction component is participating.

return
Handle to the Transaction object.
exception
PoolingException If exception is thrown while getting the transaction.

        _logger = LogDomains.getLogger(LogDomains.RSR_LOGGER);
    
        try {
            J2EETransactionManager tm =
                Switch.getSwitch().getTransactionManager();
            return tm.getTransaction();
        } catch (Exception ex) {
            _logger.log(Level.SEVERE,"poolmgr.unexpected_exception",ex);
            throw new PoolingException(ex.toString(), ex);
        }
    
public voidregisterResource(ResourceHandle handle)
Dont do any thing for System Resource.

    
public voidrollBackTransaction()

        try {
            J2EETransactionManager tm =
                Switch.getSwitch().getTransactionManager();
            Transaction tran = tm.getTransaction();
	    if ( tran != null ) {
                tran.setRollbackOnly();
	    }
        } catch (SystemException ex) {
            _logger.log(Level.WARNING,"poolmgr.system_exception",ex);
        } catch (IllegalStateException ex) {
            // ignore
        }    
    
public voidunregisterResource(ResourceHandle resource, int xaresFlag)
Dont do any thing for System Resource.