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

com.oneandone.ejbcdiunit.camunda.CdiUnitContextAssociationManager Maven / Gradle / Ivy

Go to download

A module that can be used together with cdiunit to build en ejb-test-environment.

The newest version!
package com.oneandone.ejbcdiunit.camunda;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Alternative;
import javax.ws.rs.Produces;

import org.camunda.bpm.engine.cdi.impl.context.DefaultContextAssociationManager;

/**
 * @author aschoerk
 */
@ApplicationScoped
@Alternative
public class CdiUnitContextAssociationManager extends DefaultContextAssociationManager {

    private static final long serialVersionUID = -1456230354054346930L;

    @Produces
    ApplicationScopedAssociation createApplicationScopedAssociation() {
        return new ApplicationScopedAssociation();
    }

    protected List> getAvailableScopedAssociationClasses() {
        ArrayList> scopeTypes = new ArrayList>();
        scopeTypes.add(ConversationScopedAssociation.class);
        scopeTypes.add(RequestScopedAssociation.class);
        scopeTypes.add(ApplicationScopedAssociation.class);
        return scopeTypes;
    }

    @ApplicationScoped
    public static class ApplicationScopedAssociation extends ScopedAssociation implements Serializable {
        private static final long serialVersionUID = 3924846638712987532L;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy