import org.springframework.beans.TestBean;
import org.springframework.scripting.TestBeanAwareMessenger;

public class MyMessenger implements TestBeanAwareMessenger {

	private String message;

	private TestBean testBean;

	private boolean active;

	public void init() {
		active = true;
	}

	public String getMessage() {
		if (!active && message != null) throw new java.lang.IllegalStateException();
		return message;
	}

	public void setMessage(String aMessage) {
		message = aMessage;
	}

	public TestBean getTestBean() {
		return testBean;
	}

	public void setTestBean(TestBean tb) {
		testBean = tb;
	}

	public void destroy() {
		message = null;
		active = false;
	}

}
