org.objectweb.dream.cache
Class CacheImpl

java.lang.Object
  extended byorg.objectweb.dream.AbstractComponent
      extended byorg.objectweb.dream.cache.CacheImpl
All Implemented Interfaces:
AttributeController, BindingController, CacheAttributeController, LifeCycleController, Loggable, Pull

public class CacheImpl
extends AbstractComponent
implements Pull, CacheAttributeController

This class defines a basic cache. A cached message is considered as up-to-date as long as it has not been cached more than timeout milliseconds.

timeout can be changed using the CacheAttributeController controller.


Field Summary
protected  Message cachedMessage
          The last cached message.
protected  GetTimeStamp getTimeStamp
          The GetTimeStamp client interface.
protected  Pull inPull
          The Pull client interface.
protected  long lastTimeStamp
          The last time stamp.
protected  MessageManager messageManagerItf
          The message manager client interface.
protected  long timeOut
          The cache time out.
 
Fields inherited from class org.objectweb.dream.AbstractComponent
bindingLogger, componentDesc, fcState, firstStart, lifeCycleLogger, logger, weaveableC
 
Fields inherited from interface org.objectweb.dream.Pull
IN_PULL_ITF_NAME, OUT_PULL_ITF_NAME
 
Fields inherited from interface org.objectweb.fractal.api.control.LifeCycleController
STARTED, STOPPED
 
Constructor Summary
CacheImpl()
           
 
Method Summary
 void bindFc(String clientItfName, Object serverItf)
           
 long getTimeOut()
          Returns the time out.
 String[] listFc()
           
 Message pull(Map context)
           
 void setTimeOut(long timeOut)
          Sets the time out of the cache component.
 
Methods inherited from class org.objectweb.dream.AbstractComponent
beforeFirstStart, getFcState, initComponent, lookupFc, setLogger, startFc, stopFc, unbindFc
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

timeOut

protected long timeOut
The cache time out.


messageManagerItf

protected MessageManager messageManagerItf
The message manager client interface.


getTimeStamp

protected GetTimeStamp getTimeStamp
The GetTimeStamp client interface.


inPull

protected Pull inPull
The Pull client interface.


cachedMessage

protected Message cachedMessage
The last cached message.


lastTimeStamp

protected long lastTimeStamp
The last time stamp.

Constructor Detail

CacheImpl

public CacheImpl()
Method Detail

pull

public Message pull(Map context)
             throws PullException
Specified by:
pull in interface Pull
Throws:
PullException
See Also:
Pull.pull(Map)

setTimeOut

public void setTimeOut(long timeOut)
Description copied from interface: CacheAttributeController
Sets the time out of the cache component.

Specified by:
setTimeOut in interface CacheAttributeController
Parameters:
timeOut - the time out to set.
See Also:
CacheAttributeController.setTimeOut(long)

getTimeOut

public long getTimeOut()
Description copied from interface: CacheAttributeController
Returns the time out.

Specified by:
getTimeOut in interface CacheAttributeController
Returns:
the time out.
See Also:
CacheAttributeController.getTimeOut()

bindFc

public void bindFc(String clientItfName,
                   Object serverItf)
            throws NoSuchInterfaceException,
                   IllegalBindingException,
                   IllegalLifeCycleException
Specified by:
bindFc in interface BindingController
Throws:
NoSuchInterfaceException
IllegalBindingException
IllegalLifeCycleException
See Also:
BindingController.bindFc(String, Object)

listFc

public String[] listFc()
Specified by:
listFc in interface BindingController
See Also:
BindingController.listFc()


Copyright © 2003, 2004 - INRIA Rhone-Alpes - All Rights Reserved.