Package org.glassfish.internal.data

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


                    Collection docs = null;
                    if(endpoint.getWebService().hasWsdlFile()) {

                        WebServiceContractImpl wscImpl = WebServiceContractImpl.getInstance();
                        ApplicationRegistry appRegistry = wscImpl.getApplicationRegistry();
                        ApplicationInfo appInfo = appRegistry.get(endpoint.getBundleDescriptor().getApplication().getRegistrationName());
                        URI deployedDir =appInfo.getSource().getURI();

                        URL pkgedWsdl;
                        if(deployedDir != null) {
                            if(endpoint.getBundleDescriptor().getApplication().isVirtual()) {
                                pkgedWsdl = deployedDir.resolve(endpoint.getWebService().getWsdlFileUri()).toURL();
View Full Code Here


                    Collection docs = null;
                    if(endpoint.getWebService().hasWsdlFile()) {

                        WebServiceContractImpl wscImpl = WebServiceContractImpl.getInstance();
                        ApplicationRegistry appRegistry = wscImpl.getApplicationRegistry();
                        ApplicationInfo appInfo = appRegistry.get(endpoint.getBundleDescriptor().getApplication().getRegistrationName());
                        URI deployedDir =appInfo.getSource().getURI();

                        URL pkgedWsdl;
                        if(deployedDir != null) {
                            if(endpoint.getBundleDescriptor().getApplication().isVirtual()) {
                                pkgedWsdl = deployedDir.resolve(endpoint.getWebService().getWsdlFileUri()).toURL();
View Full Code Here

    private Vector getEjbDescriptors(Application application, ApplicationRegistry appsRegistry) {
        Vector ejbDescriptors = new Vector();

        if(ResourcesUtil.createInstance().isEnabled(application)){
            ApplicationInfo appInfo = appsRegistry.get(application.getName());
            if(appInfo != null){
                com.sun.enterprise.deployment.Application app =
                        appInfo.getMetaData(com.sun.enterprise.deployment.Application.class);
                Set<BundleDescriptor> descriptors = app.getBundleDescriptors();
                for (BundleDescriptor descriptor : descriptors) {
                    if (descriptor instanceof EjbBundleDescriptor) {
                        EjbBundleDescriptor ejbBundleDescriptor = (EjbBundleDescriptor) descriptor;
                        Set<? extends EjbDescriptor> ejbDescriptorsSet = ejbBundleDescriptor.getEjbs();
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 do validation and 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

                            //Create EM to trigger validation on PU
                            EntityManagerFactory emf = puLoader.getEMF();
                            EntityManager em = null;
                            try {
                                // Create EM to trigger any validations that are lazily performed by the provider
                                // EM creation also triggers DDL generation by provider.
                                em = emf.createEntityManager();
                            } catch (PersistenceException e) {
                                // Exception indicates something went wrong while performing validation. Clean up and rethrow to fail deployment
                                emf.close();
                                throw e;
                            } finally {
                                if (em != null) {
                                    em.close();
                                }
                            }

                            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

    }

    public void event(Event event) {
       
         if (event.is(Deployment.APPLICATION_LOADED) ) {
             ApplicationInfo info =  Deployment.APPLICATION_LOADED.getHook(event);

             loadManagedBeans(info);

             registerAppLevelDependencies(info);

         } else if( event.is(Deployment.APPLICATION_UNLOADED) ) {
            
             ApplicationInfo info =  Deployment.APPLICATION_UNLOADED.getHook(event);
             Application app = info.getMetaData(Application.class);

             doCleanup(app);

         } else if( event.is(Deployment.DEPLOYMENT_FAILURE) ) {
View Full Code Here

     */
    private JMSDestinationDefinitionDescriptor getJMSDestination(String logicalDestination) {
        Domain domain = Globals.get(Domain.class);
        Applications applications = domain.getApplications();
        for (com.sun.enterprise.config.serverbeans.Application app : applications.getApplications()) {
            ApplicationInfo appInfo = appRegistry.get(app.getName());
            if (appInfo != null) {
                Application application = appInfo.getMetaData(Application.class);
                JMSDestinationDefinitionDescriptor destination = getJMSDestination(logicalDestination, application);
                if (isValidDestination(destination)) {
                    return destination;
                }
            }
View Full Code Here

        Object[] params = (Object[])info;
        String appName = (String)params[0];

        ServiceLocator habitat = Globals.getDefaultHabitat();
        ApplicationRegistry reg = habitat.getService(ApplicationRegistry.class);
        ApplicationInfo appInfo = reg.get(appName);
        Application app = appInfo.getMetaData(Application.class);

        EjbDescriptor desc = app.getEjbByName((String)params[1]);

        return habitat.<EjbContainerUtil>getService(EjbContainerUtil.class).getContainer(desc.getUniqueId());
    }
View Full Code Here

        final MetadataImpl meta = new MetadataImpl();
        meta.setCorrespondingRef(ref.objectName());
       
        final String appName = ref.getName();
       
        final ApplicationInfo appInfo = appRegistry.get(appName);
        if (appInfo == null)
        {
            ImplUtil.getLogger().fine("Unable to get ApplicationInfo for application: " + appName);
            return null;
        }
        final Application app = appInfo.getMetaData(Application.class);
        if ( app == null )
        {
            if ( appInfo.isJavaEEApp() )
            {
                ImplUtil.getLogger().warning("Null from ApplicationInfo.getMetadata(Application.class) for application " + appName );
            }
            return null;
        }
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.