Search in sources :

Example 6 with Application

use of com.sun.enterprise.deployment.Application in project Payara by payara.

the class JavaEEDeployer method clean.

/**
 * Clean any files and artifacts that were created during the execution
 * of the prepare method.
 *
 * @param context deployment context
 */
public void clean(DeploymentContext context) {
    if (undeploymentVisitor != null) {
        String appName = context.getCommandParameters(OpsParams.class).name();
        Application app = getApplicationFromApplicationInfo(appName);
        if (app != null) {
            context.addModuleMetaData(app);
            undeploymentVisitor.accept(app);
        }
    }
}
Also used : Application(com.sun.enterprise.deployment.Application)

Example 7 with Application

use of com.sun.enterprise.deployment.Application in project Payara by payara.

the class ActiveJmsResourceAdapter method getJMSDestination.

/*
     * Get JMS destination resource from deployed applications
     */
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;
            }
        }
    }
    return null;
}
Also used : Applications(com.sun.enterprise.config.serverbeans.Applications) JMSDestinationDefinitionDescriptor(com.sun.enterprise.deployment.JMSDestinationDefinitionDescriptor) ApplicationInfo(org.glassfish.internal.data.ApplicationInfo) Domain(com.sun.enterprise.config.serverbeans.Domain) Application(com.sun.enterprise.deployment.Application)

Example 8 with Application

use of com.sun.enterprise.deployment.Application in project Payara by payara.

the class AppClientGroupFacadeGenerator method generateGroupFacade.

private void generateGroupFacade() {
    final Application application = dc.getModuleMetaData(Application.class);
    final Collection<ModuleDescriptor<BundleDescriptor>> appClients = application.getModuleDescriptorsByType(carType);
    final StringBuilder appClientGroupListSB = new StringBuilder();
    /*
        /*
         * For each app client, get its facade's URI to include in the
         * generated EAR facade's client group listing.
         */
    for (Iterator<ModuleDescriptor<BundleDescriptor>> it = appClients.iterator(); it.hasNext(); ) {
        ModuleDescriptor<BundleDescriptor> md = it.next();
        appClientGroupListSB.append((appClientGroupListSB.length() > 0) ? " " : "").append(earDirUserURIText(dc)).append(appClientFacadeUserURI(md.getArchiveUri()));
    }
    try {
        addTopLevelContentToGroupFacade();
        /*
             * Pass the EAR's generated/xml directory for where to generated the
             * group facade.  Because the directories are flattened, even if the
             * client is actually x/y/z.jar its expanded directory will be just
             * one level lower than the EAR's directory.
             */
        generateAndRecordEARFacadeContents(dc, appClientGroupListSB.toString());
        recordGroupFacadeGeneration();
    } catch (Exception e) {
        throw new DeploymentException(e);
    }
}
Also used : ModuleDescriptor(org.glassfish.deployment.common.ModuleDescriptor) BundleDescriptor(com.sun.enterprise.deployment.BundleDescriptor) DeploymentException(org.glassfish.deployment.common.DeploymentException) Application(com.sun.enterprise.deployment.Application) VersioningSyntaxException(org.glassfish.deployment.versioning.VersioningSyntaxException) DeploymentException(org.glassfish.deployment.common.DeploymentException)

Example 9 with Application

use of com.sun.enterprise.deployment.Application in project Payara by payara.

the class NestedAppClientInfo method getAppClient.

/**
 *Reports which app client embedded in the application archive is the
 *one the user has selected using either the main class or display name
 *arguments from the command line.
 *@return the app client descriptor for the user-selected app client
 */
@Override
protected ApplicationClientDescriptor getAppClient(Archivist archivist) {
    if (selectedAppClientDescriptor != null) {
        return selectedAppClientDescriptor;
    }
    Application app = Application.class.cast(archivist.getDescriptor());
    /*
         *There could be one or more app clients embedded in the enterprise app
         *in the archive.  Choose which one to run based on the user's 
         *command-line input.
         */
    Set<ApplicationClientDescriptor> embeddedAppClients = (Set<ApplicationClientDescriptor>) app.getBundleDescriptors(ApplicationClientDescriptor.class);
    /*
         *Make sure the application module contains at least one app client.
         */
    if (embeddedAppClients.size() == 0) {
        throw new IllegalArgumentException(getLocalString("appclient.noEmbeddedAppClients", "The specified application module does not contain any app clients"));
    }
    /*
         *If there is exactly one app client in the ear, then that's the app
         *client to use.
         */
    if (embeddedAppClients.size() == 1) {
        selectedAppClientDescriptor = useFirstEmbeddedAppClient(embeddedAppClients, mainClassFromCommandLine);
    } else {
        selectedAppClientDescriptor = chooseFromEmbeddedAppClients(embeddedAppClients, mainClassFromCommandLine, displayNameFromCommandLine);
        /*
             *Make sure that we've selected an app client.
             */
        if (selectedAppClientDescriptor == null) {
            if (mainClassFromCommandLine != null) {
                throw new IllegalArgumentException(getLocalString("appclient.noMatchingClientUsingMainClass", "Could not locate an embedded app client matching the main class name {0}", mainClassFromCommandLine));
            } else {
                throw new IllegalArgumentException(getLocalString("appclient.noMatchingClientUsingDisplayName", "Could not locate an embedded app client matching the display name {0}", displayNameFromCommandLine));
            }
        }
    }
    return selectedAppClientDescriptor;
}
Also used : Set(java.util.Set) ApplicationClientDescriptor(com.sun.enterprise.deployment.ApplicationClientDescriptor) Application(com.sun.enterprise.deployment.Application)

Example 10 with Application

use of com.sun.enterprise.deployment.Application in project Payara by payara.

the class ManagedBeanManagerImpl method loadManagedBeans.

private void loadManagedBeans(ApplicationInfo appInfo) {
    Application app = appInfo.getMetaData(Application.class);
    if (app == null) {
        return;
    }
    loadManagedBeans(app);
}
Also used : Application(com.sun.enterprise.deployment.Application)

Aggregations

Application (com.sun.enterprise.deployment.Application)66 BundleDescriptor (com.sun.enterprise.deployment.BundleDescriptor)17 WebBundleDescriptor (com.sun.enterprise.deployment.WebBundleDescriptor)10 DeployCommandParameters (org.glassfish.api.deployment.DeployCommandParameters)10 ApplicationInfo (org.glassfish.internal.data.ApplicationInfo)10 IOException (java.io.IOException)9 File (java.io.File)8 ModuleDescriptor (org.glassfish.deployment.common.ModuleDescriptor)8 EjbBundleDescriptor (com.sun.enterprise.deployment.EjbBundleDescriptor)7 ReadableArchive (org.glassfish.api.deployment.archive.ReadableArchive)7 EjbDescriptor (com.sun.enterprise.deployment.EjbDescriptor)5 DeploymentException (org.glassfish.deployment.common.DeploymentException)5 SAXParseException (org.xml.sax.SAXParseException)5 ApplicationClientDescriptor (com.sun.enterprise.deployment.ApplicationClientDescriptor)4 ArrayList (java.util.ArrayList)4 WebappClassLoader (org.glassfish.web.loader.WebappClassLoader)4 OpsParams (org.glassfish.api.deployment.OpsParams)3 EjbBundleDescriptorImpl (org.glassfish.ejb.deployment.descriptor.EjbBundleDescriptorImpl)3 Applications (com.sun.enterprise.config.serverbeans.Applications)2 WebComponentDescriptor (com.sun.enterprise.deployment.WebComponentDescriptor)2