-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
55eb074
commit 447cf7f
Showing
15 changed files
with
203 additions
and
66 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package sos.ejb; | ||
|
||
import java.util.LinkedHashMap; | ||
import javax.ejb.Remote; | ||
import javax.ejb.Stateful; | ||
|
||
@Stateful | ||
@Remote(ViewCounter.class) | ||
public class ViewCountSessionBean implements ViewCounter { | ||
|
||
private LinkedHashMap<String, Integer> counts = new LinkedHashMap<>(); | ||
|
||
public void plusOne(String itemNo) { | ||
if (counts.get(itemNo) == null) | ||
counts.put(itemNo, 1); | ||
else | ||
counts.put(itemNo, counts.get(itemNo) + 1); | ||
} | ||
|
||
public int getCount(String itemNo) { | ||
return counts.get(itemNo); | ||
} | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package sos.ejb; | ||
|
||
public interface ViewCounter { | ||
|
||
void plusOne(String itemNo); | ||
|
||
int getCount(String itemNo); | ||
|
||
} |
Oops, something went wrong.