Search in sources :

Example 1 with ConnectionDefinition

use of javax.resource.spi.ConnectionDefinition in project Payara by payara.

the class ConnectionDefinitionHandler method processAnnotation.

public HandlerProcessingResult processAnnotation(AnnotationInfo element) throws AnnotationProcessorException {
    AnnotatedElementHandler aeHandler = element.getProcessingContext().getHandler();
    ConnectionDefinition connDefn = (ConnectionDefinition) element.getAnnotation();
    if (aeHandler instanceof RarBundleContext) {
        handleAnnotation(aeHandler, connDefn, element);
    } else {
        getFailureResult(element, "not a rar bundle context", true);
    }
    return getDefaultProcessedResult();
}
Also used : ConnectionDefinition(javax.resource.spi.ConnectionDefinition) RarBundleContext(com.sun.enterprise.deployment.annotation.context.RarBundleContext)

Example 2 with ConnectionDefinition

use of javax.resource.spi.ConnectionDefinition in project Payara by payara.

the class ConnectionDefinitionsHandler method processAnnotation.

public HandlerProcessingResult processAnnotation(AnnotationInfo element) throws AnnotationProcessorException {
    AnnotatedElementHandler aeHandler = element.getProcessingContext().getHandler();
    ConnectionDefinitions connDefns = (ConnectionDefinitions) element.getAnnotation();
    if (aeHandler instanceof RarBundleContext) {
        // TODO V3 what if there is @ConnectionDefiniton as well @ConnectionDefinitions specified on same class ?
        // TODO V3 should we detect & avoid duplicates here ?
        ConnectionDefinition[] definitions = connDefns.value();
        if (definitions != null) {
            for (ConnectionDefinition defn : definitions) {
                ConnectionDefinitionHandler cdh = new ConnectionDefinitionHandler();
                cdh.processAnnotation(element, defn);
            }
        }
    } else {
        getFailureResult(element, "not a rar bundle context", true);
    }
    return getDefaultProcessedResult();
}
Also used : ConnectionDefinition(javax.resource.spi.ConnectionDefinition) ConnectionDefinitions(javax.resource.spi.ConnectionDefinitions) RarBundleContext(com.sun.enterprise.deployment.annotation.context.RarBundleContext)

Aggregations

RarBundleContext (com.sun.enterprise.deployment.annotation.context.RarBundleContext)2 ConnectionDefinition (javax.resource.spi.ConnectionDefinition)2 ConnectionDefinitions (javax.resource.spi.ConnectionDefinitions)1