FileDocCategorySizeDatePackage
ConnectionPoolReconfigHelper.javaAPI DocGlassfish v2 API6050Fri May 04 22:34:26 BST 2007com.sun.enterprise.connectors.util

ConnectionPoolReconfigHelper

public final class ConnectionPoolReconfigHelper extends Object

Fields Summary
private static final Logger
_logger
Constructors Summary
Methods Summary
public static com.sun.enterprise.connectors.util.ConnectionPoolReconfigHelper$ReconfigActioncompare(ConnectorConnectionPool oldPool, ConnectorConnectionPool newPool, java.util.Set excludedProps)

    

           

          
                 
	      
    

        if ( isEqualConnectorConnectionPool( oldPool, newPool , excludedProps ) 
	    == ReconfigAction.NO_OP ) {
	
	    return ReconfigAction.UPDATE_MCF_AND_ATTRIBUTES;
	}
        
	return ReconfigAction.RECREATE_POOL;

    
private static com.sun.enterprise.connectors.util.ConnectionPoolReconfigHelper$ReconfigActionisEqualConnectorConnectionPool(ConnectorConnectionPool oldCcp, ConnectorConnectionPool newCcp, java.util.Set excludedProps)

        boolean poolsEqual = true;
        
	//for all the following properties, we need to recreate pool if they
	//have changed
	if (newCcp.getTransactionSupport() != oldCcp.getTransactionSupport() ) {
	    return ReconfigAction.RECREATE_POOL;
	}

	if (newCcp.isAssociateWithThread() != oldCcp.isAssociateWithThread() ) {
	    return ReconfigAction.RECREATE_POOL;
	}

	if (newCcp.isLazyConnectionAssoc() != oldCcp.isLazyConnectionAssoc() ) {
	    return ReconfigAction.RECREATE_POOL;
	}

	
        ConnectorDescriptorInfo oldCdi = oldCcp.getConnectorDescriptorInfo();
        ConnectorDescriptorInfo newCdi = newCcp.getConnectorDescriptorInfo();

	if (! oldCdi.getResourceAdapterClassName().equals(
	        newCdi.getResourceAdapterClassName())  ) {
	    
	    logFine(
	        "isEqualConnectorConnectionPool: getResourceAdapterClassName:: " +
	         oldCdi.getResourceAdapterClassName() + " -- " +
		 newCdi.getResourceAdapterClassName()); 
	    return ReconfigAction.RECREATE_POOL;
	}

	if (! oldCdi.getConnectionDefinitionName().equals(
	        newCdi.getConnectionDefinitionName()) ) {
	    
	    logFine(
	        "isEqualConnectorConnectionPool: getConnectionDefinitionName:: "+
	        oldCdi.getConnectionDefinitionName() + " -- " +
		newCdi.getConnectionDefinitionName());
	   	
	    return ReconfigAction.RECREATE_POOL;
	}

    ConnectorSecurityMap[] newSecurityMaps = newCcp.getSecurityMaps();
    RuntimeSecurityMap newRuntimeSecurityMap = 
        SecurityMapUtils.processSecurityMaps(newSecurityMaps);
    ConnectorSecurityMap[] oldSecurityMaps = oldCcp.getSecurityMaps();
    RuntimeSecurityMap oldRuntimeSecurityMap = 
        SecurityMapUtils.processSecurityMaps(oldSecurityMaps);
    if (!( oldRuntimeSecurityMap.equals(newRuntimeSecurityMap) )){
    	logFine("isEqualConnectorConnectionPool: CCP.getSecurityMaps:: " +
    			"New set of Security Maps is not equal to the existing" +
    			" set of security Maps.");
    	return ReconfigAction.RECREATE_POOL;
    }
	
	Set newMCFConfigProps = newCdi.getMCFConfigProperties();
	Set oldMCFConfigProps = oldCdi.getMCFConfigProperties();
        return  oldCdi.compareMCFConfigProperties( newCdi, excludedProps );
    
private static voidlogFine(java.lang.String msg)

        if (msg != null && _logger.isLoggable(Level.FINE)) {
	    _logger.fine( msg );
	}