private void markDU(PersistenceUnitMetadataHolder holder, DeploymentUnit deploymentUnit) { if (holder.getPersistenceUnits() != null && holder.getPersistenceUnits().size() > 0) { JPADeploymentMarker.mark(deploymentUnit); } }
public static JPADeploymentSettings parser(XMLExtendedStreamReader reader, PropertyReplacer propertyReplacer) throws XMLStreamException { JPADeploymentSettings result = new JPADeploymentSettings(); INSTANCE.readElement(reader, result, propertyReplacer); return result; }
/** * pre-loads the default persistence provider * * @throws ModuleLoadException */ public static void loadDefaultProvider() throws ModuleLoadException { String defaultProviderModule = Configuration.getDefaultProviderModuleName(); loadProviderModuleByName(defaultProviderModule); }
public static void setDefaultExtendedPersistenceInheritance(ExtendedPersistenceInheritance defaultExtendedPersistenceInheritance) { ROOT_LOGGER.tracef("JPAService.setDefaultExtendedPersistenceInheritance(%s)", defaultExtendedPersistenceInheritance.toString()); JPAService.defaultExtendedPersistenceInheritance = defaultExtendedPersistenceInheritance; }
private PersistenceUnitsInApplication getPersistenceUnitsInApplication(DeploymentUnit topDeploymentUnit) { PersistenceUnitsInApplication persistenceUnitsInApplication = topDeploymentUnit.getAttachment(PersistenceUnitsInApplication.PERSISTENCE_UNITS_IN_APPLICATION); if (persistenceUnitsInApplication == null) { persistenceUnitsInApplication = new PersistenceUnitsInApplication(); topDeploymentUnit.putAttachment(PersistenceUnitsInApplication.PERSISTENCE_UNITS_IN_APPLICATION, persistenceUnitsInApplication); } return persistenceUnitsInApplication; } }
private void addApplicationDependenciesOnProvider(DeploymentUnit topDeploymentUnit, PersistenceUnitMetadataHolder holder) { topDeploymentUnit = DeploymentUtils.getTopDeploymentUnit(topDeploymentUnit); synchronized (topDeploymentUnit) { // ensure that only one deployment thread sets this at a time PersistenceUnitsInApplication persistenceUnitsInApplication = getPersistenceUnitsInApplication(topDeploymentUnit); persistenceUnitsInApplication.addPersistenceUnitHolder(holder); } }
/** * return true if non-tx invocations should defer detaching of entities until entity manager is closed. * Note that this is an extension for compatibility with JBoss application server 5.0/6.0 (see AS7-2781) */ @Override protected boolean deferEntityDetachUntilClose() { if (deferDetach == null) deferDetach = (true == Configuration.deferEntityDetachUntilClose(emf.getProperties())? Boolean.TRUE : Boolean.FALSE); return deferDetach.booleanValue(); }
private static boolean deploymentHasPersistenceProvider(DeploymentUnit deploymentUnit) { deploymentUnit = DeploymentUtils.getTopDeploymentUnit(deploymentUnit); PersistenceProviderDeploymentHolder persistenceProviderDeploymentHolder = deploymentUnit.getAttachment(JpaAttachments.DEPLOYED_PERSISTENCE_PROVIDER); return (persistenceProviderDeploymentHolder != null && persistenceProviderDeploymentHolder.getProviders() != null ? persistenceProviderDeploymentHolder.getProviders().size() > 0: false); }
@Override public void addTransformer(ClassTransformer classTransformer) { transformers.add(classTransformer); if (ROOT_LOGGER.isTraceEnabled()) { ROOT_LOGGER.tracef("added entity class transformer '%s' for '%s'", classTransformer.getClass().getName(), getScopedPersistenceUnitName()); } }
private void incrementPersistenceUnitCount(DeploymentUnit topDeploymentUnit, int persistenceUnitCount) { topDeploymentUnit = DeploymentUtils.getTopDeploymentUnit(topDeploymentUnit); // create persistence unit counter if not done already synchronized (topDeploymentUnit) { // ensure that only one deployment thread sets this at a time PersistenceUnitsInApplication persistenceUnitsInApplication = getPersistenceUnitsInApplication(topDeploymentUnit); persistenceUnitsInApplication.increment(persistenceUnitCount); } ROOT_LOGGER.tracef("incrementing PU count for %s by %d", topDeploymentUnit.getName(), persistenceUnitCount); }
private void markDU(PersistenceUnitMetadataHolder holder, DeploymentUnit deploymentUnit) { if (holder.getPersistenceUnits() != null && holder.getPersistenceUnits().size() > 0) { JPADeploymentMarker.mark(deploymentUnit); } }
public static ExtendedPersistenceInheritance getDefaultExtendedPersistenceInheritance() { ROOT_LOGGER.tracef("JPAService.getDefaultExtendedPersistenceInheritance() == %s", defaultExtendedPersistenceInheritance.toString()); return defaultExtendedPersistenceInheritance; }
public static JPADeploymentSettings parser(XMLExtendedStreamReader reader, PropertyReplacer propertyReplacer) throws XMLStreamException { JPADeploymentSettings result = new JPADeploymentSettings(); INSTANCE.readElement(reader, result, propertyReplacer); return result; }
private PersistenceUnitsInApplication getPersistenceUnitsInApplication(DeploymentUnit topDeploymentUnit) { PersistenceUnitsInApplication persistenceUnitsInApplication = topDeploymentUnit.getAttachment(PersistenceUnitsInApplication.PERSISTENCE_UNITS_IN_APPLICATION); if (persistenceUnitsInApplication == null) { persistenceUnitsInApplication = new PersistenceUnitsInApplication(); topDeploymentUnit.putAttachment(PersistenceUnitsInApplication.PERSISTENCE_UNITS_IN_APPLICATION, persistenceUnitsInApplication); } return persistenceUnitsInApplication; } }
/** * pre-loads the default persistence provider * * @throws ModuleLoadException */ public static void loadDefaultProvider() throws ModuleLoadException { String defaultProviderModule = Configuration.getDefaultProviderModuleName(); loadProviderModuleByName(defaultProviderModule); }
private void addApplicationDependenciesOnProvider(DeploymentUnit topDeploymentUnit, PersistenceUnitMetadataHolder holder) { topDeploymentUnit = DeploymentUtils.getTopDeploymentUnit(topDeploymentUnit); synchronized (topDeploymentUnit) { // ensure that only one deployment thread sets this at a time PersistenceUnitsInApplication persistenceUnitsInApplication = getPersistenceUnitsInApplication(topDeploymentUnit); persistenceUnitsInApplication.addPersistenceUnitHolder(holder); } }
/** * return true if non-tx invocations should defer detaching of entities until entity manager is closed. * Note that this is an extension for compatibility with JBoss application server 5.0/6.0 (see AS7-2781) */ @Override protected boolean deferEntityDetachUntilClose() { if (deferDetach == null) deferDetach = (true == Configuration.deferEntityDetachUntilClose(emf.getProperties())? Boolean.TRUE : Boolean.FALSE); return deferDetach.booleanValue(); }
private static boolean deploymentHasPersistenceProvider(DeploymentUnit deploymentUnit) { deploymentUnit = DeploymentUtils.getTopDeploymentUnit(deploymentUnit); PersistenceProviderDeploymentHolder persistenceProviderDeploymentHolder = deploymentUnit.getAttachment(JpaAttachments.DEPLOYED_PERSISTENCE_PROVIDER); return (persistenceProviderDeploymentHolder != null && persistenceProviderDeploymentHolder.getProviders() != null ? persistenceProviderDeploymentHolder.getProviders().size() > 0: false); }
public static void setDefaultExtendedPersistenceInheritance(ExtendedPersistenceInheritance defaultExtendedPersistenceInheritance) { ROOT_LOGGER.tracef("JPAService.setDefaultExtendedPersistenceInheritance(%s)", defaultExtendedPersistenceInheritance.toString()); JPAService.defaultExtendedPersistenceInheritance = defaultExtendedPersistenceInheritance; }
public static ExtendedPersistenceInheritance getDefaultExtendedPersistenceInheritance() { ROOT_LOGGER.tracef("JPAService.getDefaultExtendedPersistenceInheritance() == %s", defaultExtendedPersistenceInheritance.toString()); return defaultExtendedPersistenceInheritance; }