~piastucki/bzr-eclipse/execute-bit

« back to all changes in this revision

Viewing changes to org.vcs.bazaar.eclipse.core/src/org/vcs/bazaar/eclipse/core/log/LogCacheManager.java

  • Committer: Guillermo Gonzalez
  • Date: 2010-02-02 06:40:31 UTC
  • mfrom: (219 trunk)
  • mto: This revision was merged to the branch mainline in revision 223.
  • Revision ID: guillo.gonzo@gmail.com-20100202064031-r0hch2h8bq67y1sx
merge with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
         * Returns the last log of the given resource. If is not present in
53
53
         * cache, it will be retrieved using the actual strategy. 
54
54
         * 
55
 
         * @param resource
56
 
         *            whose last log is required.
 
55
         * @param resource whose last log is required.
57
56
         * @throws CoreException
58
57
         */
59
58
        public IBazaarLogMessage getLastLog(IResource resource) throws CoreException {
65
64
         * Returns the logs of the given resource. If is not present in
66
65
         * cache, it will be retrieved using the actual strategy. 
67
66
         * 
68
 
         * @param resource
69
 
         *            whose last log is required.
 
67
         * @param resource whose last log is required.
70
68
         * @return a List<IBazaarLogMessage> for the corresponding resource 
71
69
         * (the size is dependent on the limit setup in the preferences)
72
70
         * @throws CoreException
77
75
 
78
76
        /**
79
77
         * see {@link #getLogs(IResource)}
80
 
         * @param resource
81
 
         * @return
82
 
         * @throws CoreException
83
78
         */
84
79
        public List<IBazaarLogMessage> getLogs(IBzrResource resource) throws CoreException {
85
80
                return getLogs(resource, logUpdater, getLock(resource));
103
98
                try {
104
99
                        acquired = lock.acquire(3000L);
105
100
                        // TODO: for the moment the cache don't detect when it need a refresh.
106
 
                        // so I leave this without the cahce.
 
101
                        // so I leave this without the cache.
107
102
//                      logs = logCache.get(resource);
108
103
                        if (logs == null || logs.size() == 0) {
109
104
                                if(resource instanceof IBzrResource) {
124
119
 
125
120
        /**
126
121
         * refresh the cache and returns if the resource is in it.
127
 
         * 
128
 
         * @param resource
129
 
         * @param strategy
130
 
         * @return
131
 
         * @throws CoreException
132
122
         */
133
123
        private List<IBazaarLogMessage> basicGetLog(IBzrResource resource, LogUpdater strategy) throws CoreException {
134
124
                EclipseBazaarCore.trace(ITracingOptions.LOG_CACHE, "LogCacheManager.basicGetlog: " + resource.getName());
148
138
 
149
139
        /**
150
140
         * Purge the cache of the spacified IProject from the cache
151
 
         * 
152
 
         * @param root
153
 
         * @param deep
154
 
         * @throws CoreException
155
141
         */
156
142
        public void purgeCache(IProject root) throws CoreException {
157
143
                logCache.purgeCache(root);
174
160
                        }
175
161
                }
176
162
        }
177
 
 
178
163
}