// Path: spi/src/main/java/org/jipijapa/plugin/spi/ManagementAdaptor.java
// public interface ManagementAdaptor {
// 
// 
//     /**
//      * Get the short identification string that represents the management adaptor (e.g Hibernate)
//      *
//      * @return id label
//      */
//     String getIdentificationLabel();
// 
//     /**
//      * Version that uniquely identifies the management adapter (can be used to tell the difference between
//      * Hibernate 4.1 vs 4.3).
//      *
//      * @return version string
//      */
//     String getVersion();
// 
//     Statistics getStatistics();
// }
// 
// Path: spi/src/main/java/org/jipijapa/plugin/spi/PersistenceProviderAdaptor.java
// public interface PersistenceProviderAdaptor {
// 
//     /**
//      * pass the JtaManager in for internal use by PersistenceProviderAdaptor implementer
//      *
//      * @param jtaManager
//      */
//     void injectJtaManager(JtaManager jtaManager);
// 
//     /**
//      * pass the platform in use
//      * @param platform
//      */
//     void injectPlatform(Platform platform);
// 
//     /**
//      * Adds any provider specific properties (e.g. hibernate.transaction.manager_lookup_class)
//      *
//      * @param properties
//      * @param pu
//      */
//     void addProviderProperties(Map properties, PersistenceUnitMetadata pu);
// 
//     /**
//      * Persistence provider integration code might need dependencies that must be started
//      * for the deployment.  Note that these dependency classes are expected to be already available to the provider.
//      *
//      * @param pu
//      * @return
//      */
//     void addProviderDependencies(PersistenceUnitMetadata pu);
// 
//     /**
//      * Called right before persistence provider is invoked to create container entity manager factory.
//      * afterCreateContainerEntityManagerFactory() will always be called after the container entity manager factory
//      * is created.
//      *
//      * @param pu
//      */
//     void beforeCreateContainerEntityManagerFactory(PersistenceUnitMetadata pu);
// 
//     /**
//      * Called right after persistence provider is invoked to create container entity manager factory.
//      */
//     void afterCreateContainerEntityManagerFactory(PersistenceUnitMetadata pu);
// 
//     /**
//      * Get the management adaptor
//      *
//      * @return ManagementAdaptor or null
//      */
//     ManagementAdaptor getManagementAdaptor();
// 
//     /**
//      * for adapters that support getManagementAdaptor(), does the scoped persistence unit name
//      * correctly identify cache entities.  This is intended for Hibernate, other adapters can return true.
//      *
//      * @return the Hibernate adapter will return false if
//      * the persistence unit has specified a custom "hibernate.cache.region_prefix" property.  True otherwise.
//      *
//      */
//     boolean doesScopedPersistenceUnitNameIdentifyCacheRegionName(PersistenceUnitMetadata pu);
// 
//     /**
//      * Called when we are done with the persistence unit metadata
//      */
//     void cleanup(PersistenceUnitMetadata pu);
// }
// 
// Path: spi/src/main/java/org/jipijapa/plugin/spi/Platform.java
// public interface Platform {
// 
//     /**
//      * obtain the default second level cache classification
//      * @return default 2lc type
//      */
//     Classification defaultCacheClassification();
// 
//     /**
//      * get the second level cache classifications
//      * @return Set<Classification>
//      */
//     Set<Classification> cacheClassifications();
// }


import java.util.Map;
import org.jboss.logging.Logger;
import org.jipijapa.plugin.spi.JtaManager;
import org.jipijapa.plugin.spi.ManagementAdaptor;
import org.jipijapa.plugin.spi.PersistenceProviderAdaptor;
import org.jipijapa.plugin.spi.PersistenceUnitMetadata;
import org.jipijapa.plugin.spi.Platform;
        } else {
            // Version-specific handling here
            if ( (major == 2 && minor == 3 && rev <= 2) || (major == 2 && minor < 3) ) {
                logger.info("Enabling workaronud for EclipseLink bug 365704 for EclipseLink 2.3.2 and older");
                hasJTABug = true;
            } else {
                hasJTABug = false;
            }
        }
    }

    @SuppressWarnings({ "rawtypes", "unchecked" })
    @Override
    public void addProviderProperties(Map properties, PersistenceUnitMetadata pu) {
        if (!properties.containsKey(ECLIPSELINK_TARGET_SERVER)) {
            properties.put(ECLIPSELINK_TARGET_SERVER, JBossAS7ServerPlatform.class.getName());
            properties.put(ECLIPSELINK_ARCHIVE_FACTORY, JBossArchiveFactoryImpl.class.getName());
            properties.put(ECLIPSELINK_LOGGING_LOGGER, JBossLogger.class.getName());
        }
        logger.trace("Property " + ECLIPSELINK_TARGET_SERVER + " set to " + properties.get(ECLIPSELINK_TARGET_SERVER));
        logger.trace("Property " + ECLIPSELINK_ARCHIVE_FACTORY + " set to " + properties.get(ECLIPSELINK_ARCHIVE_FACTORY));
        logger.trace("Property " + ECLIPSELINK_LOGGING_LOGGER + " set to " + properties.get(ECLIPSELINK_LOGGING_LOGGER));
    }

    @Override
    public void injectJtaManager(JtaManager jtaManager) {
        // No action required, EclipseLink looks this up from JNDI
    }

    @Override
// Path: spi/src/main/java/org/jipijapa/plugin/spi/ManagementAdaptor.java
// public interface ManagementAdaptor {
// 
// 
//     /**
//      * Get the short identification string that represents the management adaptor (e.g Hibernate)
//      *
//      * @return id label
//      */
//     String getIdentificationLabel();
// 
//     /**
//      * Version that uniquely identifies the management adapter (can be used to tell the difference between
//      * Hibernate 4.1 vs 4.3).
//      *
//      * @return version string
//      */
//     String getVersion();
// 
//     Statistics getStatistics();
// }
// 
// Path: spi/src/main/java/org/jipijapa/plugin/spi/PersistenceProviderAdaptor.java
// public interface PersistenceProviderAdaptor {
// 
//     /**
//      * pass the JtaManager in for internal use by PersistenceProviderAdaptor implementer
//      *
//      * @param jtaManager
//      */
//     void injectJtaManager(JtaManager jtaManager);
// 
//     /**
//      * pass the platform in use
//      * @param platform
//      */
//     void injectPlatform(Platform platform);
// 
//     /**
//      * Adds any provider specific properties (e.g. hibernate.transaction.manager_lookup_class)
//      *
//      * @param properties
//      * @param pu
//      */
//     void addProviderProperties(Map properties, PersistenceUnitMetadata pu);
// 
//     /**
//      * Persistence provider integration code might need dependencies that must be started
//      * for the deployment.  Note that these dependency classes are expected to be already available to the provider.
//      *
//      * @param pu
//      * @return
//      */
//     void addProviderDependencies(PersistenceUnitMetadata pu);
// 
//     /**
//      * Called right before persistence provider is invoked to create container entity manager factory.
//      * afterCreateContainerEntityManagerFactory() will always be called after the container entity manager factory
//      * is created.
//      *
//      * @param pu
//      */
//     void beforeCreateContainerEntityManagerFactory(PersistenceUnitMetadata pu);
// 
//     /**
//      * Called right after persistence provider is invoked to create container entity manager factory.
//      */
//     void afterCreateContainerEntityManagerFactory(PersistenceUnitMetadata pu);
// 
//     /**
//      * Get the management adaptor
//      *
//      * @return ManagementAdaptor or null
//      */
//     ManagementAdaptor getManagementAdaptor();
// 
//     /**
//      * for adapters that support getManagementAdaptor(), does the scoped persistence unit name
//      * correctly identify cache entities.  This is intended for Hibernate, other adapters can return true.
//      *
//      * @return the Hibernate adapter will return false if
//      * the persistence unit has specified a custom "hibernate.cache.region_prefix" property.  True otherwise.
//      *
//      */
//     boolean doesScopedPersistenceUnitNameIdentifyCacheRegionName(PersistenceUnitMetadata pu);
// 
//     /**
//      * Called when we are done with the persistence unit metadata
//      */
//     void cleanup(PersistenceUnitMetadata pu);
// }
// 
// Path: spi/src/main/java/org/jipijapa/plugin/spi/Platform.java
// public interface Platform {
// 
//     /**
//      * obtain the default second level cache classification
//      * @return default 2lc type
//      */
//     Classification defaultCacheClassification();
// 
//     /**
//      * get the second level cache classifications
//      * @return Set<Classification>
//      */
//     Set<Classification> cacheClassifications();
// }


// Path: eclipselink/src/main/java/org/jipijapa/eclipselink/EclipseLinkPersistenceProviderAdaptor.java
import java.util.Map;
import org.jboss.logging.Logger;
import org.jipijapa.plugin.spi.JtaManager;
import org.jipijapa.plugin.spi.ManagementAdaptor;
import org.jipijapa.plugin.spi.PersistenceProviderAdaptor;
import org.jipijapa.plugin.spi.PersistenceUnitMetadata;
import org.jipijapa.plugin.spi.Platform;

        } else {
            // Version-specific handling here
            if ( (major == 2 && minor == 3 && rev <= 2) || (major == 2 && minor < 3) ) {
                logger.info("Enabling workaronud for EclipseLink bug 365704 for EclipseLink 2.3.2 and older");
                hasJTABug = true;
            } else {
                hasJTABug = false;
            }
        }
    }

    @SuppressWarnings({ "rawtypes", "unchecked" })
    @Override
    public void addProviderProperties(Map properties, PersistenceUnitMetadata pu) {
        if (!properties.containsKey(ECLIPSELINK_TARGET_SERVER)) {
            properties.put(ECLIPSELINK_TARGET_SERVER, JBossAS7ServerPlatform.class.getName());
            properties.put(ECLIPSELINK_ARCHIVE_FACTORY, JBossArchiveFactoryImpl.class.getName());
            properties.put(ECLIPSELINK_LOGGING_LOGGER, JBossLogger.class.getName());
        }
        logger.trace("Property " + ECLIPSELINK_TARGET_SERVER + " set to " + properties.get(ECLIPSELINK_TARGET_SERVER));
        logger.trace("Property " + ECLIPSELINK_ARCHIVE_FACTORY + " set to " + properties.get(ECLIPSELINK_ARCHIVE_FACTORY));
        logger.trace("Property " + ECLIPSELINK_LOGGING_LOGGER + " set to " + properties.get(ECLIPSELINK_LOGGING_LOGGER));
    }

    @Override
    public void injectJtaManager(JtaManager jtaManager) {
        // No action required, EclipseLink looks this up from JNDI
    }

    @Override
    public void injectPlatform(Platform platform) {