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);
}
}
}
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;
}
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);
}
}
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;
}
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);
}
Aggregations