Search in sources :

Example 16 with InjectionTarget

use of com.sun.enterprise.deployment.InjectionTarget in project Payara by payara.

the class EjbDescriptor method addEjbReferenceDescriptor.

/**
 * Adds a reference to another ejb to me.
 * @param ejbReference
 */
@Override
public final void addEjbReferenceDescriptor(EjbReference ejbReference) {
    try {
        EjbReference existing = getEjbReference(ejbReference.getName());
        for (InjectionTarget next : ejbReference.getInjectionTargets()) {
            existing.addInjectionTarget(next);
        }
    } catch (IllegalArgumentException e) {
        if (env != null)
            env.addEjbReferenceDescriptor(ejbReference);
        else
            ejbReferences.add(ejbReference);
        ejbReference.setReferringBundleDescriptor(getEjbBundleDescriptor());
    }
}
Also used : EjbReference(com.sun.enterprise.deployment.types.EjbReference) InjectionTarget(com.sun.enterprise.deployment.InjectionTarget)

Example 17 with InjectionTarget

use of com.sun.enterprise.deployment.InjectionTarget in project Payara by payara.

the class EjbDescriptor method addResourceEnvReferenceDescriptor.

@Override
public final void addResourceEnvReferenceDescriptor(ResourceEnvReferenceDescriptor resourceEnvReference) {
    try {
        ResourceEnvReferenceDescriptor existing = getResourceEnvReferenceByName(resourceEnvReference.getName());
        for (InjectionTarget next : resourceEnvReference.getInjectionTargets()) {
            existing.addInjectionTarget(next);
        }
    } catch (IllegalArgumentException e) {
        if (env != null)
            env.addResourceEnvReferenceDescriptor(resourceEnvReference);
        else
            resourceEnvReferences.add(resourceEnvReference);
    }
}
Also used : ResourceEnvReferenceDescriptor(com.sun.enterprise.deployment.ResourceEnvReferenceDescriptor) InjectionTarget(com.sun.enterprise.deployment.InjectionTarget)

Example 18 with InjectionTarget

use of com.sun.enterprise.deployment.InjectionTarget in project Payara by payara.

the class EjbDescriptor method addResourceReferenceDescriptor.

/**
 * Adds a resource reference to me.
 * @param resourceReference
 */
@Override
public final void addResourceReferenceDescriptor(ResourceReferenceDescriptor resourceReference) {
    try {
        ResourceReferenceDescriptor existing = getResourceReferenceByName(resourceReference.getName());
        for (InjectionTarget next : resourceReference.getInjectionTargets()) {
            existing.addInjectionTarget(next);
        }
    } catch (IllegalArgumentException e) {
        if (env != null)
            env.addResourceReferenceDescriptor(resourceReference);
        else
            resourceReferences.add(resourceReference);
    }
}
Also used : InjectionTarget(com.sun.enterprise.deployment.InjectionTarget) ResourceReferenceDescriptor(com.sun.enterprise.deployment.ResourceReferenceDescriptor)

Example 19 with InjectionTarget

use of com.sun.enterprise.deployment.InjectionTarget in project Payara by payara.

the class EjbDescriptor method addMessageDestinationReferenceDescriptor.

@Override
public final void addMessageDestinationReferenceDescriptor(MessageDestinationReferenceDescriptor messageDestRef) {
    try {
        MessageDestinationReferenceDescriptor existing = getMessageDestinationReferenceByName(messageDestRef.getName());
        for (InjectionTarget next : messageDestRef.getInjectionTargets()) {
            existing.addInjectionTarget(next);
        }
    } catch (IllegalArgumentException e) {
        if (env != null)
            env.addMessageDestinationReferenceDescriptor(messageDestRef);
        else
            messageDestReferences.add(messageDestRef);
        if (getEjbBundleDescriptor() != null) {
            messageDestRef.setReferringBundleDescriptor(getEjbBundleDescriptor());
        }
    }
}
Also used : MessageDestinationReferenceDescriptor(com.sun.enterprise.deployment.MessageDestinationReferenceDescriptor) InjectionTarget(com.sun.enterprise.deployment.InjectionTarget)

Example 20 with InjectionTarget

use of com.sun.enterprise.deployment.InjectionTarget in project Payara by payara.

the class EjbDescriptor method addServiceReferenceDescriptor.

@Override
public final void addServiceReferenceDescriptor(ServiceReferenceDescriptor serviceRef) {
    try {
        ServiceReferenceDescriptor existing = this.getServiceReferenceByName(serviceRef.getName());
        for (InjectionTarget next : serviceRef.getInjectionTargets()) {
            existing.addInjectionTarget(next);
        }
    } catch (IllegalArgumentException e) {
        if (env != null)
            env.addServiceReferenceDescriptor(serviceRef);
        else
            serviceReferences.add(serviceRef);
        serviceRef.setBundleDescriptor(getEjbBundleDescriptor());
    }
}
Also used : ServiceReferenceDescriptor(com.sun.enterprise.deployment.ServiceReferenceDescriptor) InjectionTarget(com.sun.enterprise.deployment.InjectionTarget)

Aggregations

InjectionTarget (com.sun.enterprise.deployment.InjectionTarget)24 Node (org.w3c.dom.Node)8 Field (java.lang.reflect.Field)6 Method (java.lang.reflect.Method)6 EntityManagerReferenceDescriptor (com.sun.enterprise.deployment.EntityManagerReferenceDescriptor)3 InjectionException (com.sun.enterprise.container.common.spi.util.InjectionException)2 EjbReferenceDescriptor (com.sun.enterprise.deployment.EjbReferenceDescriptor)2 EntityManagerFactoryReferenceDescriptor (com.sun.enterprise.deployment.EntityManagerFactoryReferenceDescriptor)2 InjectionCapable (com.sun.enterprise.deployment.InjectionCapable)2 ResourceReferenceDescriptor (com.sun.enterprise.deployment.ResourceReferenceDescriptor)2 EjbReference (com.sun.enterprise.deployment.types.EjbReference)2 Result (com.sun.enterprise.tools.verifier.Result)2 InjectionManager (com.sun.enterprise.container.common.spi.util.InjectionManager)1 EjbDescriptor (com.sun.enterprise.deployment.EjbDescriptor)1 EjbSessionDescriptor (com.sun.enterprise.deployment.EjbSessionDescriptor)1 EnvironmentProperty (com.sun.enterprise.deployment.EnvironmentProperty)1 MessageDestinationReferenceDescriptor (com.sun.enterprise.deployment.MessageDestinationReferenceDescriptor)1 ResourceEnvReferenceDescriptor (com.sun.enterprise.deployment.ResourceEnvReferenceDescriptor)1 ServiceRefPortInfo (com.sun.enterprise.deployment.ServiceRefPortInfo)1 ServiceReferenceDescriptor (com.sun.enterprise.deployment.ServiceReferenceDescriptor)1