Author: manik.surtani(a)jboss.com
Date: 2008-10-08 06:42:17 -0400 (Wed, 08 Oct 2008)
New Revision: 6860
Added:
core/branches/flat/src/main/java/org/jboss/starobrno/lifecycle/
core/branches/flat/src/main/java/org/jboss/starobrno/lifecycle/Lifecycle.java
Modified:
core/branches/flat/src/main/java/org/jboss/starobrno/Cache.java
core/branches/flat/src/main/java/org/jboss/starobrno/CacheDelegate.java
Log:
Updated interfaces
Modified: core/branches/flat/src/main/java/org/jboss/starobrno/Cache.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/starobrno/Cache.java 2008-10-08 09:34:41
UTC (rev 6859)
+++ core/branches/flat/src/main/java/org/jboss/starobrno/Cache.java 2008-10-08 10:42:17
UTC (rev 6860)
@@ -21,11 +21,29 @@
*/
package org.jboss.starobrno;
+import org.jboss.cache.InvocationContext;
+import org.jboss.cache.config.Configuration;
+import org.jboss.starobrno.lifecycle.Lifecycle;
+
+import java.util.Set;
import java.util.concurrent.ConcurrentMap;
/**
* @author Mircea.Markus(a)jboss.com
*/
-public interface Cache extends ConcurrentMap
+public interface Cache<K, V> extends ConcurrentMap<K, V>, Lifecycle
{
+ void evict(K key);
+
+ Configuration getConfiguration();
+
+ void addCacheListener(Object listener);
+
+ void removeCacheListener(Object listener);
+
+ Set<Object> getCacheListeners();
+
+ InvocationContext getInvocationContext();
+
+ void setInvocationContext(InvocationContext ctx);
}
Modified: core/branches/flat/src/main/java/org/jboss/starobrno/CacheDelegate.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/starobrno/CacheDelegate.java 2008-10-08
09:34:41 UTC (rev 6859)
+++ core/branches/flat/src/main/java/org/jboss/starobrno/CacheDelegate.java 2008-10-08
10:42:17 UTC (rev 6860)
@@ -21,104 +21,161 @@
*/
package org.jboss.starobrno;
+import org.jboss.cache.config.Configuration;
+import org.jboss.starobrno.context.InvocationContext;
import org.jboss.starobrno.invocation.InvocationContextContainer;
-import org.jboss.starobrno.context.InvocationContext;
+import java.util.Collection;
import java.util.Map;
import java.util.Set;
-import java.util.Collection;
/**
* @author Mircea.Markus(a)jboss.com
*/
public class CacheDelegate implements Cache
{
-
protected InvocationContextContainer invocationContextContainer;
public Object putIfAbsent(Object key, Object value)
{
+ // PutKeyValueCommand
InvocationContext ctx = invocationContextContainer.get();
return null;
}
public boolean remove(Object key, Object value)
{
+ // RemoveCommand
return false; //To change body of implemented methods use File | Settings | File
Templates.
}
public boolean replace(Object key, Object oldValue, Object newValue)
{
+ // ReplaceCommand
return false;
}
public Object replace(Object key, Object value)
{
+ // ReplaceCommand
return null; //To change body of implemented methods use File | Settings | File
Templates.
}
public int size()
{
+ // SizeCommand
return 0; //To change body of implemented methods use File | Settings | File
Templates.
}
public boolean isEmpty()
{
+ // SizeCommand
return false; //To change body of implemented methods use File | Settings | File
Templates.
}
public boolean containsKey(Object key)
{
+ // GetKeyValueCommand
return false; //To change body of implemented methods use File | Settings | File
Templates.
}
public boolean containsValue(Object value)
{
- return false; //To change body of implemented methods use File | Settings | File
Templates.
+ throw new UnsupportedOperationException("Go away");
}
public Object get(Object key)
{
+ // GetKeyValueCommand
return null; //To change body of implemented methods use File | Settings | File
Templates.
}
public Object put(Object key, Object value)
{
+ // PutKeyValueCommand
return null; //To change body of implemented methods use File | Settings | File
Templates.
}
public Object remove(Object key)
{
+ // RemoveCommand
return null; //To change body of implemented methods use File | Settings | File
Templates.
}
public void putAll(Map t)
{
+ // PutMapCommand
//To change body of implemented methods use File | Settings | File Templates.
}
public void clear()
{
+ // ClearCommand
//To change body of implemented methods use File | Settings | File Templates.
}
public Set keySet()
{
- return null; //To change body of implemented methods use File | Settings | File
Templates.
+ throw new UnsupportedOperationException("Go away");
}
public Collection values()
{
- return null; //To change body of implemented methods use File | Settings | File
Templates.
+ throw new UnsupportedOperationException("Go away");
}
public Set entrySet()
{
- return null; //To change body of implemented methods use File | Settings | File
Templates.
+ throw new UnsupportedOperationException("Go away");
}
protected void cacheStatusCheck(org.jboss.cache.InvocationContext ctx)
{
if (invocationContextContainer == null) throw new IllegalStateException("The
cache has been destroyed!");
- }
+ }
+
+ public void evict(Object key)
+ {
+ // EvictCommand
+ }
+
+ public Configuration getConfiguration()
+ {
+ return null; //TODO: Autogenerated. Implement me properly
+ }
+
+ public void addCacheListener(Object listener)
+ {
+ //TODO: Autogenerated. Implement me properly
+ }
+
+ public void removeCacheListener(Object listener)
+ {
+ //TODO: Autogenerated. Implement me properly
+ }
+
+ public Set getCacheListeners()
+ {
+ return null; //TODO: Autogenerated. Implement me properly
+ }
+
+ public org.jboss.cache.InvocationContext getInvocationContext()
+ {
+ return null; //TODO: Autogenerated. Implement me properly
+ }
+
+ public void setInvocationContext(org.jboss.cache.InvocationContext ctx)
+ {
+ //TODO: Autogenerated. Implement me properly
+ }
+
+ public void start()
+ {
+ //TODO: Autogenerated. Implement me properly
+ }
+
+ public void stop()
+ {
+ //TODO: Autogenerated. Implement me properly
+ }
}
Added: core/branches/flat/src/main/java/org/jboss/starobrno/lifecycle/Lifecycle.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/starobrno/lifecycle/Lifecycle.java
(rev 0)
+++
core/branches/flat/src/main/java/org/jboss/starobrno/lifecycle/Lifecycle.java 2008-10-08
10:42:17 UTC (rev 6860)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * 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.starobrno.lifecycle;
+
+/**
+ * // TODO: MANIK: Document this
+ *
+ * @author Manik Surtani (<a
href="mailto:manik@jboss.org">manik@jboss.org</a>)
+ * @since 3.0
+ */
+public interface Lifecycle
+{
+ void start();
+
+ void stop();
+}