/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package fr.hhdev.test.dataservices;

import fr.hhdev.ocelot.Constants;
import fr.hhdev.ocelot.OcelotServices;
import fr.hhdev.ocelot.annotations.DataService;
import javax.annotation.PostConstruct;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import javax.inject.Inject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 *
 * @author hhfrancois
 */
@Stateless
@LocalBean
@DataService(resolver = Constants.Resolver.EJB)
public class EJBDataService implements GetValue {
	private static final Logger logger = LoggerFactory.getLogger(EJBDataService.class);

	private double d;

	@Inject
	private OcelotServices ocelotServices;

	@PostConstruct
	protected void init() {
		d = Math.random();
	}

	@Override
	public double getValue() {
		return d;
	}

	public String getLocaleHello(String who) {
		return ocelotServices.getLocalizedMessage("test", "HELLOGUY", new Object[]{who});
	}

	@Override
	public void setValue(double d) {
		this.d = d;
	}
}

@@ -346,16 +346,97 @@
 rvice;%0D%0A
+import fr.hhdev.ocelot.annotations.JsCacheRemove;%0D%0Aimport fr.hhdev.test.Result;%0D%0A
 import j
@@ -1272,11 +1272,188 @@
 d;%0D%0A%09%7D%0D%0A
+%09%0D%0A%09@JsCacheRemove(cls = EJBDataService.class , methodName = %22getLocaleHello%22, keys = %7B%22a%22,%22r.integer%22%7D)%0D%0A%09public void generateCleanCacheMessage(String a, Result r) %7B%0D%0A%09%09%0D%0A%09%7D %0D%0A
 %7D%0D%0A

add test remove cache message