aicas logoJamaica 6.1 release 1

com.aicas.jamaica.lang
Class AllocationHandler

java.lang.Object
  extended by com.aicas.jamaica.lang.AllocationHandler
Direct Known Subclasses:
MemoryBudget

public abstract class AllocationHandler
extends Object

AllocationHandler provides a means to attach a handler to a thread that will be invoked every time the thread performs an allocation.


Constructor Summary
AllocationHandler()
           
 
Method Summary
abstract  Object handle(Object o)
          Routine that will be called when a thread allocated an object.
static void removeAllocationHandler(Thread t, AllocationHandler h)
          Remove the given memory handler.
static void setAllocationHandler(Thread t, AllocationHandler h)
          set the allocation handler for a given thread
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AllocationHandler

public AllocationHandler()
Method Detail

setAllocationHandler

public static void setAllocationHandler(Thread t,
                                        AllocationHandler h)
set the allocation handler for a given thread

Parameters:
t - the thread
h - the allocation handler, must redefine method handle(Object)

removeAllocationHandler

public static void removeAllocationHandler(Thread t,
                                           AllocationHandler h)
Remove the given memory handler.

Parameters:
t - the thread the handler was assigned to
h - the allocation handler

handle

public abstract Object handle(Object o)
Routine that will be called when a thread allocated an object.

Parameters:
o - the allocated object
Returns:
the allocated object o or null if the allocation should fail.

aicas logoJamaica 6.1 release 1

aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2012 aicas GmbH. All Rights Reserved.