Search in sources :

Example 1 with StaticRmiStubGenerator

use of com.sun.ejb.codegen.StaticRmiStubGenerator 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)

Aggregations

StaticRmiStubGenerator (com.sun.ejb.codegen.StaticRmiStubGenerator)1 IASSecurityException (com.sun.enterprise.security.util.IASSecurityException)1 DeployCommandParameters (org.glassfish.api.deployment.DeployCommandParameters)1 OpsParams (org.glassfish.api.deployment.OpsParams)1 DeploymentException (org.glassfish.deployment.common.DeploymentException)1 EjbBundleDescriptorImpl (org.glassfish.ejb.deployment.descriptor.EjbBundleDescriptorImpl)1