package org.skyve.impl.cdi;

import java.util.Map;

import javax.enterprise.inject.Produces;
import javax.inject.Singleton;

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;

@Singleton
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();
	}
}

@@ -38,18 +38,98 @@
 ava.
-util.Map;%0A
+io.Serializable;%0Aimport java.util.Map;%0A%0Aimport javax.enterprise.context.ApplicationScoped;
 %0Aimp
@@ -169,39 +169,8 @@
 ces;
-%0Aimport javax.inject.Singleton;
 %0A%0Aim
@@ -383,17 +383,25 @@
 ;%0A%0A@
-Singleton
+ApplicationScoped
 %0Apub
@@ -427,17 +427,111 @@
 roducer 
-%7B
+implements Serializable %7B%0A%09private static final long serialVersionUID = -2629541397565705456L;%0A
 %0A%09@Produ

Revert SkyveCDIProducer to application scoped and make it Serializable.