com.xenonsoft.bridgetown.soa.impl
Class ContextCacheContainerImpl

java.lang.Object
  extended bycom.xenonsoft.bridgetown.soa.impl.ContextCacheContainerImpl
All Implemented Interfaces:
IContextCacheContainer, java.io.Serializable

public class ContextCacheContainerImpl
extends java.lang.Object
implements IContextCacheContainer, java.io.Serializable

Context cache container that manages a collection of context cache instances

Version:
$Id: ContextCacheContainerImpl.java,v 1.6 2005/03/17 02:37:22 peter_pilgrim Exp $
Author:
Peter Pilgrim, Aug 26, 2004 11:44:38 PM
See Also:
Serialized Form

Field Summary
protected  java.util.Map contextMap
          A map collection that stores ContextCacheImpl elements
 
Constructor Summary
ContextCacheContainerImpl()
          Default constructor
 
Method Summary
 void clear()
          Clear the cache container of all instance caches
 boolean contains(ContextConfig context)
          Returns a boolean if the context configuration is stored in the cache container
 IContextCache[] getContextCacheList()
          Retrieves a primitive array of instance element elements inside the cache container
 java.lang.Object getLocalBean(ContextConfig contextConfig, java.lang.String serviceId)
          Retrieves the service bean stored in the context instance cache by name
 void putLocalBean(ContextConfig contextConfig, java.lang.String serviceId, java.lang.Object bean)
          Stores the service bean stored in the context instance cache by name
 IContextCache removeContextCache(ContextConfig contextConfig)
          Removes the cache instance from the container by its context configuration
 int size()
          Returns the current size of the cache container
 java.lang.String toString()
          Human debuggable output Implements / overrides toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

contextMap

protected java.util.Map contextMap
A map collection that stores ContextCacheImpl elements

Constructor Detail

ContextCacheContainerImpl

public ContextCacheContainerImpl()
Default constructor

Method Detail

getLocalBean

public java.lang.Object getLocalBean(ContextConfig contextConfig,
                                     java.lang.String serviceId)
Retrieves the service bean stored in the context instance cache by name

Specified by:
getLocalBean in interface IContextCacheContainer
Parameters:
contextConfig - the context configuration
serviceId - the service bean name
Returns:
the bean instance or null if it is not managed

putLocalBean

public void putLocalBean(ContextConfig contextConfig,
                         java.lang.String serviceId,
                         java.lang.Object bean)
Stores the service bean stored in the context instance cache by name

Specified by:
putLocalBean in interface IContextCacheContainer
Parameters:
contextConfig - the context configuration
serviceId - the service bean name
bean - the service bean instance to store

size

public int size()
Returns the current size of the cache container

Specified by:
size in interface IContextCacheContainer
Returns:
the size

contains

public boolean contains(ContextConfig context)
Returns a boolean if the context configuration is stored in the cache container

Specified by:
contains in interface IContextCacheContainer
Parameters:
context - the context configuration
Returns:
true if the bean is returned

clear

public void clear()
Clear the cache container of all instance caches

Specified by:
clear in interface IContextCacheContainer
Returns:
the size

removeContextCache

public IContextCache removeContextCache(ContextConfig contextConfig)
Removes the cache instance from the container by its context configuration

Specified by:
removeContextCache in interface IContextCacheContainer
Returns:
the context cache that has been removed or null

getContextCacheList

public IContextCache[] getContextCacheList()
Retrieves a primitive array of instance element elements inside the cache container

Specified by:
getContextCacheList in interface IContextCacheContainer
Returns:
the array of cache instance elements

toString

public java.lang.String toString()
Human debuggable output Implements / overrides toString

Returns:
the debuggable string
See Also:
Object.toString()


Copyright © 2005 XeNoNSoFT.com. All Rights Reserved.