package org.skyve.impl.cdi;

import java.util.Map;

import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Produces;

import org.skyve.addin.AddInManager;
import org.skyve.metadata.customer.Customer;
import org.skyve.metadata.repository.Repository;
import org.skyve.metadata.user.User;
import org.skyve.persistence.Persistence;

@ApplicationScoped
public class SkyveCDIProducer {
	@Produces
	public static Persistence getPersistence() {
		return new PersistenceInjectable();
	}

	@Produces
	public static User getUser() {
		return new UserInjectable();
	}

	@Produces
	public static Customer getCustomer() {
		return new CustomerInjectable();
	}

	@Produces
	public static Map<String, Object> getStash() {
		return new StashInjectable();
	}
	
	@Produces
	public static Repository getRepository() {
		return new RepositoryInjectable();
	}
	
	@Produces
	public static AddInManager getAddInManager() {
		return new AddInManagerInjectable();
	}
}

@@ -73,74 +73,54 @@
 ise.
-context.ApplicationScoped;%0Aimport javax.enterprise.inject.Produces
+inject.Produces;%0Aimport javax.inject.Singleton
 ;%0A%0Ai
@@ -334,25 +334,17 @@
 ;%0A%0A@
-ApplicationScoped
+Singleton
 %0Apub

Make SkyveCDIProducer @Singleton instead of @ApplicationScoped