Skip to content

Commit

Permalink
Remove db4o cache and corresponding jars.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.code.sf.net/p/subsonic/code/trunk@2784 104adb81-38d2-4886-885e-82898e39ce25
  • Loading branch information
sindremehus committed Mar 6, 2012
1 parent e778576 commit c26d29a
Show file tree
Hide file tree
Showing 10 changed files with 1 addition and 289 deletions.
Binary file not shown.
Binary file removed repo/com/db4o/db4o-all/8.0.224/db4o-all-8.0.224.jar
Binary file not shown.
6 changes: 0 additions & 6 deletions repo/com/db4o/db4o-all/8.0.224/db4o-all-8.0.224.pom

This file was deleted.

1 change: 0 additions & 1 deletion subsonic-main/TODO.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ TODO IN 4.7
Elevation broken.
Try with ProcessBuilder builder = new ProcessBuilder(new String[] { "cmd.exe", "/C", fileToExecute });
Use proper IDs in rest api.
Remove cache and corresponding jars.
Why are there two instances of subsonic-service.exe?
Make it work with 64-bit Java 7. Problem with exe4j?
Add REST method to get user details, including avatar.
Expand Down
6 changes: 0 additions & 6 deletions subsonic-main/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,6 @@
<version>1.0</version>
</dependency>

<dependency>
<groupId>com.db4o</groupId>
<artifactId>db4o-all</artifactId>
<version>8.0.224</version>
</dependency>

<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
package net.sourceforge.subsonic.ajax;

import net.sourceforge.subsonic.Logger;
import net.sourceforge.subsonic.domain.Cache;
import net.sourceforge.subsonic.service.SecurityService;
import net.sourceforge.subsonic.util.BoundedList;
import org.apache.commons.lang.StringUtils;
Expand Down Expand Up @@ -50,26 +49,15 @@ public class ChatService {
private static final int MAX_MESSAGES = 10;
private static final long TTL_MILLIS = 3L * 24L * 60L * 60L * 1000L; // 3 days.

private LinkedList<Message> messages;
private final LinkedList<Message> messages = new BoundedList<Message>(MAX_MESSAGES);
private SecurityService securityService;
private Cache chatCache;

private long revision = System.identityHashCode(this);

/**
* Invoked by Spring.
*/
public void init() {
try {
messages = chatCache.getValue(CACHE_KEY);
if (messages == null) {
messages = new BoundedList<Message>(MAX_MESSAGES);
}
} catch (Exception x) {
LOG.warn("Failed to re-create chat messages.", x);
messages = new BoundedList<Message>(MAX_MESSAGES);
}

// Delete old messages every hour.
ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
Runnable runnable = new Runnable() {
Expand Down Expand Up @@ -102,14 +90,12 @@ public synchronized void doAddMessage(String message, HttpServletRequest request
message = StringUtils.trimToNull(message);
if (message != null && user != null) {
messages.addFirst(new Message(message, user, new Date()));
chatCache.put(CACHE_KEY, messages);
revision++;
}
}

public synchronized void clearMessages() {
messages.clear();
chatCache.put(CACHE_KEY, messages);
revision++;
}

Expand All @@ -128,10 +114,6 @@ public void setSecurityService(SecurityService securityService) {
this.securityService = securityService;
}

public void setChatCache(Cache chatCache) {
this.chatCache = chatCache;
}

public static class Messages implements Serializable {

private static final long serialVersionUID = -752602719879818165L;
Expand Down
163 changes: 0 additions & 163 deletions subsonic-main/src/main/java/net/sourceforge/subsonic/dao/CacheDao.java

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,4 @@
<constructor-arg value="musicFileMemoryCache"/>
</bean>

<bean id="chatCache" class="net.sourceforge.subsonic.domain.Cache">
<constructor-arg value="Chat messages"/>
<constructor-arg value="1"/>
<constructor-arg ref="cacheDao"/>
</bean>

</beans>
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@
<property name="daoHelper" ref="daoHelper"/>
</bean>

<bean id="cacheDao" class="net.sourceforge.subsonic.dao.CacheDao"/>

<bean id="daoHelper" class="net.sourceforge.subsonic.dao.DaoHelper"/>


Expand Down Expand Up @@ -208,7 +206,6 @@

<bean id="ajaxChatService" class="net.sourceforge.subsonic.ajax.ChatService" init-method="init">
<property name="securityService" ref="securityService"/>
<property name="chatCache" ref="chatCache"/>
</bean>

</beans>

0 comments on commit c26d29a

Please sign in to comment.