You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Martin Funk <ma...@gmail.com> on 2014/03/06 17:33:04 UTC
What is the meaning of: javax.ejb.Stateless;
Hi again,
still at a very early stage of conquering the domain of TomEE+.
I have a question on javax.ejb.Stateless. In the specs I read that in the area of SOAP based web services, which are implemented by an EJB component the class implementing the endpoint must be annotated @Stateless or @Singleton.
I got curious on what would happen if the class was annotated @Statless even though the instances were not 'Stateless'
Exceptions were expected, but non were thrown.
Code Service:
package de.jaxws.soap.ejb;
import javax.ejb.Stateless;
import javax.jws.WebService;
@WebService
@Stateless
public class SoapEjb {
private int i;
public String helloEJB() {
return "helloEJB again :" + i++;
}
}
Code Client (supporting Classes were generated using wsimport):
package de.jaxws.soap.client;
import de.jaxws.soap.client.SoapEjb;
import de.jaxws.soap.client.SoapEjbService;
public class Client {
public static void main(String[] args) {
SoapEjbService service = new SoapEjbService();
SoapEjb port = service.getPort(SoapEjb.class);
for (int i = 0; i < 10; i++) {
System.out.println(port.helloEJB());
}
}
}
Output of Client:
helloEJB again :0
helloEJB again :1
helloEJB again :2
helloEJB again :3
helloEJB again :4
helloEJB again :5
helloEJB again :6
helloEJB again :7
helloEJB again :8
helloEJB again :9
Could someone please give me a hint on what I'm misunderstanding?
Cheers,
Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: What is the meaning of: javax.ejb.Stateless;
Posted by Martin Funk <ma...@gmail.com>.
skip this wrong mailing list:
Am 06.03.2014 um 17:33 schrieb Martin Funk <ma...@gmail.com>:
> Hi again,
>
> still at a very early stage of conquering the domain of TomEE+.
>
> I have a question on javax.ejb.Stateless. In the specs I read that in the area of SOAP based web services, which are implemented by an EJB component the class implementing the endpoint must be annotated @Stateless or @Singleton.
>
> I got curious on what would happen if the class was annotated @Statless even though the instances were not 'Stateless'
> Exceptions were expected, but non were thrown.
>
> Code Service:
> package de.jaxws.soap.ejb;
>
> import javax.ejb.Stateless;
> import javax.jws.WebService;
>
> @WebService
> @Stateless
> public class SoapEjb {
>
> private int i;
>
> public String helloEJB() {
> return "helloEJB again :" + i++;
> }
> }
>
> Code Client (supporting Classes were generated using wsimport):
> package de.jaxws.soap.client;
>
>
> import de.jaxws.soap.client.SoapEjb;
> import de.jaxws.soap.client.SoapEjbService;
>
> public class Client {
>
> public static void main(String[] args) {
>
> SoapEjbService service = new SoapEjbService();
> SoapEjb port = service.getPort(SoapEjb.class);
> for (int i = 0; i < 10; i++) {
> System.out.println(port.helloEJB());
> }
> }
>
> }
>
> Output of Client:
> helloEJB again :0
> helloEJB again :1
> helloEJB again :2
> helloEJB again :3
> helloEJB again :4
> helloEJB again :5
> helloEJB again :6
> helloEJB again :7
> helloEJB again :8
> helloEJB again :9
>
> Could someone please give me a hint on what I'm misunderstanding?
>
> Cheers,
>
> Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: What is the meaning of: javax.ejb.Stateless;
Posted by Martin Grigorov <mg...@apache.org>.
Wrong mailing list ? :)
Martin Grigorov
Wicket Training and Consulting
On Thu, Mar 6, 2014 at 6:33 PM, Martin Funk <ma...@gmail.com> wrote:
> Hi again,
>
> still at a very early stage of conquering the domain of TomEE+.
>
> I have a question on javax.ejb.Stateless. In the specs I read that in the
> area of SOAP based web services, which are implemented by an EJB component
> the class implementing the endpoint must be annotated @Stateless or
> @Singleton.
>
> I got curious on what would happen if the class was annotated @Statless
> even though the instances were not 'Stateless'
> Exceptions were expected, but non were thrown.
>
> Code Service:
> package de.jaxws.soap.ejb;
>
> import javax.ejb.Stateless;
> import javax.jws.WebService;
>
> @WebService
> @Stateless
> public class SoapEjb {
>
> private int i;
>
> public String helloEJB() {
> return "helloEJB again :" + i++;
> }
> }
>
> Code Client (supporting Classes were generated using wsimport):
> package de.jaxws.soap.client;
>
>
> import de.jaxws.soap.client.SoapEjb;
> import de.jaxws.soap.client.SoapEjbService;
>
> public class Client {
>
> public static void main(String[] args) {
>
> SoapEjbService service = new SoapEjbService();
> SoapEjb port = service.getPort(SoapEjb.class);
> for (int i = 0; i < 10; i++) {
> System.out.println(port.helloEJB());
> }
> }
>
> }
>
> Output of Client:
> helloEJB again :0
> helloEJB again :1
> helloEJB again :2
> helloEJB again :3
> helloEJB again :4
> helloEJB again :5
> helloEJB again :6
> helloEJB again :7
> helloEJB again :8
> helloEJB again :9
>
> Could someone please give me a hint on what I'm misunderstanding?
>
> Cheers,
>
> Martin
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>