| Modifier and Type | Class and Description |
|---|---|
| private static class | ClosureManager.
Holder class to do lazy allocation of the ClosureManager instance |
| Modifier and Type | Field and Description |
|---|---|
| private final Map | poolMap
ClosurePool instances are linked via a SoftReference in the lookup map, so when all closure instances that that were allocated from the ClosurePool have been reclaimed, and there is memory pressure, the native closure pool can be freed. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public final synchronized ClosurePool | |
| public static ClosureManager | |
| public final Closure. | Returns: A newClosure.Handle instance.The java object to be called when the native closure is invoked. closure, Type The return type of the closure. returnType, Type[] The parameter types of the closure. parameterTypes, CallingConvention The calling convention of the closure. convention)Wraps a java object that implements the |
| public final Closure. | Returns: A newClosure.Handle instance.The java object to be called when the native closure is invoked. closure, CallContext The call context (return type, param types, convention) of the Closure callContext)Wraps a java object that implements the |
| public ClosureMagazine |
| poolMap | back to summary |
|---|---|
| private final Map<CallContext, Reference<ClosurePool>> poolMap ClosurePool instances are linked via a SoftReference in the lookup map, so
when all closure instances that that were allocated from the ClosurePool have been
reclaimed, and there is memory pressure, the native closure pool can be freed.
This will allow the CallContext instance to also be collected if it is not
strongly referenced elsewhere, and ejected from the | |
| ClosureManager | back to summary |
|---|---|
| private ClosureManager() Constructs a ClosureManager | |
| getClosurePool | back to summary |
|---|---|
| public final synchronized ClosurePool getClosurePool(CallContext callContext) | |
| getInstance | back to summary |
|---|---|
| public static ClosureManager getInstance() Gets the global instance of the
| |
| newClosure | back to summary |
|---|---|
| public final Closure. Wraps a java object that implements the
| |
| newClosure | back to summary |
|---|---|
| public final Closure. Wraps a java object that implements the
| |
| newClosureMagazine | back to summary |
|---|---|
| public ClosureMagazine newClosureMagazine(CallContext callContext, Method method) | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final ClosureManager |
| Access | Constructor and Description |
|---|---|
| private |
| INSTANCE | back to summary |
|---|---|
| pack-priv static final ClosureManager INSTANCE | |
| SingletonHolder | back to summary |
|---|---|
| private SingletonHolder() | |