org.apache.jcs.auxiliary.lateral.javagroups
Class LateralJGService

java.lang.Object
  extended byorg.apache.jcs.auxiliary.lateral.javagroups.LateralJGService
All Implemented Interfaces:
ICacheObserver, ICacheService, ILateralCacheObserver, ILateralCacheService

public class LateralJGService
extends java.lang.Object
implements ILateralCacheService, ILateralCacheObserver

A lateral cache service implementation.

Version:
$Id: LateralJGService.java,v 1.9 2005/06/04 02:01:54 asmuts Exp $

Constructor Summary
LateralJGService(ILateralCacheAttributes lca)
          Constructor for the LateralJGService object
 
Method Summary
 void addCacheListener(ICacheListener obj)
          Subscribes to all caches.
 void addCacheListener(java.lang.String cacheName, ICacheListener obj)
          Subscribes to the specified cache.
 void dispose(java.lang.String cache)
          Will close the connection.
 ICacheElement get(java.lang.String cacheName, java.io.Serializable key)
          Returns a cache bean from the specified cache; or null if the key does not exist.
 java.util.Set getGroupKeys(java.lang.String cacheName, java.lang.String group)
          Gets the set of keys of objects currently in the group throws UnsupportedOperationException
static void main(java.lang.String[] args)
           
 void release()
          Frees all caches.
 void remove(java.lang.String cacheName, java.io.Serializable key)
          Removes the given key from the specified cache.
 void remove(java.lang.String cacheName, java.io.Serializable key, long requesterId)
          Removes the given key from the specified cache.
 void removeAll(java.lang.String cacheName)
          Remove all keys from the sepcified cache.
 void removeAll(java.lang.String cacheName, long requesterId)
          Remove all keys from the sepcified cache.
 void removeCacheListener(ICacheListener obj)
          Unsubscribes from all caches.
 void removeCacheListener(java.lang.String cacheName, ICacheListener obj)
          Unsubscribes from the specified cache.
 void update(ICacheElement item)
          Puts a cache item to the cache.
 void update(ICacheElement item, long requesterId)
          Puts a cache item to the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LateralJGService

public LateralJGService(ILateralCacheAttributes lca)
                 throws java.io.IOException
Constructor for the LateralJGService object

Parameters:
lca -
Throws:
java.io.IOException
Method Detail

update

public void update(ICacheElement item)
            throws java.io.IOException
Description copied from interface: ICacheService
Puts a cache item to the cache.

Specified by:
update in interface ICacheService
Parameters:
item -
Throws:
java.io.IOException

update

public void update(ICacheElement item,
                   long requesterId)
            throws java.io.IOException
Description copied from interface: ILateralCacheService
Puts a cache item to the cache.

Specified by:
update in interface ILateralCacheService
Parameters:
item -
requesterId -
Throws:
java.io.IOException

remove

public void remove(java.lang.String cacheName,
                   java.io.Serializable key)
            throws java.io.IOException
Description copied from interface: ICacheService
Removes the given key from the specified cache.

Specified by:
remove in interface ICacheService
Parameters:
cacheName -
key -
Throws:
java.io.IOException

remove

public void remove(java.lang.String cacheName,
                   java.io.Serializable key,
                   long requesterId)
            throws java.io.IOException
Description copied from interface: ILateralCacheService
Removes the given key from the specified cache.

Specified by:
remove in interface ILateralCacheService
Parameters:
cacheName -
key -
requesterId -
Throws:
java.io.IOException

release

public void release()
             throws java.io.IOException
Description copied from interface: ICacheService
Frees all caches.

Specified by:
release in interface ICacheService
Throws:
java.io.IOException

dispose

public void dispose(java.lang.String cache)
             throws java.io.IOException
Will close the connection.

Specified by:
dispose in interface ICacheService
Parameters:
cache -
Throws:
java.io.IOException

get

public ICacheElement get(java.lang.String cacheName,
                         java.io.Serializable key)
                  throws java.io.IOException
Description copied from interface: ICacheService
Returns a cache bean from the specified cache; or null if the key does not exist.

Specified by:
get in interface ICacheService
Parameters:
cacheName -
key -
Returns:
Throws:
java.io.IOException

removeAll

public void removeAll(java.lang.String cacheName)
               throws java.io.IOException
Description copied from interface: ICacheService
Remove all keys from the sepcified cache.

Specified by:
removeAll in interface ICacheService
Parameters:
cacheName -
Throws:
java.io.IOException

removeAll

public void removeAll(java.lang.String cacheName,
                      long requesterId)
               throws java.io.IOException
Description copied from interface: ILateralCacheService
Remove all keys from the sepcified cache.

Specified by:
removeAll in interface ILateralCacheService
Parameters:
cacheName -
requesterId -
Throws:
java.io.IOException

getGroupKeys

public java.util.Set getGroupKeys(java.lang.String cacheName,
                                  java.lang.String group)
Gets the set of keys of objects currently in the group throws UnsupportedOperationException

Specified by:
getGroupKeys in interface ILateralCacheService

main

public static void main(java.lang.String[] args)
Parameters:
args -

addCacheListener

public void addCacheListener(java.lang.String cacheName,
                             ICacheListener obj)
                      throws java.io.IOException
Description copied from interface: ICacheObserver
Subscribes to the specified cache.

Specified by:
addCacheListener in interface ICacheObserver
Parameters:
cacheName - The feature to be added to the CacheListener attribute
obj - The feature to be added to the CacheListener attribute
Throws:
java.io.IOException

addCacheListener

public void addCacheListener(ICacheListener obj)
                      throws java.io.IOException
Description copied from interface: ICacheObserver
Subscribes to all caches.

Specified by:
addCacheListener in interface ICacheObserver
Parameters:
obj - The feature to be added to the CacheListener attribute
Throws:
java.io.IOException

removeCacheListener

public void removeCacheListener(java.lang.String cacheName,
                                ICacheListener obj)
                         throws java.io.IOException
Description copied from interface: ICacheObserver
Unsubscribes from the specified cache.

Specified by:
removeCacheListener in interface ICacheObserver
Parameters:
cacheName -
obj -
Throws:
java.io.IOException

removeCacheListener

public void removeCacheListener(ICacheListener obj)
                         throws java.io.IOException
Description copied from interface: ICacheObserver
Unsubscribes from all caches.

Specified by:
removeCacheListener in interface ICacheObserver
Parameters:
obj -
Throws:
java.io.IOException


Copyright © 2002-2005 Apache Software Foundation. All Rights Reserved.