org.milyn.container.ExecutionContext.removeAttribute()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(9.5k)|赞(0)|评价(0)|浏览(83)

本文整理了Java中org.milyn.container.ExecutionContext.removeAttribute()方法的一些代码示例,展示了ExecutionContext.removeAttribute()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ExecutionContext.removeAttribute()方法的具体详情如下:
包路径:org.milyn.container.ExecutionContext
类名称:ExecutionContext
方法名:removeAttribute

ExecutionContext.removeAttribute介绍

暂无

代码示例

代码示例来源:origin: smooks/smooks

public void detachHandler() {
  executionContext.removeAttribute(DefaultHandler2.class);
}

代码示例来源:origin: org.milyn/milyn-smooks-all

public void detachHandler() {
  executionContext.removeAttribute(DefaultHandler2.class);
}

代码示例来源:origin: org.virtuslab/milyn-smooks-core

public void detachHandler() {
  executionContext.removeAttribute(DefaultHandler2.class);
}

代码示例来源:origin: org.milyn/milyn-smooks-core

public void detachHandler() {
  executionContext.removeAttribute(DefaultHandler2.class);
}

代码示例来源:origin: smooks/smooks

public static void setSource(ExecutionContext executionContext, Source source) {
  if(source != null) {
    executionContext.setAttribute(CONTEXT_KEY, source);
  } else {
    executionContext.removeAttribute(CONTEXT_KEY);
  }
}

代码示例来源:origin: smooks/smooks

public static void setResults(ExecutionContext executionContext, Result... results) {
  if(results != null) {
    executionContext.setAttribute(CONTEXT_KEY, results);
  } else {
    executionContext.removeAttribute(CONTEXT_KEY);
  }
}

代码示例来源:origin: org.milyn/milyn-smooks-all

public static void setSource(ExecutionContext executionContext, Source source) {
  if(source != null) {
    executionContext.setAttribute(CONTEXT_KEY, source);
  } else {
    executionContext.removeAttribute(CONTEXT_KEY);
  }
}

代码示例来源:origin: org.virtuslab/milyn-smooks-core

public static void setSource(ExecutionContext executionContext, Source source) {
  if(source != null) {
    executionContext.setAttribute(CONTEXT_KEY, source);
  } else {
    executionContext.removeAttribute(CONTEXT_KEY);
  }
}

代码示例来源:origin: org.milyn/milyn-smooks-core

public static void setResults(ExecutionContext executionContext, Result... results) {
  if(results != null) {
    executionContext.setAttribute(CONTEXT_KEY, results);
  } else {
    executionContext.removeAttribute(CONTEXT_KEY);
  }
}

代码示例来源:origin: org.milyn/milyn-smooks-all

public static void setResults(ExecutionContext executionContext, Result... results) {
  if(results != null) {
    executionContext.setAttribute(CONTEXT_KEY, results);
  } else {
    executionContext.removeAttribute(CONTEXT_KEY);
  }
}

代码示例来源:origin: org.milyn/milyn-smooks-core

public static void setSource(ExecutionContext executionContext, Source source) {
  if(source != null) {
    executionContext.setAttribute(CONTEXT_KEY, source);
  } else {
    executionContext.removeAttribute(CONTEXT_KEY);
  }
}

代码示例来源:origin: org.virtuslab/milyn-smooks-core

public static void setResults(ExecutionContext executionContext, Result... results) {
  if(results != null) {
    executionContext.setAttribute(CONTEXT_KEY, results);
  } else {
    executionContext.removeAttribute(CONTEXT_KEY);
  }
}

代码示例来源:origin: org.milyn/milyn-smooks-all

/**
 * Close the resource output stream.
 * <p/>
 * Classes overriding this method must call super on this method. This will
 * probably need to be done before performing any aditional cleanup.
 *
 * @param executionContext Smooks ExecutionContext
 */
protected void closeResource( final ExecutionContext executionContext )
{
  try
  {
    Closeable output = (Closeable) executionContext.getAttribute( OUTPUTSTREAM_CONTEXT_KEY_PREFIX + getResourceName() );
    close( output );
  }
  finally
  {
    executionContext.removeAttribute( OUTPUTSTREAM_CONTEXT_KEY_PREFIX + getResourceName() );
    executionContext.removeAttribute( RESOURCE_CONTEXT_KEY_PREFIX + getResourceName() );
  }
}

代码示例来源:origin: smooks/smooks

/**
 * Close the resource output stream.
 * <p/>
 * Classes overriding this method must call super on this method. This will
 * probably need to be done before performing any aditional cleanup.
 *
 * @param executionContext Smooks ExecutionContext
 */
protected void closeResource( final ExecutionContext executionContext )
{
  try
  {
    Closeable output = (Closeable) executionContext.getAttribute( OUTPUTSTREAM_CONTEXT_KEY_PREFIX + getResourceName() );
    close( output );
  }
  finally
  {
    executionContext.removeAttribute( OUTPUTSTREAM_CONTEXT_KEY_PREFIX + getResourceName() );
    executionContext.removeAttribute( RESOURCE_CONTEXT_KEY_PREFIX + getResourceName() );
  }
}

代码示例来源:origin: org.virtuslab/milyn-smooks-core

/**
 * Close the resource output stream.
 *
 * Classes overriding this method must call super on this method. This will
 * probably need to be done before performing any aditional cleanup.
 *
 * @param executionContext Smooks ExecutionContext
 */
protected void closeResource( final ExecutionContext executionContext )
{
  try
  {
    Closeable output = (Closeable) executionContext.getAttribute( OUTPUTSTREAM_CONTEXT_KEY_PREFIX + getResourceName() );
    close( output );
  }
  finally
  {
    executionContext.removeAttribute( OUTPUTSTREAM_CONTEXT_KEY_PREFIX + getResourceName() );
    executionContext.removeAttribute( RESOURCE_CONTEXT_KEY_PREFIX + getResourceName() );
  }
}

代码示例来源:origin: org.milyn/milyn-smooks-core

/**
 * Close the resource output stream.
 * <p/>
 * Classes overriding this method must call super on this method. This will
 * probably need to be done before performing any aditional cleanup.
 *
 * @param executionContext Smooks ExecutionContext
 */
protected void closeResource( final ExecutionContext executionContext )
{
  try
  {
    Closeable output = (Closeable) executionContext.getAttribute( OUTPUTSTREAM_CONTEXT_KEY_PREFIX + getResourceName() );
    close( output );
  }
  finally
  {
    executionContext.removeAttribute( OUTPUTSTREAM_CONTEXT_KEY_PREFIX + getResourceName() );
    executionContext.removeAttribute( RESOURCE_CONTEXT_KEY_PREFIX + getResourceName() );
  }
}

代码示例来源:origin: org.virtuslab/milyn-smooks-core

public void executeVisitLifecycleCleanup(Fragment fragment, ExecutionContext executionContext) {
    try {
      ExecutionContext nestedExecutionContext = (ExecutionContext) executionContext.getAttribute(NestedExecutionVisitor.class);

      try {
        if(nestedExecutionContext != null) {
          BeanContext parentBeanContext = executionContext.getBeanContext();
          BeanContext nestedBeanContext = nestedExecutionContext.getBeanContext();

          for(BeanId beanId : mapBeanIds) {
            Object bean = nestedBeanContext.getBean(beanId.getName());

            // Add the bean from the nested context onto the parent context and then remove
            // it again.  This is enough to fire the wiring and end events...
            parentBeanContext.notifyObservers(new BeanContextLifecycleEvent(executionContext, null, BeanLifecycle.START_FRAGMENT, beanId, bean));
            parentBeanContext.addBean(beanId, bean);
            parentBeanContext.notifyObservers(new BeanContextLifecycleEvent(executionContext, null, BeanLifecycle.END_FRAGMENT, beanId, bean));
            parentBeanContext.removeBean(beanId, null);
          }
        }
      } finally {
        executionContext.removeAttribute(NestedExecutionVisitor.class);
      }
    } finally {
      AbstractParser.detachXMLReader(executionContext);
    }
  }
}

代码示例来源:origin: org.milyn/milyn-smooks-all

public void executeVisitLifecycleCleanup(Fragment fragment, ExecutionContext executionContext) {
    try {
      ExecutionContext nestedExecutionContext = (ExecutionContext) executionContext.getAttribute(NestedExecutionVisitor.class);

      try {
        if(nestedExecutionContext != null) {
          BeanContext parentBeanContext = executionContext.getBeanContext();
          BeanContext nestedBeanContext = nestedExecutionContext.getBeanContext();

          for(BeanId beanId : mapBeanIds) {
            Object bean = nestedBeanContext.getBean(beanId.getName());

            // Add the bean from the nested context onto the parent context and then remove
            // it again.  This is enough to fire the wiring and end events...
            parentBeanContext.notifyObservers(new BeanContextLifecycleEvent(executionContext, null, BeanLifecycle.START_FRAGMENT, beanId, bean));
            parentBeanContext.addBean(beanId, bean);
            parentBeanContext.notifyObservers(new BeanContextLifecycleEvent(executionContext, null, BeanLifecycle.END_FRAGMENT, beanId, bean));
            parentBeanContext.removeBean(beanId, null);
          }
        }
      } finally {
        executionContext.removeAttribute(NestedExecutionVisitor.class);
      }
    } finally {
      AbstractParser.detachXMLReader(executionContext);
    }
  }
}

代码示例来源:origin: org.milyn/milyn-smooks-core

public void executeVisitLifecycleCleanup(Fragment fragment, ExecutionContext executionContext) {
    try {
      ExecutionContext nestedExecutionContext = (ExecutionContext) executionContext.getAttribute(NestedExecutionVisitor.class);

      try {
        if(nestedExecutionContext != null) {
          BeanContext parentBeanContext = executionContext.getBeanContext();
          BeanContext nestedBeanContext = nestedExecutionContext.getBeanContext();

          for(BeanId beanId : mapBeanIds) {
            Object bean = nestedBeanContext.getBean(beanId.getName());

            // Add the bean from the nested context onto the parent context and then remove
            // it again.  This is enough to fire the wiring and end events...
            parentBeanContext.notifyObservers(new BeanContextLifecycleEvent(executionContext, null, BeanLifecycle.START_FRAGMENT, beanId, bean));
            parentBeanContext.addBean(beanId, bean);
            parentBeanContext.notifyObservers(new BeanContextLifecycleEvent(executionContext, null, BeanLifecycle.END_FRAGMENT, beanId, bean));
            parentBeanContext.removeBean(beanId, null);
          }
        }
      } finally {
        executionContext.removeAttribute(NestedExecutionVisitor.class);
      }
    } finally {
      AbstractParser.detachXMLReader(executionContext);
    }
  }
}

代码示例来源:origin: smooks/smooks

public void executeVisitLifecycleCleanup(Fragment fragment, ExecutionContext executionContext) {
    try {
      ExecutionContext nestedExecutionContext = (ExecutionContext) executionContext.getAttribute(NestedExecutionVisitor.class);

      try {
        if(nestedExecutionContext != null) {
          BeanContext parentBeanContext = executionContext.getBeanContext();
          BeanContext nestedBeanContext = nestedExecutionContext.getBeanContext();

          for(BeanId beanId : mapBeanIds) {
            Object bean = nestedBeanContext.getBean(beanId.getName());

            // Add the bean from the nested context onto the parent context and then remove
            // it again.  This is enough to fire the wiring and end events...
            parentBeanContext.notifyObservers(new BeanContextLifecycleEvent(executionContext, null, BeanLifecycle.START_FRAGMENT, beanId, bean));
            parentBeanContext.addBean(beanId, bean);
            parentBeanContext.notifyObservers(new BeanContextLifecycleEvent(executionContext, null, BeanLifecycle.END_FRAGMENT, beanId, bean));
            parentBeanContext.removeBean(beanId, null);
          }
        }
      } finally {
        executionContext.removeAttribute(NestedExecutionVisitor.class);
      }
    } finally {
      AbstractParser.detachXMLReader(executionContext);
    }
  }
}

相关文章