Created
June 10, 2015 21:16
-
-
Save banterCZ/8c9b3c972d65fa4659f6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.enterprise.context.SessionScoped; | |
import java.io.Serializable; | |
import java.util.concurrent.atomic.AtomicInteger; | |
@SessionScoped | |
public class Counter implements Serializable { | |
private AtomicInteger count = new AtomicInteger(0); | |
public void increase() { | |
count.addAndGet(1); | |
} | |
public Integer getCount() { | |
return count.get(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.inject.Inject; | |
import javax.jws.WebService; | |
@WebService(serviceName = "CounterWS", endpointInterface = "cz.zvestov.ws.CounterWS") | |
public class CounterWSImpl implements CounterWS { | |
@Inject | |
private Counter counter; | |
@Override | |
public void increase() { | |
counter.increase(); | |
} | |
@Override | |
public Integer getCount() { | |
return counter.getCount(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment