org.apache.jcs.auxiliary.lateral.socket.tcp
Class LateralTCPService

java.lang.Object
  extended byorg.apache.jcs.auxiliary.lateral.socket.tcp.LateralTCPService
All Implemented Interfaces:
ICacheObserver, ICacheService, ILateralCacheObserver, ILateralCacheService

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

A lateral cache service implementation. Does not implement getGroupKey

Version:
$Id: LateralTCPService.java,v 1.5 2003/08/22 11:57:18 mpoeschl Exp $
Author:
Aaron Smuts

Field Summary
private  ILateralCacheAttributes ilca
           
private static org.apache.commons.logging.Log log
           
private  LateralTCPSender sender
           
 
Constructor Summary
LateralTCPService(ILateralCacheAttributes lca)
          Constructor for the LateralTCPService 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.
 java.io.Serializable get(java.lang.String key)
           
 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, byte 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, byte 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, byte 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
 

Field Detail

log

private static final org.apache.commons.logging.Log log

ilca

private ILateralCacheAttributes ilca

sender

private LateralTCPSender sender
Constructor Detail

LateralTCPService

public LateralTCPService(ILateralCacheAttributes lca)
                  throws java.io.IOException
Constructor for the LateralTCPService 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
Throws:
java.io.IOException

update

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

Specified by:
update in interface ILateralCacheService
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
Throws:
java.io.IOException

remove

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

Specified by:
remove in interface ILateralCacheService
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
Throws:
java.io.IOException

get

public java.io.Serializable get(java.lang.String key)
                         throws java.io.IOException
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
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

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
Throws:
java.io.IOException

removeAll

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

Specified by:
removeAll in interface ILateralCacheService
Throws:
java.io.IOException

main

public static void main(java.lang.String[] 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 specified cache.
obj - object to notify for cache changes.
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 - object to notify for all cache changes.
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:
obj - existing subscriber.
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 - existing subscriber.
Throws:
java.io.IOException