org.ow2.util.pool.impl.enhanced.internal.resizer.impl.shared
Class SharedResizer<S>

java.lang.Object
  extended by org.ow2.util.pool.impl.enhanced.internal.resizer.impl.shared.SharedResizer<S>
Type Parameters:
S - statistics type
All Implemented Interfaces:
IResizer<S>

public class SharedResizer<S>
extends java.lang.Object
implements IResizer<S>

Author:
Gael Lalire

Constructor Summary
SharedResizer(ISharedManager sharedManager, IResizer<S> resizer)
           
 
Method Summary
 void prepareUpdate(S stats)
          Prepare an update (calculate next value of expectedSize).
 void setResizable(IResizable resizable)
          Resizer will call method on it.
 void update()
          This method grant that eventually at least one call will be made to setExpectedSize, with stats calculated by latest call to prepareUpdate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SharedResizer

public SharedResizer(ISharedManager sharedManager,
                     IResizer<S> resizer)
Method Detail

prepareUpdate

public void prepareUpdate(S stats)
Description copied from interface: IResizer
Prepare an update (calculate next value of expectedSize). When this method returns the calcul must be complete (no asynchronous mechanism can be used).

Specified by:
prepareUpdate in interface IResizer<S>
Parameters:
stats - statistics

setResizable

public void setResizable(IResizable resizable)
Description copied from interface: IResizer
Resizer will call method on it.

Specified by:
setResizable in interface IResizer<S>
Parameters:
resizable - a resizable

update

public void update()
Description copied from interface: IResizer
This method grant that eventually at least one call will be made to setExpectedSize, with stats calculated by latest call to prepareUpdate. When this method returns you cannot know if the setExpectedSize have been called (asynchronous mechanism like watchDog or delegation to another thread can be used).

Specified by:
update in interface IResizer<S>


Copyright © 2007-2009 OW2 Consortium. All Rights Reserved.