All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jboss.cdi.tck.tests.extensions.beanManager.CowBean Maven / Gradle / Ivy

There is a newer version: 2.0.5.SP1
Show newest version
package org.jboss.cdi.tck.tests.extensions.beanManager;

import java.io.Serializable;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

import javax.enterprise.context.Dependent;
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.InjectionPoint;
import javax.enterprise.inject.spi.PassivationCapable;

import org.jboss.cdi.tck.literals.DefaultLiteral;

public class CowBean implements Bean, PassivationCapable, Serializable {
    private static final long serialVersionUID = 6249623250272328272L;
    public static final String PASSIVATION_ID = "Cow-6249623250272328272L";
    private final Set qualifiers = new HashSet(Arrays.asList(new DefaultLiteral()));
    private final Set types = new HashSet(Arrays. asList(Cow.class));

    public Class getBeanClass() {
        return Cow.class;
    }

    public Set getInjectionPoints() {
        return Collections.emptySet();
    }

    public String getName() {
        return "cow";
    }

    public Set getQualifiers() {
        return qualifiers;
    }

    public Class getScope() {
        return Dependent.class;
    }

    public Set> getStereotypes() {
        return Collections.emptySet();
    }

    public Set getTypes() {
        return types;
    }

    public boolean isAlternative() {
        return false;
    }

    public boolean isNullable() {
        return false;
    }

    public Cow create(CreationalContext creationalContext) {
        return new Cow("Betsy");
    }

    public void destroy(Cow instance, CreationalContext creationalContext) {
    }

    public String getId() {
        return PASSIVATION_ID;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy