Bean:
@Stateless
@Name(DataStoreImpl.COMPONENT_NAME)
@Scope(ScopeType.STATELESS)
public class DataStoreImpl implements DataStoreLocal{
public static final String COMPONENT_NAME = "dataStoreImpl";
@EJB
protected Test test;
public String getData() {
// using test
}
}
Local business interface:@Local
public interface DataStoreLocal {
public String getData();
}
Call:DataStoreLocal data = (DataStoreLocal) Component.getInstance(
DataStoreImpl.COMPONENT_NAME, true);
No comments:
Post a Comment