private void setUpEntryFor(Context context) { // The entry should not be associated to NullContext. if (context instanceof NullContext) { return; } this.parent = context.getCurEntry(); if (parent != null) { ((CtEntry)parent).child = this; } context.setCurEntry(this); }
/** * Remove current entry from local context, but does not exit. */ void cleanCurrentEntryInLocal() { if (context instanceof NullContext) { return; } Context originalContext = context; if (originalContext != null) { Entry curEntry = originalContext.getCurEntry(); if (curEntry == this) { Entry parent = this.parent; originalContext.setCurEntry(parent); if (parent != null) { ((CtEntry)parent).child = null; } } else { throw new IllegalStateException("Bad async context state"); } } }
/** * The async context should not be initialized until the node for current resource has been set to current entry. */ void initAsyncContext() { if (asyncContext == null) { if (context instanceof NullContext) { asyncContext = context; return; } this.asyncContext = Context.newAsyncContext(context.getEntranceNode(), context.getName()) .setOrigin(context.getOrigin()) .setCurEntry(this); } else { RecordLog.warn("[AsyncEntry] Duplicate initialize of async context for entry: " + resourceWrapper.getName()); } }
context.setCurEntry(parent); if (parent != null) { ((CtEntry)parent).child = null;
private void setUpEntryFor(Context context) { // The entry should not be associated to NullContext. if (context instanceof NullContext) { return; } this.parent = context.getCurEntry(); if (parent != null) { ((CtEntry)parent).child = this; } context.setCurEntry(this); }
/** * Remove current entry from local context, but does not exit. */ void cleanCurrentEntryInLocal() { if (context instanceof NullContext) { return; } Context originalContext = context; if (originalContext != null) { Entry curEntry = originalContext.getCurEntry(); if (curEntry == this) { Entry parent = this.parent; originalContext.setCurEntry(parent); if (parent != null) { ((CtEntry)parent).child = null; } } else { throw new IllegalStateException("Bad async context state"); } } }
/** * The async context should not be initialized until the node for current resource has been set to current entry. */ void initAsyncContext() { if (asyncContext == null) { if (context instanceof NullContext) { asyncContext = context; return; } this.asyncContext = Context.newAsyncContext(context.getEntranceNode(), context.getName()) .setOrigin(context.getOrigin()) .setCurEntry(this); } else { RecordLog.warn("[AsyncEntry] Duplicate initialize of async context for entry: " + resourceWrapper.getName()); } }
context.setCurEntry(parent); if (parent != null) { ((CtEntry)parent).child = null;