[jboss-cvs] JBossAS SVN: r65339 - in projects/ejb3/trunk/ejb3-cache: src/main/java/org/jboss/ejb3/cache and 6 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Sep 12 12:21:48 EDT 2007
Author: wolfc
Date: 2007-09-12 12:21:48 -0400 (Wed, 12 Sep 2007)
New Revision: 65339
Added:
projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/grouped/
projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/grouped/GroupedPassivatingCache.java
projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/grouped/PassivationGroup.java
projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/impl/GroupedPassivatingCacheImpl.java
projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/impl/PassivationGroupContainer.java
projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/impl/PassivationGroupImpl.java
projects/ejb3/trunk/ejb3-cache/src/test/java/org/jboss/ejb3/test/grouped/
projects/ejb3/trunk/ejb3-cache/src/test/java/org/jboss/ejb3/test/grouped/GroupedPassivatingUnitTestCache.java
projects/ejb3/trunk/ejb3-cache/src/test/java/org/jboss/ejb3/test/grouped/MockBeanContainer.java
projects/ejb3/trunk/ejb3-cache/src/test/java/org/jboss/ejb3/test/grouped/MockBeanContext.java
Removed:
projects/ejb3/trunk/ejb3-cache/src/test/java/org/jboss/ejb3/test/xpc/
Modified:
projects/ejb3/trunk/ejb3-cache/.classpath
projects/ejb3/trunk/ejb3-cache/pom.xml
projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/PassivatingCache.java
projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/impl/EntryStateCache.java
projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/impl/FileObjectStore.java
projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/impl/SimplePassivatingCache.java
projects/ejb3/trunk/ejb3-cache/src/test/java/org/jboss/ejb3/test/passivation/PassivationUnitTestCase.java
projects/ejb3/trunk/ejb3-cache/src/test/resources/log4j.xml
Log:
Working PassivationGroup.
Modified: projects/ejb3/trunk/ejb3-cache/.classpath
===================================================================
--- projects/ejb3/trunk/ejb3-cache/.classpath 2007-09-12 16:06:48 UTC (rev 65338)
+++ projects/ejb3/trunk/ejb3-cache/.classpath 2007-09-12 16:21:48 UTC (rev 65339)
@@ -4,18 +4,18 @@
<classpathentry kind="src" path="src/test/resources" output="target/test-classes" excluding="**/*.java"/>
<classpathentry kind="output" path="target/classes"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14.jar" sourcepath="M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/jboss/jboss-common-logging-log4j/2.0.4.GA/jboss-common-logging-log4j-2.0.4.GA.jar" sourcepath="M2_REPO/jboss/jboss-common-logging-log4j/2.0.4.GA/jboss-common-logging-log4j-2.0.4.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/jboss/jboss-common-core/2.0.4.GA/jboss-common-core-2.0.4.GA.jar" sourcepath="M2_REPO/jboss/jboss-common-core/2.0.4.GA/jboss-common-core-2.0.4.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/jboss/jboss-transaction-api/1.0.1-SNAPSHOT/jboss-transaction-api-1.0.1-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/apache-slide/webdavlib/2.0/webdavlib-2.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO/trove/trove/2.1.1/trove-2.1.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/jboss/jboss-serialization/1.0.3.GA/jboss-serialization-1.0.3.GA.jar"/>
<classpathentry kind="var" path="M2_REPO/apache-xerces/xml-apis/2.7.1/xml-apis-2.7.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/jboss/jboss-serialization/1.0.3.GA/jboss-serialization-1.0.3.GA.jar"/>
+ <classpathentry kind="var" path="M2_REPO/jboss/jbossws/jboss-jaxrpc/1.0.4.GA/jboss-jaxrpc-1.0.4.GA.jar"/>
<classpathentry kind="var" path="M2_REPO/jboss/jboss-common-logging-spi/2.0.4.GA/jboss-common-logging-spi-2.0.4.GA.jar" sourcepath="M2_REPO/jboss/jboss-common-logging-spi/2.0.4.GA/jboss-common-logging-spi-2.0.4.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar" sourcepath="M2_REPO/junit/junit/3.8.1/junit-3.8.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/oswego-concurrent/concurrent/1.3.4/concurrent-1.3.4.jar"/>
- <classpathentry kind="var" path="M2_REPO/trove/trove/2.1.1/trove-2.1.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/apache-slide/webdavlib/2.0/webdavlib-2.0.jar"/>
<classpathentry kind="var" path="M2_REPO/apache-httpclient/commons-httpclient/2.0.2/commons-httpclient-2.0.2.jar"/>
- <classpathentry kind="var" path="M2_REPO/jboss/jboss-common-core/2.0.4.GA/jboss-common-core-2.0.4.GA.jar" sourcepath="M2_REPO/jboss/jboss-common-core/2.0.4.GA/jboss-common-core-2.0.4.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/jboss/jbossws/jboss-jaxrpc/1.0.4.GA/jboss-jaxrpc-1.0.4.GA.jar"/>
<classpathentry kind="var" path="M2_REPO/jboss/jboss-ejb-api/3.0.0-SNAPSHOT/jboss-ejb-api-3.0.0-SNAPSHOT.jar"/>
- <classpathentry kind="var" path="M2_REPO/jboss/jboss-transaction-api/1.0.1-SNAPSHOT/jboss-transaction-api-1.0.1-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14.jar" sourcepath="M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/jboss/jboss-common-logging-log4j/2.0.4.GA/jboss-common-logging-log4j-2.0.4.GA.jar" sourcepath="M2_REPO/jboss/jboss-common-logging-log4j/2.0.4.GA/jboss-common-logging-log4j-2.0.4.GA-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar" sourcepath="M2_REPO/junit/junit/3.8.1/junit-3.8.1-sources.jar"/>
</classpath>
\ No newline at end of file
Modified: projects/ejb3/trunk/ejb3-cache/pom.xml
===================================================================
--- projects/ejb3/trunk/ejb3-cache/pom.xml 2007-09-12 16:06:48 UTC (rev 65338)
+++ projects/ejb3/trunk/ejb3-cache/pom.xml 2007-09-12 16:21:48 UTC (rev 65339)
@@ -43,6 +43,11 @@
<dependencies>
<dependency>
<groupId>jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ <version>2.0.4.GA</version>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
<artifactId>jboss-common-logging-spi</artifactId>
<version>2.0.4.GA</version>
</dependency>
Modified: projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/PassivatingCache.java
===================================================================
--- projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/PassivatingCache.java 2007-09-12 16:06:48 UTC (rev 65338)
+++ projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/PassivatingCache.java 2007-09-12 16:21:48 UTC (rev 65339)
@@ -33,5 +33,10 @@
*/
public interface PassivatingCache<T extends Identifiable> extends Cache<T>
{
-
+ /**
+ * Force passivation of an object. The object must not be in use.
+ *
+ * @param key the identifier of the object
+ */
+ void passivate(Object key);
}
Added: projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/grouped/GroupedPassivatingCache.java
===================================================================
--- projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/grouped/GroupedPassivatingCache.java (rev 0)
+++ projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/grouped/GroupedPassivatingCache.java 2007-09-12 16:21:48 UTC (rev 65339)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.cache.grouped;
+
+import org.jboss.ejb3.cache.Identifiable;
+import org.jboss.ejb3.cache.PassivatingCache;
+
+/**
+ * Allows objects to the members of a PassivationGroup.
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public interface GroupedPassivatingCache<T extends Identifiable> extends PassivatingCache<T>
+{
+ void setGroup(T obj, PassivationGroup group);
+}
Property changes on: projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/grouped/GroupedPassivatingCache.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Added: projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/grouped/PassivationGroup.java
===================================================================
--- projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/grouped/PassivationGroup.java (rev 0)
+++ projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/grouped/PassivationGroup.java 2007-09-12 16:21:48 UTC (rev 65339)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.cache.grouped;
+
+import java.io.Serializable;
+
+import org.jboss.ejb3.cache.Identifiable;
+
+/**
+ * Defines a group of passivatable objects which must be passivated in
+ * one unit of work.
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public interface PassivationGroup extends Identifiable, Serializable
+{
+}
Property changes on: projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/grouped/PassivationGroup.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/impl/EntryStateCache.java
===================================================================
--- projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/impl/EntryStateCache.java 2007-09-12 16:06:48 UTC (rev 65338)
+++ projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/impl/EntryStateCache.java 2007-09-12 16:21:48 UTC (rev 65339)
@@ -26,8 +26,8 @@
import javax.ejb.NoSuchEJBException;
+import org.jboss.ejb3.cache.Cache;
import org.jboss.ejb3.cache.Identifiable;
-import org.jboss.ejb3.cache.PassivatingCache;
import org.jboss.ejb3.cache.StatefulObjectFactory;
/**
@@ -36,7 +36,7 @@
* @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
* @version $Revision: $
*/
-public class EntryStateCache<T extends Identifiable> implements PassivatingCache<T>
+public class EntryStateCache<T extends Identifiable> implements Cache<T>
{
private StatefulObjectFactory<T> factory;
private Map<Object, Entry> cache;
Modified: projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/impl/FileObjectStore.java
===================================================================
--- projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/impl/FileObjectStore.java 2007-09-12 16:06:48 UTC (rev 65338)
+++ projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/impl/FileObjectStore.java 2007-09-12 16:21:48 UTC (rev 65339)
@@ -167,6 +167,7 @@
if(!file.exists())
return null;
+ log.debug("loading state from " + file);
try
{
FileInputStream fis = FISAction.open(file);
Added: projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/impl/GroupedPassivatingCacheImpl.java
===================================================================
--- projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/impl/GroupedPassivatingCacheImpl.java (rev 0)
+++ projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/impl/GroupedPassivatingCacheImpl.java 2007-09-12 16:21:48 UTC (rev 65339)
@@ -0,0 +1,245 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.cache.impl;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.ejb.NoSuchEJBException;
+
+import org.jboss.ejb3.cache.Identifiable;
+import org.jboss.ejb3.cache.ObjectStore;
+import org.jboss.ejb3.cache.PassivatingCache;
+import org.jboss.ejb3.cache.PassivationManager;
+import org.jboss.ejb3.cache.StatefulObjectFactory;
+import org.jboss.ejb3.cache.grouped.GroupedPassivatingCache;
+import org.jboss.ejb3.cache.grouped.PassivationGroup;
+import org.jboss.logging.Logger;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class GroupedPassivatingCacheImpl<T extends Identifiable & Serializable> implements GroupedPassivatingCache<T>
+{
+ private static final Logger log = Logger.getLogger(GroupedPassivatingCacheImpl.class);
+
+ private PassivatingCache<PassivationGroup> groupCache;
+
+ private SimplePassivatingCache<Entry> delegate;
+ private Map<Object, Entry> storage = new HashMap<Object, Entry>();
+
+ protected class Entry implements Identifiable, Serializable
+ {
+ private static final long serialVersionUID = 1L;
+
+ Object id;
+ T obj;
+ PassivationGroupImpl group;
+ Object groupId;
+
+ Entry(T obj)
+ {
+ assert obj != null : "obj is null";
+
+ this.obj = obj;
+ this.id = obj.getId();
+ }
+
+ public Object getId()
+ {
+ return id;
+ }
+
+ void passivate()
+ {
+ // make sure we don't passivate the group twice
+ group = null;
+
+ delegate.passivate(this.id);
+
+ obj = null;
+ }
+
+ @Override
+ public String toString()
+ {
+ return super.toString() + "{id=" + id + ",obj=" + obj + ",groupId=" + groupId + ",group=" + group + "}";
+ }
+ }
+
+ private class EntryContainer implements StatefulObjectFactory<Entry>, PassivationManager<Entry>, ObjectStore<Entry>
+ {
+ private StatefulObjectFactory<T> factory;
+ private PassivationManager<T> passivationManager;
+ private ObjectStore<T> store;
+
+ EntryContainer(StatefulObjectFactory<T> factory, PassivationManager<T> passivationManager, ObjectStore<T> store)
+ {
+ this.factory = factory;
+ this.passivationManager = passivationManager;
+ this.store = store;
+ }
+
+ public Entry create(Class<?>[] initTypes, Object[] initValues)
+ {
+ return new Entry(factory.create(initTypes, initValues));
+ }
+
+ public void destroy(Entry entry)
+ {
+ factory.destroy(entry.obj);
+ }
+
+ public Entry load(Object key)
+ {
+ Entry entry = storage.get(key);
+ if(entry != null)
+ {
+ log.trace("entry = " + entry);
+ return entry;
+ }
+ // This only happens when there is no group
+ T obj = store.load(key);
+ if(obj == null)
+ return null;
+ return new Entry(obj);
+ }
+
+ @SuppressWarnings("unchecked")
+ public void postActivate(Entry entry)
+ {
+ log.trace("post activate " + entry);
+ if(entry.obj == null)
+ {
+ if(entry.group == null)
+ {
+ // TODO: peek or get?
+ entry.group = (PassivationGroupImpl) groupCache.peek(entry.groupId);
+ }
+ entry.obj = (T) entry.group.getMember(entry.id);
+ }
+ passivationManager.postActivate(entry.obj);
+ }
+
+ public void prePassivate(Entry entry)
+ {
+ log.trace("pre passivate " + entry);
+ passivationManager.prePassivate(entry.obj);
+ // Am I being called recursively
+ if(entry.group != null)
+ {
+ entry.group.removeActive(entry.id);
+ entry.group.prePassivate();
+ groupCache.passivate(entry.groupId);
+ // Why clear? Because entry is removed from active, and thus passivate is never called.
+ entry.group = null;
+ entry.obj = null;
+ }
+ }
+
+ public void store(Entry entry)
+ {
+ log.trace("store " + entry);
+ if(entry.groupId == null)
+ store.store(entry.obj);
+ else
+ storage.put(entry.id, entry);
+ }
+ }
+
+ public GroupedPassivatingCacheImpl(StatefulObjectFactory<T> factory, PassivationManager<T> passivationManager, ObjectStore<T> store, PassivatingCache<PassivationGroup> groupCache)
+ {
+ assert groupCache != null : "groupCache is null";
+ assert passivationManager != null : "passivationManager is null";
+
+ this.groupCache = groupCache;
+ EntryContainer container = new EntryContainer(factory, passivationManager, store);
+ this.delegate = new SimplePassivatingCache<Entry>(container, container, container);
+ }
+
+ public void passivate(Object key)
+ {
+ delegate.passivate(key);
+ }
+
+ public T create(Class<?>[] initTypes, Object[] initValues)
+ {
+ return delegate.create(initTypes, initValues).obj;
+ }
+
+ public T get(Object key) throws NoSuchEJBException
+ {
+ return delegate.get(key).obj;
+ }
+
+ public T peek(Object key) throws NoSuchEJBException
+ {
+ return delegate.peek(key).obj;
+ }
+
+ public void release(T obj)
+ {
+ delegate.releaseByKey(obj.getId());
+ }
+
+ public void remove(Object key)
+ {
+ delegate.remove(key);
+ }
+
+ public void setGroup(T obj, PassivationGroup group)
+ {
+ Entry entry;
+ Object key = obj.getId();
+ entry = delegate.peek(key);
+ if(entry.group != null)
+ throw new IllegalStateException("object " + key + " already associated with a passivation group");
+ entry.group = (PassivationGroupImpl) group;
+ entry.groupId = group.getId();
+ // TODO: remove member at the appropriate time
+ entry.group.addMember(key, entry);
+ }
+
+ public void setName(String name)
+ {
+ delegate.setName(name + "-delegate");
+ }
+
+ public void setSessionTimeout(int sessionTimeout)
+ {
+ delegate.setSessionTimeout(sessionTimeout);
+ }
+
+ public void start()
+ {
+ delegate.start();
+ }
+
+ public void stop()
+ {
+ delegate.stop();
+ }
+}
Property changes on: projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/impl/GroupedPassivatingCacheImpl.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Added: projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/impl/PassivationGroupContainer.java
===================================================================
--- projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/impl/PassivationGroupContainer.java (rev 0)
+++ projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/impl/PassivationGroupContainer.java 2007-09-12 16:21:48 UTC (rev 65339)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.cache.impl;
+
+import org.jboss.ejb3.cache.PassivationManager;
+import org.jboss.ejb3.cache.StatefulObjectFactory;
+import org.jboss.ejb3.cache.grouped.PassivationGroup;
+import org.jboss.logging.Logger;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class PassivationGroupContainer implements StatefulObjectFactory<PassivationGroup>, PassivationManager<PassivationGroup>
+{
+ private static final Logger log = Logger.getLogger(PassivationGroupContainer.class);
+
+ public PassivationGroup create(Class<?>[] initTypes, Object[] initValues)
+ {
+ return new PassivationGroupImpl();
+ }
+
+ public void destroy(PassivationGroup obj)
+ {
+ // TODO: nothing?
+ }
+
+ public void postActivate(PassivationGroup obj)
+ {
+ log.trace("post activate " + obj);
+ ((PassivationGroupImpl) obj).postActivate();
+ }
+
+ public void prePassivate(PassivationGroup obj)
+ {
+ log.trace("pre passivate " + obj);
+ ((PassivationGroupImpl) obj).prePassivate();
+ }
+
+}
Property changes on: projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/impl/PassivationGroupContainer.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Added: projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/impl/PassivationGroupImpl.java
===================================================================
--- projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/impl/PassivationGroupImpl.java (rev 0)
+++ projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/impl/PassivationGroupImpl.java 2007-09-12 16:21:48 UTC (rev 65339)
@@ -0,0 +1,86 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.cache.impl;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.ejb3.cache.grouped.PassivationGroup;
+import org.jboss.logging.Logger;
+import org.jboss.util.id.GUID;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class PassivationGroupImpl implements PassivationGroup
+{
+ private static final Logger log = Logger.getLogger(PassivationGroupImpl.class);
+ private static final long serialVersionUID = 1L;
+
+ private Object id = new GUID();
+ private Map<Object, Object> members = new HashMap<Object, Object>();
+ private transient Map<Object, GroupedPassivatingCacheImpl.Entry> active = new HashMap<Object, GroupedPassivatingCacheImpl.Entry>();
+
+// protected PassivationGroup()
+// {
+//
+// }
+
+ void addMember(Object key, GroupedPassivatingCacheImpl.Entry entry)
+ {
+ log.trace("add member " + key + ", " + entry);
+ members.put(key, entry.obj);
+ active.put(key, entry);
+ }
+
+ public Object getId()
+ {
+ return id;
+ }
+
+ Object getMember(Object key)
+ {
+ return members.get(key);
+ }
+
+ void postActivate()
+ {
+ // do nothing
+ }
+
+ void prePassivate()
+ {
+ for(GroupedPassivatingCacheImpl.Entry entry : active.values())
+ {
+ entry.passivate();
+ }
+ active.clear();
+ }
+
+ void removeActive(Object key)
+ {
+ active.remove(key);
+ }
+}
Property changes on: projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/impl/PassivationGroupImpl.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/impl/SimplePassivatingCache.java
===================================================================
--- projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/impl/SimplePassivatingCache.java 2007-09-12 16:06:48 UTC (rev 65338)
+++ projects/ejb3/trunk/ejb3-cache/src/main/java/org/jboss/ejb3/cache/impl/SimplePassivatingCache.java 2007-09-12 16:21:48 UTC (rev 65339)
@@ -104,7 +104,14 @@
if(then >= entry.lastUsed && entry.state != EntryState.IN_USE)
{
// TODO: can passivate?
- passivationManager.prePassivate(entry.obj);
+ try
+ {
+ passivationManager.prePassivate(entry.obj);
+ }
+ catch(Throwable t)
+ {
+ log.warn("pre passivate failed for " + entry.obj, t);
+ }
store.store(entry.obj);
@@ -164,13 +171,34 @@
if(entry == null)
throw new NoSuchEJBException(String.valueOf(key));
if(entry.state != EntryState.READY)
- throw new IllegalStateException("entry " + entry + " is not ready");
+ throw new IllegalStateException("entry " + key + " is not ready");
entry.state = EntryState.IN_USE;
entry.lastUsed = System.currentTimeMillis();
return entry.obj;
}
}
+ public void passivate(Object key)
+ {
+ log.trace("passivate " + key);
+ synchronized (cache)
+ {
+ Entry entry = cache.get(key);
+
+ if(entry == null)
+ throw new IllegalArgumentException("entry " + key + " not found in cache " + this);
+
+ if(entry.state == EntryState.IN_USE)
+ throw new IllegalStateException("entry " + entry + " is in use");
+
+ passivationManager.prePassivate(entry.obj);
+
+ store.store(entry.obj);
+
+ cache.remove(key);
+ }
+ }
+
public T peek(Object key) throws NoSuchEJBException
{
synchronized (cache)
@@ -185,9 +213,9 @@
entry = new Entry(obj);
cache.put(key, entry);
+ entry.state = EntryState.READY;
}
}
- entry.state = EntryState.READY;
if(entry == null)
throw new NoSuchEJBException(String.valueOf(key));
return entry.obj;
@@ -196,16 +224,23 @@
public void release(T obj)
{
+ releaseByKey(obj.getId());
+ }
+
+ protected void releaseByKey(Object key)
+ {
synchronized (cache)
{
- Entry entry = cache.get(obj.getId());
+ Entry entry = cache.get(key);
+ if(entry == null)
+ throw new IllegalStateException("object " + key + " not from this cache");
if(entry.state != EntryState.IN_USE)
throw new IllegalStateException("entry " + entry + " is not in use");
entry.state = EntryState.READY;
entry.lastUsed = System.currentTimeMillis();
}
}
-
+
public void remove(Object key)
{
Entry entry;
Copied: projects/ejb3/trunk/ejb3-cache/src/test/java/org/jboss/ejb3/test/grouped (from rev 65285, projects/ejb3/trunk/ejb3-cache/src/test/java/org/jboss/ejb3/test/xpc)
Added: projects/ejb3/trunk/ejb3-cache/src/test/java/org/jboss/ejb3/test/grouped/GroupedPassivatingUnitTestCache.java
===================================================================
--- projects/ejb3/trunk/ejb3-cache/src/test/java/org/jboss/ejb3/test/grouped/GroupedPassivatingUnitTestCache.java (rev 0)
+++ projects/ejb3/trunk/ejb3-cache/src/test/java/org/jboss/ejb3/test/grouped/GroupedPassivatingUnitTestCache.java 2007-09-12 16:21:48 UTC (rev 65339)
@@ -0,0 +1,113 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.grouped;
+
+import java.io.Serializable;
+
+import junit.framework.TestCase;
+
+import org.jboss.ejb3.cache.PassivationManager;
+import org.jboss.ejb3.cache.StatefulObjectFactory;
+import org.jboss.ejb3.cache.grouped.PassivationGroup;
+import org.jboss.ejb3.cache.impl.FileObjectStore;
+import org.jboss.ejb3.cache.impl.PassivationGroupContainer;
+import org.jboss.ejb3.cache.impl.SimplePassivatingCache;
+import org.jboss.logging.Logger;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class GroupedPassivatingUnitTestCache extends TestCase
+{
+ private static final Logger log = Logger.getLogger(GroupedPassivatingUnitTestCache.class);
+
+ private static void sleep(long micros)
+ {
+ try
+ {
+ Thread.sleep(micros);
+ }
+ catch (InterruptedException e)
+ {
+ // ignore
+ }
+ }
+
+ public void test1()
+ {
+ PassivationGroupContainer container = new PassivationGroupContainer();
+ StatefulObjectFactory<PassivationGroup> factory = container;
+ PassivationManager<PassivationGroup> passivationManager = container;
+ FileObjectStore<PassivationGroup> store = new FileObjectStore<PassivationGroup>();
+ store.setStorageDirectory("./target/tmp/groups");
+ store.start();
+ SimplePassivatingCache<PassivationGroup> groupCache = new SimplePassivatingCache<PassivationGroup>(factory, passivationManager, store);
+ groupCache.setName("PassivationGroupContainer");
+ groupCache.setSessionTimeout(0);
+ groupCache.start();
+ MockBeanContainer container1 = new MockBeanContainer("MockBeanContainer1", 1, groupCache);
+ MockBeanContainer container2 = new MockBeanContainer("MockBeanContainer2", 10, groupCache);
+
+ Object shared = new Serializable()
+ {
+ private static final long serialVersionUID = 1L;
+ };
+ MockBeanContext firstCtx1;
+ MockBeanContext ctx1 = firstCtx1 = container1.getCache().create(null, null);
+ Object key1 = ctx1.getId();
+ ctx1.shared = shared;
+ MockBeanContext ctx2 = container2.getCache().create(null, null);
+ Object key2 = ctx2.getId();
+ ctx2.shared = shared;
+
+ // TODO: how will passivation groups be created?
+ PassivationGroup group = groupCache.create(null, null);
+ container1.getCache().setGroup(ctx1, group);
+ container2.getCache().setGroup(ctx2, group);
+ // TODO: currently we need to release the group
+ groupCache.release(group);
+
+ container1.getCache().release(ctx1);
+ container2.getCache().release(ctx2);
+
+ sleep(4000);
+
+ assertEquals("ctx1 should have been passivated", 1, container1.passivations);
+ assertEquals("ctx2 should have been passivated", 1, container2.passivations);
+
+ ctx2 = container2.getCache().get(key2);
+
+ log.info("ctx2 = " + ctx2);
+ assertNotNull(ctx2);
+
+ ctx1 = container1.getCache().get(key1);
+
+ log.info("ctx1 = " + ctx1);
+
+ assertTrue("ctx1 must be different than firstCtx1 (else no passivation has taken place)", ctx1 != firstCtx1);
+
+ assertEquals(ctx1.shared, ctx2.shared);
+ }
+}
Property changes on: projects/ejb3/trunk/ejb3-cache/src/test/java/org/jboss/ejb3/test/grouped/GroupedPassivatingUnitTestCache.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Added: projects/ejb3/trunk/ejb3-cache/src/test/java/org/jboss/ejb3/test/grouped/MockBeanContainer.java
===================================================================
--- projects/ejb3/trunk/ejb3-cache/src/test/java/org/jboss/ejb3/test/grouped/MockBeanContainer.java (rev 0)
+++ projects/ejb3/trunk/ejb3-cache/src/test/java/org/jboss/ejb3/test/grouped/MockBeanContainer.java 2007-09-12 16:21:48 UTC (rev 65339)
@@ -0,0 +1,97 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.grouped;
+
+import org.jboss.ejb3.cache.PassivatingCache;
+import org.jboss.ejb3.cache.PassivationManager;
+import org.jboss.ejb3.cache.StatefulObjectFactory;
+import org.jboss.ejb3.cache.grouped.GroupedPassivatingCache;
+import org.jboss.ejb3.cache.grouped.PassivationGroup;
+import org.jboss.ejb3.cache.impl.FileObjectStore;
+import org.jboss.ejb3.cache.impl.GroupedPassivatingCacheImpl;
+import org.jboss.logging.Logger;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class MockBeanContainer implements StatefulObjectFactory<MockBeanContext>, PassivationManager<MockBeanContext>
+{
+ private static final Logger log = Logger.getLogger(MockBeanContainer.class);
+
+ protected int activations = 0;
+ protected int passivations = 0;
+
+ private GroupedPassivatingCache<MockBeanContext> cache;
+
+ public MockBeanContainer(String name, int sessionTimeout, PassivatingCache<PassivationGroup> groupCache)
+ {
+ FileObjectStore<MockBeanContext> store = new FileObjectStore<MockBeanContext>();
+ store.setStorageDirectory("./target/tmp/" + name);
+ store.start();
+ GroupedPassivatingCacheImpl<MockBeanContext> cache = new GroupedPassivatingCacheImpl<MockBeanContext>(this, this, store, groupCache);
+ this.cache = cache;
+ cache.setName(name);
+ cache.setSessionTimeout(sessionTimeout);
+ cache.start();
+ }
+
+ public MockBeanContext create(Class<?>[] initTypes, Object[] initValues)
+ {
+ return new MockBeanContext();
+ }
+
+ public GroupedPassivatingCache<MockBeanContext> getCache()
+ {
+ return cache;
+ }
+
+ public void destroy(MockBeanContext obj)
+ {
+ }
+
+ public void postActivate(MockBeanContext obj)
+ {
+ if(obj == null) throw new IllegalArgumentException("obj is null");
+
+ log.info("postActivate " + obj);
+ activations++;
+ synchronized(this)
+ {
+ notifyAll();
+ }
+ }
+
+ public void prePassivate(MockBeanContext obj)
+ {
+ if(obj == null) throw new IllegalArgumentException("obj is null");
+
+ log.info("prePassivate " + obj);
+ passivations++;
+ synchronized(this)
+ {
+ notifyAll();
+ }
+ }
+}
Property changes on: projects/ejb3/trunk/ejb3-cache/src/test/java/org/jboss/ejb3/test/grouped/MockBeanContainer.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Added: projects/ejb3/trunk/ejb3-cache/src/test/java/org/jboss/ejb3/test/grouped/MockBeanContext.java
===================================================================
--- projects/ejb3/trunk/ejb3-cache/src/test/java/org/jboss/ejb3/test/grouped/MockBeanContext.java (rev 0)
+++ projects/ejb3/trunk/ejb3-cache/src/test/java/org/jboss/ejb3/test/grouped/MockBeanContext.java 2007-09-12 16:21:48 UTC (rev 65339)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.grouped;
+
+import java.io.Serializable;
+
+import org.jboss.ejb3.cache.Identifiable;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class MockBeanContext implements Identifiable, Serializable
+{
+ private static final long serialVersionUID = 1L;
+
+ private static volatile long currentId = 0;
+
+ private long id;
+
+ public Object shared;
+
+ public MockBeanContext()
+ {
+ this.id = ++currentId;
+ }
+
+ public Object getId()
+ {
+ return id;
+ }
+
+ @Override
+ public String toString()
+ {
+ return super.toString() + "{id=" + id + "}";
+ }
+
+}
Property changes on: projects/ejb3/trunk/ejb3-cache/src/test/java/org/jboss/ejb3/test/grouped/MockBeanContext.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: projects/ejb3/trunk/ejb3-cache/src/test/java/org/jboss/ejb3/test/passivation/PassivationUnitTestCase.java
===================================================================
--- projects/ejb3/trunk/ejb3-cache/src/test/java/org/jboss/ejb3/test/passivation/PassivationUnitTestCase.java 2007-09-12 16:06:48 UTC (rev 65338)
+++ projects/ejb3/trunk/ejb3-cache/src/test/java/org/jboss/ejb3/test/passivation/PassivationUnitTestCase.java 2007-09-12 16:21:48 UTC (rev 65339)
@@ -83,6 +83,29 @@
assertEquals("MockBeanContext should have been passivated", 2, container.passivations);
}
+ /**
+ * Peek of an active object should not change it state.
+ */
+ public void testPeekActive()
+ {
+ MockBeanContainer container = new MockBeanContainer();
+ FileObjectStore<MockBeanContext> store = new FileObjectStore<MockBeanContext>();
+ store.setStorageDirectory("./target/tmp/passivation");
+ store.start();
+ SimplePassivatingCache<MockBeanContext> cache = new SimplePassivatingCache<MockBeanContext>(container, container, store);
+ cache.setName("MockBeanContainer");
+ cache.setSessionTimeout(1);
+ cache.start();
+
+ MockBeanContext obj = cache.create(null, null);
+ Object key = obj.getId();
+
+ cache.peek(key);
+
+ cache.release(obj);
+ obj = null;
+ }
+
private static void wait(Object obj) throws InterruptedException
{
synchronized (obj)
Modified: projects/ejb3/trunk/ejb3-cache/src/test/resources/log4j.xml
===================================================================
--- projects/ejb3/trunk/ejb3-cache/src/test/resources/log4j.xml 2007-09-12 16:06:48 UTC (rev 65338)
+++ projects/ejb3/trunk/ejb3-cache/src/test/resources/log4j.xml 2007-09-12 16:21:48 UTC (rev 65339)
@@ -60,7 +60,7 @@
<!-- ============================== -->
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
- <param name="Threshold" value="FATAL"/>
+ <!--param name="Threshold" value="FATAL"/-->
<param name="Target" value="System.out"/>
<layout class="org.apache.log4j.PatternLayout">
@@ -112,11 +112,10 @@
<!-- Limit categories -->
<!-- ================ -->
- <!-- Limit JBoss categories to INFO
+ <!-- Limit JBoss categories to INFO -->
<category name="org.jboss">
<priority value="INFO" class="org.jboss.logging.XLevel"/>
</category>
- -->
<!-- Increase the priority threshold for the DefaultDS category
<category name="DefaultDS">
@@ -147,6 +146,11 @@
<category name="org.jboss.tm">
<priority value="TRACE" class="org.jboss.logging.XLevel"/>
</category>
+
+ <category name="org.jboss.ejb3">
+ <priority value="TRACE" class="org.jboss.logging.XLevel"/>
+ </category>
+
<!-- ======================= -->
<!-- Setup the Root category -->
<!-- ======================= -->
More information about the jboss-cvs-commits
mailing list