Package org.glassfish.deployment.common

Examples of org.glassfish.deployment.common.RootDeploymentDescriptor


            logger.logp(Level.FINE, "PersistenceUnitLoader", "loadPU", // NOI18N
                        "emf = {0}", emf); // NOI18N
        }

        PersistenceUnitsDescriptor parent = pud.getParent();
        RootDeploymentDescriptor containingBundle = parent.getParent();
        providerContainerContractInfo.registerEMF(pInfo.getPersistenceUnitName(), pud.getPuRoot(), containingBundle, emf);

        if(fineMsgLoggable) {
            logger.fine("Finished loading persistence unit for application: " // NOI18N
                    applicationLocation);
View Full Code Here


        /**
         * Iterate through all the PersistenceUnitDescriptors for the given context (and hence corresponding bundle) and call visitPUD for each of them
         * @param context
         */
        void iteratePUDs(DeploymentContext context) {
            RootDeploymentDescriptor currentBundle = DOLUtils.getCurrentBundleForContext(context);
            if (currentBundle != null) { // it can be null for non-JavaEE type of application deployment. e.g., issue 15869
                Collection<PersistenceUnitsDescriptor> pusDescriptorForThisBundle = currentBundle.getExtensionsDescriptors(PersistenceUnitsDescriptor.class);
                for (PersistenceUnitsDescriptor persistenceUnitsDescriptor : pusDescriptorForThisBundle) {
                        for (PersistenceUnitDescriptor pud : persistenceUnitsDescriptor.getPersistenceUnitDescriptors()) {
                            visitPUD(pud, context);
                        }
                }
View Full Code Here

     * @param persistenceUnitDescriptor
     * @return the absolute path of the root of this persistence unit
     */
    private String getAbsolutePuRoot(String applicationLocation,
            PersistenceUnitDescriptor persistenceUnitDescriptor) {
        RootDeploymentDescriptor rootDD = persistenceUnitDescriptor.getParent().                getParent();
        String puRoot = persistenceUnitDescriptor.getPuRoot();
        if(rootDD.isApplication()){
            return puRoot;
        } else {
            ModuleDescriptor module = BundleDescriptor.class.cast(rootDD).
                    getModuleDescriptor();
            if(module.isStandalone()) {
View Full Code Here

    public ComponentNameConstructor(PersistenceUnitDescriptor
            descriptor) {
        PersistenceUnitsDescriptor persistenceUnitsDescriptor =
                descriptor.getParent();
        RootDeploymentDescriptor container = persistenceUnitsDescriptor.getParent();
        if(container.isApplication()) {
            this.appName = Application.class.cast(container).getRegistrationName();
            this.componentName = persistenceUnitsDescriptor.getPuRoot() +
                    "#"+descriptor.getName(); // NOI18N
        } else { // this PU is bundled inside a module
            BundleDescriptor bundleDesc = BundleDescriptor.class.cast(container);
View Full Code Here

        implements VerifierCheck {
    final static String className = AbstractPersistenceUnitCount.class.getName();
   
    public Result check(Descriptor descriptor) {
       
        RootDeploymentDescriptor rootDescriptor = getRootDescriptor(descriptor);
       
        Result result = getInitializedResult();
        addErrorDetails(result,
                getVerifierContext().getComponentNameConstructor());
        result.setStatus(Result.PASSED); //default status is PASSED
       
        if(rootDescriptor.getExtensionsDescriptors(PersistenceUnitsDescriptor.class).size() == 0)
            result.setStatus(Result.NOT_APPLICABLE);
       
        for(PersistenceUnitsDescriptor pus : rootDescriptor.getExtensionsDescriptors(PersistenceUnitsDescriptor.class)) {
            if (pus.getPersistenceUnitDescriptors().size() == 0) {
                result.failed(
                        smh.getLocalString(
                        className + ".failed",
                        "persistence.xml in persistence unit root [ {0} ] has no persistence units.",
View Full Code Here

    }

    @Override protected void check(Descriptor descriptor) throws Exception {
        PersistenceUnitDescriptor pu =
                PersistenceUnitDescriptor.class.cast(descriptor);
        RootDeploymentDescriptor rootDD = pu.getParent().getParent();
        if(rootDD.isApplication()) {
            moduleName = Result.APP;
        } else {
            ModuleDescriptor mdesc =
                    BundleDescriptor.class.cast(rootDD).getModuleDescriptor();
            final ArchiveType moduleType = mdesc.getModuleType();
View Full Code Here

     * @param descriptor is a PersistenceUnitDescriptor
     * @return the path to the module
     */
    protected String getAbstractArchiveUri(Descriptor descriptor) {
        String archBase = context.getAbstractArchive().getURI().toString();
        RootDeploymentDescriptor rootDD =
                PersistenceUnitDescriptor.class.cast(descriptor).getParent().getParent();
        if(rootDD.isApplication()) {
            return archBase;
        } else {
            ModuleDescriptor mdesc =
                    BundleDescriptor.class.cast(rootDD).getModuleDescriptor();
            if(mdesc.isStandalone()) {
View Full Code Here

            logger.logp(Level.FINE, "PersistenceUnitLoader", "loadPU", // NOI18N
                        "emf = {0}", emf); // NOI18N
        }

        PersistenceUnitsDescriptor parent = pud.getParent();
        RootDeploymentDescriptor containingBundle = parent.getParent();
        providerContainerContractInfo.registerEMF(pInfo.getPersistenceUnitName(), pud.getPuRoot(), containingBundle, emf);

        if(fineMsgLoggable) {
            logger.fine("Finished loading persistence unit for application: " // NOI18N
                    applicationLocation);
View Full Code Here

     * Returned path always uses '/' as path separator.
     * @return the absolute path of the root of this persistence unit
     */
    private String getAbsolutePuRootWithinApplication() {
        // TODO shift this into PersistenceUnitDescriptor to better encapsulate
        RootDeploymentDescriptor rootDD = persistenceUnitDescriptor.getParent().
                getParent();
        String puRoot = persistenceUnitDescriptor.getPuRoot();
        if(rootDD.isApplication()){
            return puRoot;
        } else {
            ModuleDescriptor module = BundleDescriptor.class.cast(rootDD).
                    getModuleDescriptor();
            if(module.isStandalone()) {
View Full Code Here

        /**
         * Iterate through all the PersistenceUnitDescriptors for the given context (and hence corresponding bundle) and call visitPUD for each of them
         * @param context
         */
        void iteratePUDs(DeploymentContext context) {
            RootDeploymentDescriptor currentBundle = DOLUtils.getCurrentBundleForContext(context);
            if (currentBundle != null) { // it can be null for non-JavaEE type of application deployment. e.g., issue 15869
                Collection<PersistenceUnitsDescriptor> pusDescriptorForThisBundle = currentBundle.getExtensionsDescriptors(PersistenceUnitsDescriptor.class);
                for (PersistenceUnitsDescriptor persistenceUnitsDescriptor : pusDescriptorForThisBundle) {
                        for (PersistenceUnitDescriptor pud : persistenceUnitsDescriptor.getPersistenceUnitDescriptors()) {
                            visitPUD(pud, context);
                        }
                }
View Full Code Here

TOP

Related Classes of org.glassfish.deployment.common.RootDeploymentDescriptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.