Search in sources :

Example 6 with Descriptor

use of org.glassfish.deployment.common.Descriptor in project Payara by payara.

the class DeploymentDescriptorNode method addPrefixMapping.

/**
 * notify of a new prefix mapping used in this document
 */
public void addPrefixMapping(String prefix, String uri) {
    Object o = getDescriptor();
    if (o instanceof Descriptor) {
        Descriptor descriptor = (Descriptor) o;
        descriptor.addPrefixMapping(prefix, uri);
    }
}
Also used : Descriptor(org.glassfish.deployment.common.Descriptor)

Example 7 with Descriptor

use of org.glassfish.deployment.common.Descriptor in project Payara by payara.

the class EjbReferenceNode method writeDescriptor.

@Override
public Node writeDescriptor(Node parent, String nodeName, EjbReference descriptor) {
    Node ejbRefNode = appendChild(parent, nodeName);
    if (descriptor instanceof Descriptor) {
        Descriptor ejbRefDesc = (Descriptor) descriptor;
        writeLocalizedDescriptions(ejbRefNode, ejbRefDesc);
    }
    appendTextChild(ejbRefNode, TagNames.EJB_REFERENCE_NAME, descriptor.getName());
    appendTextChild(ejbRefNode, TagNames.EJB_REFERENCE_TYPE, descriptor.getType());
    if (descriptor.isLocal()) {
        appendTextChild(ejbRefNode, TagNames.LOCAL_HOME, descriptor.getEjbHomeInterface());
        appendTextChild(ejbRefNode, TagNames.LOCAL, descriptor.getEjbInterface());
    } else {
        appendTextChild(ejbRefNode, TagNames.HOME, descriptor.getEjbHomeInterface());
        appendTextChild(ejbRefNode, TagNames.REMOTE, descriptor.getEjbInterface());
    }
    appendTextChild(ejbRefNode, TagNames.EJB_LINK, descriptor.getLinkName());
    if (descriptor instanceof EnvironmentProperty) {
        EnvironmentProperty envProp = (EnvironmentProperty) descriptor;
        appendTextChild(ejbRefNode, TagNames.MAPPED_NAME, envProp.getMappedName());
    }
    if (descriptor.isInjectable()) {
        InjectionTargetNode ijNode = new InjectionTargetNode();
        for (InjectionTarget target : descriptor.getInjectionTargets()) {
            ijNode.writeDescriptor(ejbRefNode, TagNames.INJECTION_TARGET, target);
        }
    }
    if (descriptor.hasLookupName()) {
        appendTextChild(ejbRefNode, TagNames.LOOKUP_NAME, descriptor.getLookupName());
    }
    return ejbRefNode;
}
Also used : Node(org.w3c.dom.Node) EnvironmentProperty(com.sun.enterprise.deployment.EnvironmentProperty) EjbReferenceDescriptor(com.sun.enterprise.deployment.EjbReferenceDescriptor) Descriptor(org.glassfish.deployment.common.Descriptor) InjectionTarget(com.sun.enterprise.deployment.InjectionTarget)

Example 8 with Descriptor

use of org.glassfish.deployment.common.Descriptor in project Payara by payara.

the class MailSessionDeployer method unRegisterMailSessions.

private void unRegisterMailSessions(Descriptor descriptor) {
    if (descriptor instanceof JndiNameEnvironment) {
        JndiNameEnvironment env = (JndiNameEnvironment) descriptor;
        for (Descriptor msd : env.getResourceDescriptors(JavaEEResourceType.MSD)) {
            assert msd instanceof MailSessionDescriptor;
            unRegisterMSDReferredByApplication((MailSessionDescriptor) msd);
        }
    }
    // ejb descriptor
    if (descriptor instanceof EjbBundleDescriptor) {
        EjbBundleDescriptor ejbDesc = (EjbBundleDescriptor) descriptor;
        Set<EjbDescriptor> ejbDescriptors = (Set<EjbDescriptor>) ejbDesc.getEjbs();
        for (EjbDescriptor ejbDescriptor : ejbDescriptors) {
            for (Descriptor msd : ejbDescriptor.getResourceDescriptors(JavaEEResourceType.MSD)) {
                assert msd instanceof MailSessionDescriptor;
                unRegisterMSDReferredByApplication((MailSessionDescriptor) msd);
            }
        }
        // ejb interceptors
        Set<EjbInterceptor> ejbInterceptors = ejbDesc.getInterceptors();
        for (EjbInterceptor ejbInterceptor : ejbInterceptors) {
            for (Descriptor msd : ejbInterceptor.getResourceDescriptors(JavaEEResourceType.MSD)) {
                assert msd instanceof MailSessionDescriptor;
                unRegisterMSDReferredByApplication((MailSessionDescriptor) msd);
            }
        }
    }
    // managed bean descriptors
    if (descriptor instanceof BundleDescriptor) {
        Set<ManagedBeanDescriptor> managedBeanDescriptors = ((BundleDescriptor) descriptor).getManagedBeans();
        for (ManagedBeanDescriptor mbd : managedBeanDescriptors) {
            for (Descriptor msd : mbd.getResourceDescriptors(JavaEEResourceType.MSD)) {
                assert msd instanceof MailSessionDescriptor;
                unRegisterMSDReferredByApplication((MailSessionDescriptor) msd);
            }
        }
    }
}
Also used : RootDeploymentDescriptor(org.glassfish.deployment.common.RootDeploymentDescriptor) Descriptor(org.glassfish.deployment.common.Descriptor)

Example 9 with Descriptor

use of org.glassfish.deployment.common.Descriptor in project Payara by payara.

the class DataSourceDefinitionDeployer method registerDataSourceDefinitions.

public void registerDataSourceDefinitions(com.sun.enterprise.deployment.Application application) {
    String appName = application.getAppName();
    // Register data source definitions defined in application.xml
    registerDataSourceDefinitions(appName, application);
    // Register data source definition defined in web.xml and ejb-jar.xml
    for (BundleDescriptor bundle : application.getBundleDescriptors()) {
        registerDataSourceDefinitions(appName, bundle);
        Collection<RootDeploymentDescriptor> descriptors = bundle.getExtensionsDescriptors();
        if (descriptors != null) {
            for (Descriptor descriptor : descriptors) {
                registerDataSourceDefinitions(appName, descriptor);
            }
        }
    }
}
Also used : BundleDescriptor(com.sun.enterprise.deployment.BundleDescriptor) EjbBundleDescriptor(com.sun.enterprise.deployment.EjbBundleDescriptor) RootDeploymentDescriptor(org.glassfish.deployment.common.RootDeploymentDescriptor) ManagedBeanDescriptor(com.sun.enterprise.deployment.ManagedBeanDescriptor) BundleDescriptor(com.sun.enterprise.deployment.BundleDescriptor) EjbDescriptor(com.sun.enterprise.deployment.EjbDescriptor) DataSourceDefinitionDescriptor(com.sun.enterprise.deployment.DataSourceDefinitionDescriptor) EjbBundleDescriptor(com.sun.enterprise.deployment.EjbBundleDescriptor) RootDeploymentDescriptor(org.glassfish.deployment.common.RootDeploymentDescriptor) Descriptor(org.glassfish.deployment.common.Descriptor)

Example 10 with Descriptor

use of org.glassfish.deployment.common.Descriptor in project Payara by payara.

the class EjbBundleDescriptorImpl method print.

/**
 * Returns a formatted String representing my state.
 */
@Override
public void print(StringBuffer toStringBuffer) {
    toStringBuffer.append("EjbBundleDescriptor\n");
    super.print(toStringBuffer);
    if (cmpResourceReference != null) {
        toStringBuffer.append("\ncmp resource ");
        cmpResourceReference.print(toStringBuffer);
    }
    toStringBuffer.append("\nclient JAR ").append(getEjbClientJarUri());
    for (Descriptor o : getEjbs()) {
        toStringBuffer.append("\n------------\n");
        o.print(toStringBuffer);
        toStringBuffer.append("\n------------");
    }
}
Also used : LifecycleCallbackDescriptor(com.sun.enterprise.deployment.LifecycleCallbackDescriptor) NameValuePairDescriptor(com.sun.enterprise.deployment.NameValuePairDescriptor) PersistenceUnitDescriptor(com.sun.enterprise.deployment.PersistenceUnitDescriptor) ResourceEnvReferenceDescriptor(com.sun.enterprise.deployment.ResourceEnvReferenceDescriptor) Descriptor(org.glassfish.deployment.common.Descriptor) EjbReferenceDescriptor(com.sun.enterprise.deployment.EjbReferenceDescriptor) EntityManagerReferenceDescriptor(com.sun.enterprise.deployment.EntityManagerReferenceDescriptor) ServiceReferenceDescriptor(com.sun.enterprise.deployment.ServiceReferenceDescriptor) IASPersistenceManagerDescriptor(org.glassfish.ejb.deployment.descriptor.runtime.IASPersistenceManagerDescriptor) MessageDestinationReferenceDescriptor(com.sun.enterprise.deployment.MessageDestinationReferenceDescriptor) EntityManagerFactoryReferenceDescriptor(com.sun.enterprise.deployment.EntityManagerFactoryReferenceDescriptor) ResourceReferenceDescriptor(com.sun.enterprise.deployment.ResourceReferenceDescriptor)

Aggregations

Descriptor (org.glassfish.deployment.common.Descriptor)17 EjbDescriptor (com.sun.enterprise.deployment.EjbDescriptor)5 ComponentNameConstructor (com.sun.enterprise.tools.verifier.tests.ComponentNameConstructor)5 Iterator (java.util.Iterator)5 Set (java.util.Set)5 Result (com.sun.enterprise.tools.verifier.Result)4 RootDeploymentDescriptor (org.glassfish.deployment.common.RootDeploymentDescriptor)4 EjbCMPEntityDescriptor (org.glassfish.ejb.deployment.descriptor.EjbCMPEntityDescriptor)4 EjbDescriptor (org.glassfish.ejb.deployment.descriptor.EjbDescriptor)4 EjbBundleDescriptor (com.sun.enterprise.deployment.EjbBundleDescriptor)3 LifecycleCallbackDescriptor (com.sun.enterprise.deployment.LifecycleCallbackDescriptor)3 Field (java.lang.reflect.Field)3 EjbEntityDescriptor (org.glassfish.ejb.deployment.descriptor.EjbEntityDescriptor)3 BundleDescriptor (com.sun.enterprise.deployment.BundleDescriptor)2 EjbInterceptor (com.sun.enterprise.deployment.EjbInterceptor)2 EjbReferenceDescriptor (com.sun.enterprise.deployment.EjbReferenceDescriptor)2 ManagedBeanDescriptor (com.sun.enterprise.deployment.ManagedBeanDescriptor)2 ServiceReferenceDescriptor (com.sun.enterprise.deployment.ServiceReferenceDescriptor)2 VerifierTestContext (com.sun.enterprise.tools.verifier.VerifierTestContext)2 ModuleDescriptor (org.glassfish.deployment.common.ModuleDescriptor)2