Search in sources :

Example 11 with OpsParams

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);
}
Also used : DeployCommandParameters(org.glassfish.api.deployment.DeployCommandParameters) OpsParams(org.glassfish.api.deployment.OpsParams) DeploymentException(org.glassfish.deployment.common.DeploymentException) StaticRmiStubGenerator(com.sun.ejb.codegen.StaticRmiStubGenerator) DeploymentException(org.glassfish.deployment.common.DeploymentException) IASSecurityException(com.sun.enterprise.security.util.IASSecurityException) EjbBundleDescriptorImpl(org.glassfish.ejb.deployment.descriptor.EjbBundleDescriptorImpl)

Example 12 with OpsParams

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;
}
Also used : OpsParams(org.glassfish.api.deployment.OpsParams) File(java.io.File)

Example 13 with OpsParams

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);
    }
}
Also used : OpsParams(org.glassfish.api.deployment.OpsParams) Bundle(org.osgi.framework.Bundle) BundleException(org.osgi.framework.BundleException)

Aggregations

OpsParams (org.glassfish.api.deployment.OpsParams)13 IASSecurityException (com.sun.enterprise.security.util.IASSecurityException)4 DeploymentException (org.glassfish.deployment.common.DeploymentException)4 Application (com.sun.enterprise.deployment.Application)3 Properties (java.util.Properties)3 DeployCommandParameters (org.glassfish.api.deployment.DeployCommandParameters)3 EjbBundleDescriptorImpl (org.glassfish.ejb.deployment.descriptor.EjbBundleDescriptorImpl)3 ApplicationInfo (org.glassfish.internal.data.ApplicationInfo)3 ArrayList (java.util.ArrayList)2 List (java.util.List)2 DeploymentProperties (org.glassfish.deployment.common.DeploymentProperties)2 ExtendedDeploymentContext (org.glassfish.internal.deployment.ExtendedDeploymentContext)2 Container (com.sun.ejb.Container)1 StaticRmiStubGenerator (com.sun.ejb.codegen.StaticRmiStubGenerator)1 AbstractSingletonContainer (com.sun.ejb.containers.AbstractSingletonContainer)1 EJBTimerService (com.sun.ejb.containers.EJBTimerService)1 WebBundleDescriptor (com.sun.enterprise.deployment.WebBundleDescriptor)1 File (java.io.File)1 ApplicationContainer (org.glassfish.api.deployment.ApplicationContainer)1 DeploymentContext (org.glassfish.api.deployment.DeploymentContext)1