use of org.glassfish.api.deployment.OpsParams in project Payara by payara.
the class EjbDeployer method generateArtifacts.
/**
* Use this method to generate any ejb-related artifacts for the module
*/
@Override
protected void generateArtifacts(DeploymentContext dc) throws DeploymentException {
OpsParams params = dc.getCommandParameters(OpsParams.class);
if (!(params.origin.isDeploy() && isDas())) {
// Generate artifacts only when being deployed on DAS
return;
}
EjbBundleDescriptorImpl bundle = dc.getModuleMetaData(EjbBundleDescriptorImpl.class);
DeployCommandParameters dcp = dc.getCommandParameters(DeployCommandParameters.class);
boolean generateRmicStubs = dcp.generatermistubs;
dc.addTransientAppMetaData(CMPDeployer.MODULE_CLASSPATH, getModuleClassPath(dc));
if (generateRmicStubs) {
StaticRmiStubGenerator staticStubGenerator = new StaticRmiStubGenerator(habitat);
try {
staticStubGenerator.ejbc(dc);
} catch (Exception e) {
throw new DeploymentException("Static RMI-IIOP Stub Generation exception for " + dc.getSourceDir(), e);
}
}
if (bundle == null || !bundle.containsCMPEntity()) {
// bundle WAS null in a war file where we do not support CMPs
return;
}
initCMPDeployer();
if (cmpDeployer == null) {
throw new DeploymentException("No CMP Deployer is available to deploy this module");
}
cmpDeployer.deploy(dc);
}
use of org.glassfish.api.deployment.OpsParams in project Payara by payara.
the class OSGiDeployer method prepare.
public boolean prepare(DeploymentContext context) {
File file = context.getSourceDir();
OpsParams params = context.getCommandParameters(OpsParams.class);
if (params.origin.isDeploy()) {
assert (file.isDirectory());
installBundle(makeBundleLocation(file));
}
return true;
}
use of org.glassfish.api.deployment.OpsParams in project Payara by payara.
the class OSGiDeployer method clean.
public void clean(DeploymentContext context) {
try {
OpsParams params = context.getCommandParameters(OpsParams.class);
// we should clean for both undeployment and the failed deployment
if (params.origin.isUndeploy() || params.origin.isDeploy()) {
Bundle bundle = getApplicationBundle(context);
bundle.uninstall();
getPA().refreshPackages(new Bundle[] { bundle });
System.out.println("Uninstalled " + bundle);
}
} catch (BundleException e) {
throw new RuntimeException(e);
}
}
Aggregations