コード例 #1
0
 /**
  * Resolves the XStream instance to be used by this data format. If XStream is not explicitly set,
  * new instance will be created and cached.
  *
  * @param context to be used during a configuration of the XStream instance
  * @return XStream instance used by this data format.
  */
 public XStream getXStream(CamelContext context) {
   if (xstream == null) {
     xstream =
         createXStream(context.getClassResolver(), context.getApplicationContextClassLoader());
   }
   return xstream;
 }
コード例 #2
0
  protected Object executeLocal(
      LocalCamelController camelController, PrintStream out, PrintStream err) throws Exception {
    CamelContext camelContext = camelController.getLocalCamelContext(context);
    if (camelContext == null) {
      err.println("Camel context " + context + " not found.");
      return null;
    }

    // Setting thread context classloader to the bundle classloader to enable legacy code that
    // relies on it
    ClassLoader oldClassloader = Thread.currentThread().getContextClassLoader();
    Thread.currentThread().setContextClassLoader(camelContext.getApplicationContextClassLoader());
    try {
      return performContextCommand(camelController, camelContext.getName(), out, err);
    } finally {
      Thread.currentThread().setContextClassLoader(oldClassloader);
    }
  }
コード例 #3
0
 public MailConfiguration(CamelContext context) {
   this.applicationClassLoader = context.getApplicationContextClassLoader();
 }