I know this may seem elementary, but I'm interested in the following singleton bean:
@Startup @Singleton @LocalBean public class MyServiceBean { public String sayHello() { return "Hello"; } }
Now I think that โremoteโ clients may need to use this bean, so I want to add a remote interface to this bean:
@Remote public interface MyService { String sayHello(); }
Can I just make my bean implemented a new remote interface?
If "MyServiceBean" implements the remote interface "MyService", it will become a bean with a "remote view" ... but after I searched the Internet, you all said that the bean with the annotation "LocalBean" is a "view without interface "
Could this work? or should I create a local interface and remove the LocalBean annotation?
deeper thoughts ... if "remote-view", "local-view" and "no-interface-view" are 3 types of views that can exist in one bean ....? can i have a bean that implements all of them?
@Local @Remote @LocalBean public class Possible implements PosLoca, PosRemote {}
.... I'm really confused ...
source share