Package org.glassfish.internal.data

Examples of org.glassfish.internal.data.ApplicationInfo$DeploymentFailedListener


        Applications applications = habitat.getService(Applications.class);
        if (applications != null) {
            List<com.sun.enterprise.config.serverbeans.Application> raApps = applications.getApplicationsWithSnifferType(com.sun.enterprise.config.serverbeans.ServerTags.CONNECTOR, true);
            ApplicationRegistry appRegistry = habitat.getService(ApplicationRegistry.class);
            for (com.sun.enterprise.config.serverbeans.Application raApp : raApps) {
                ApplicationInfo appInfo = appRegistry.get(raApp.getName());
                if (isRAConnectionFactory(type, appInfo.getMetaData(Application.class))) {  
                    return true;
                }  
            }
        }
        return false;
View Full Code Here


     * and the WebModule corresponding to that endpoint is stored.
     */
    static WebModule getWebModule(WebServiceEndpoint wsep) {
        ApplicationRegistry appRegistry = org.glassfish.internal.api.Globals.getDefaultHabitat().getComponent(ApplicationRegistry.class);
        String appName = wsep.getBundleDescriptor().getApplication().getAppName();
        ApplicationInfo appInfo = appRegistry.get(appName);

        WebApplication webApp = null;
        if (appInfo != null) {
            Collection<ModuleInfo> moduleInfos = appInfo.getModuleInfos();
            Set<EngineRef> engineRefs = null;
            WebBundleDescriptor requiredWbd = (WebBundleDescriptor) wsep.getBundleDescriptor();
            for (ModuleInfo moduleInfo : moduleInfos) {
                engineRefs = moduleInfo.getEngineRefs();
                for (EngineRef engineRef : engineRefs) {
View Full Code Here

            Transaction t = deployment.prepareAppConfigChanges(deploymentContext);
            if (tracing!=null) {
                tracing.addMark(DeploymentTracing.Mark.DEPLOY);
            }
            ApplicationInfo appInfo;
            appInfo = deployment.deploy(deploymentContext);

            /*
             * Various deployers might have added to the downloadable or
             * generated artifacts.  Extract them and, if the command succeeded,
View Full Code Here

                report.failure(logger, e.getMessage());
                return;
            }
        }

        ApplicationInfo appInfo = deployment.get(appName);
       
        try {
            Application app = applications.getApplication(appName);
            this.name = appName;
View Full Code Here

        OpsParams params = dc.getCommandParameters(OpsParams.class);
        if (params.origin.isUndeploy() && isDas()) {

            boolean hasScopedResource = false;
            String appName = params.name();
            ApplicationInfo appInfo = applicationRegistry.get(appName);
            Application application = appInfo.getMetaData(Application.class);
            Set<BundleDescriptor> bundles = application.getBundleDescriptors();

             // Iterate through all the bundles of the app and collect pu references in referencedPus
             for (BundleDescriptor bundle : bundles) {
                 Collection<? extends PersistenceUnitDescriptor> pusReferencedFromBundle = bundle.findReferencedPUs();
View Full Code Here

            }
        } else if(event.is(Deployment.APPLICATION_DISABLED)) {
            logger.fine("JpaDeployer.event(): APPLICATION_DISABLED");
            // APPLICATION_DISABLED will be generated when an app is disabled/undeployed/appserver goes down.
            //close all the emfs created for this app
            ApplicationInfo appInfo = (ApplicationInfo) event.hook();
            closeEMFs(appInfo);
        }
    }
View Full Code Here

     */
    private void iterateInitializedPUsAtApplicationPrepare(final DeploymentContext context) {

        final DeployCommandParameters deployCommandParameters = context.getCommandParameters(DeployCommandParameters.class);
        String appName = deployCommandParameters.name;
        final ApplicationInfo appInfo = applicationRegistry.get(appName);

        //iterate through all the PersistenceUnitDescriptor for this bundle.
        PersistenceUnitDescriptorIterator pudIterator = new PersistenceUnitDescriptorIterator() {
            @Override void visitPUD(PersistenceUnitDescriptor pud, DeploymentContext context) {
                //PersistenceUnitsDescriptor corresponds to  persistence.xml. A bundle can only have one persitence.xml except
                // when the bundle is an application which can have multiple persitence.xml under jars in root of ear and lib.
                PersistenceUnitLoader puLoader = context.getTransientAppMetaData(getUniquePuIdentifier(pud), PersistenceUnitLoader.class);
                if (puLoader != null) { // We have initialized PU
                    boolean saveEMF = true;
                    if(isDas()) { //We execute Java2DB only on DAS
                        if(deployCommandParameters.origin.isDeploy()) { //APPLICATION_PREPARED will be called for create-application-ref also. We should perform java2db only on first deploy
                            puLoader.doJava2DB();

                            boolean enabled = deployCommandParameters.enabled;
                            boolean isTargetDas = isTargetDas(deployCommandParameters);
                            if(logger.isLoggable(Level.FINER)) {
                                logger.finer("iterateInitializedPUsAtApplicationPrepare(): enabled: " + enabled + " isTargetDas: " + isTargetDas);
                            }
                            if(!isTargetDas || !enabled) {
                                // we are on DAS but target != das or app is not enabled on das => The EMF was just created for Java2Db. Close it.
                                puLoader.getEMF().close();
                                saveEMF = false; // Do not save EMF. We have already closed it
                            }
                        }
                    }

                    if(saveEMF) {
                        // Save emf in ApplicationInfo so that it can be retrieved and closed for cleanup
                        @SuppressWarnings("unchecked") //Suppress warning required as there is no way to pass equivalent of List<EMF>.class to the method
                        List<EntityManagerFactory> emfsCreatedForThisApp = appInfo.getTransientAppMetaData(EMF_KEY, List.class );
                        if(emfsCreatedForThisApp == null) {
                            //First EMF for this app, initialize
                            emfsCreatedForThisApp = new ArrayList<EntityManagerFactory>();
                            appInfo.addTransientAppMetaData(EMF_KEY, emfsCreatedForThisApp);
                        }
                        emfsCreatedForThisApp.add(puLoader.getEMF());
                    } // if (saveEMF)
                } // if(puLoader != null)
            }
View Full Code Here

     * @return the list of deployment descriptor maps
     *
     */
    public List<Map<String, String>> getDeploymentConfigurations(final String appName)
    {
        final ApplicationInfo appInfo = appRegistry.get(appName);

        final List<Map<String, String>> resultList = new ArrayList<Map<String, String>>();
        if (appInfo == null)
        {
            return resultList;
        }
        try
        {
            if (appInfo.getEngineRefs().size() > 0)
            {
                // composite archive case, i.e. ear
                for (EngineRef ref : appInfo.getEngineRefs())
                {
                    Sniffer appSniffer = ref.getContainerInfo().getSniffer();
                    addToResultDDList("", appSniffer.getDeploymentConfigurations(appInfo.getSource()), resultList);
                }

                for (ModuleInfo moduleInfo : appInfo.getModuleInfos())
                {
                    for (Sniffer moduleSniffer : moduleInfo.getSniffers())
                    {
                        ReadableArchive moduleArchive = appInfo.getSource().getSubArchive(moduleInfo.getName());
                        addToResultDDList(moduleInfo.getName(), moduleSniffer.getDeploymentConfigurations(moduleArchive), resultList);
                    }
                }
            }
            else
            {
                // standalone module
                for (Sniffer sniffer : appInfo.getSniffers())
                {
                    addToResultDDList(appName, sniffer.getDeploymentConfigurations(appInfo.getSource()), resultList);
                }
            }
        }
        catch ( final IOException e)
        {
View Full Code Here

    public Map<String, String> getSubComponentsOfModule(
        String applicationName, String moduleName) {
        ApplicationRegistry appRegistry = mHabitat.getComponent(
            ApplicationRegistry.class);

        ApplicationInfo appInfo = appRegistry.get(applicationName);
        if (appInfo != null) {
            Application app = appInfo.getMetaData(Application.class);
            if (app != null) {
                BundleDescriptor bundleDesc = app.getModuleByUri(moduleName);
                if (bundleDesc != null) {
                    return getModuleLevelComponents(bundleDesc);
                }
View Full Code Here

     */
    public String getContextRoot(String applicationName, String moduleName) {
        ApplicationRegistry appRegistry = mHabitat.getComponent(
            ApplicationRegistry.class);

        ApplicationInfo appInfo = appRegistry.get(applicationName);
        if (appInfo != null) {
            Application app = appInfo.getMetaData(Application.class);
            if (app != null) {
                BundleDescriptor bundleDesc = app.getModuleByUri(moduleName);
                if (bundleDesc != null &&
                    bundleDesc instanceof WebBundleDescriptor) {
                    return ((WebBundleDescriptor)bundleDesc).getContextRoot();
View Full Code Here

TOP

Related Classes of org.glassfish.internal.data.ApplicationInfo$DeploymentFailedListener

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.