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

org.jboss.weld.context.beanstore.ejb.InvocationContextBeanStore Maven / Gradle / Ivy

There is a newer version: 6.0.0.Beta4
Show newest version
package org.jboss.weld.context.beanstore.ejb;

import java.util.Collection;

import javax.interceptor.InvocationContext;

import org.jboss.weld.context.beanstore.AttributeBeanStore;
import org.jboss.weld.context.beanstore.LockStore;
import org.jboss.weld.context.beanstore.NamingScheme;

public class InvocationContextBeanStore extends AttributeBeanStore {

    private final InvocationContext ctx;

    public InvocationContextBeanStore(NamingScheme namingScheme, InvocationContext ctx) {
        super(namingScheme);
        this.ctx = ctx;
    }

    @Override
    protected Object getAttribute(String prefixedId) {
        return ctx.getContextData().get(prefixedId);
    }

    @Override
    protected void removeAttribute(String prefixedId) {
        ctx.getContextData().remove(prefixedId);
    }

    @Override
    protected Collection getAttributeNames() {
        return ctx.getContextData().keySet();
    }

    @Override
    protected void setAttribute(String prefixedId, Object instance) {
        ctx.getContextData().put(prefixedId, instance);
    }

    public LockStore getLockStore() {
        return null;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy