001
014
015 package com.liferay.counter.model;
016
017 import com.liferay.portal.kernel.concurrent.CompeteLatch;
018
019
024 public class CounterRegister {
025
026 public CounterRegister(
027 String name, CounterHolder counterHolder, int rangeSize) {
028
029 _name = name;
030 _rangeSize = rangeSize;
031 _counterHolder = counterHolder;
032 _competeLatch = new CompeteLatch();
033 }
034
035 public CounterRegister(
036 String name, long rangeMin, long rangeMax, int rangeSize) {
037
038 this(name, new CounterHolder(rangeMin, rangeMax), rangeSize);
039 }
040
041 public CompeteLatch getCompeteLatch() {
042 return _competeLatch;
043 }
044
045 public CounterHolder getCounterHolder() {
046 return _counterHolder;
047 }
048
049 public String getName() {
050 return _name;
051 }
052
053 public int getRangeSize() {
054 return _rangeSize;
055 }
056
057 public void setCounterHolder(CounterHolder holder) {
058 _counterHolder = holder;
059 }
060
061 public void setName(String name) {
062 _name = name;
063 }
064
065 private final CompeteLatch _competeLatch;
066 private volatile CounterHolder _counterHolder;
067 private String _name;
068 private final int _rangeSize;
069
070 }