Package com.caucho.loader

Examples of com.caucho.loader.EnvironmentClassLoader


  {
    Thread thread = Thread.currentThread();
    ClassLoader oldLoader = thread.getContextClassLoader();

    try {
      EnvironmentClassLoader envLoader = getEnvironmentClassLoader();
      thread.setContextClassLoader(envLoader);

      if (! _lifecycle.toStopping())
        return false;

      super.stop();

      if (_bamBroker != null)
        _bamBroker.close();

      envLoader.stop();

      return true;
    } finally {
      _lifecycle.toStop();
View Full Code Here


    if (isDestroyed())
      return;

    Thread thread = Thread.currentThread();
    ClassLoader oldLoader = thread.getContextClassLoader();
    EnvironmentClassLoader classLoader = getEnvironmentClassLoader();

    thread.setContextClassLoader(classLoader);

    try {
      super.destroy();
    } finally {
      thread.setContextClassLoader(oldLoader);

      classLoader.destroy();
    }
  }
View Full Code Here

  private ArtifactRepository(EnvironmentClassLoader loader)
  {
    _loader = loader;

    if (loader != null) {
      EnvironmentClassLoader parentLoader
  = Environment.getEnvironmentClassLoader(loader.getParent());

      if (parentLoader != null && parentLoader != loader)
  _parent = create(parentLoader);
    }
View Full Code Here

  {
    synchronized (_local) {
      ArtifactRepository repository = _local.getLevel(loader);

      if (repository == null) {
  EnvironmentClassLoader envLoader
    = Environment.getEnvironmentClassLoader(loader.getParent());

  repository = new ArtifactRepository(envLoader);

  _local.set(repository);
View Full Code Here

    return (scope instanceof ApplicationScope);
  }

  public <T> void addDestructor(Contextual<T> comp, T value)
  {
    EnvironmentClassLoader loader = Environment.getEnvironmentClassLoader();

    if (loader != null) {
      DestructionListener listener
        = (DestructionListener) loader.getAttribute("caucho.destroy");

      if (listener == null) {
        listener = new DestructionListener();
        loader.setAttribute("caucho.destroy", listener);
        loader.addListener(listener);
      }

      listener.addValue(comp, value);
    }
  }
View Full Code Here

  }

  @Override
  public <T> void addDestructor(Contextual<T> comp, T value)
  {
    EnvironmentClassLoader loader = Environment.getEnvironmentClassLoader();

    if (loader != null) {
      DestructionListener listener
        = (DestructionListener) loader.getAttribute("caucho.destroy");

      if (listener == null) {
        listener = new DestructionListener();
        loader.setAttribute("caucho.destroy", listener);
        loader.addListener(listener);
      }

      listener.addValue(comp, value);
    }
  }
View Full Code Here

      int status = -1;
     
      Thread thread = Thread.currentThread();
      ClassLoader oldLoader = thread.getContextClassLoader();
      try {
  EnvironmentClassLoader env;
  env = EnvironmentClassLoader.create(ClassLoader.getSystemClassLoader());
        thread.setContextClassLoader(env);

        try {
          Class cl = Class.forName(COMPILER, false, env);
View Full Code Here

    props.put(key, value);
  }

  private static ConfigProperties createConfigProperties(ClassLoader loader)
  {
    EnvironmentClassLoader envLoader
      = Environment.getEnvironmentClassLoader(loader);

    ConfigProperties props = _envProperties.getLevel(envLoader);

    if (props != null)
      return props;

    if (envLoader != null) {
      ConfigProperties parent = createConfigProperties(envLoader.getParent());

      props = new ConfigProperties(parent);
    }
    else
      props = new ConfigProperties(null);
View Full Code Here

      int status = -1;
     
      Thread thread = Thread.currentThread();
      ClassLoader oldLoader = thread.getContextClassLoader();
      try {
        EnvironmentClassLoader env;
        env = EnvironmentClassLoader.create(ClassLoader.getSystemClassLoader());
        thread.setContextClassLoader(env);

        try {
          Class cl = Class.forName(COMPILER, false, env);
View Full Code Here

    manager = _localContainer.getLevel(loader);
   
    if (manager != null)
      return manager;
     
    EnvironmentClassLoader envLoader
      = Environment.getEnvironmentClassLoader(loader);

    // ejb doesn't create a new InjectManager even though it's a new
    // environment
    // XXX: yes it does, because of the SessionContext
    // ejb/2016 vs ejb/12h0
    /*
    if (envLoader != null
        && Boolean.FALSE.equals(envLoader.getAttribute("caucho.inject"))) {
      manager = create(envLoader.getParent());
     
      if (manager != null)
        return manager;
    }
    */

    String id;

    if (envLoader != null)
      id = envLoader.getId();
    else
      id = "";

    InjectManager parent = null;

    if (envLoader != null && envLoader != _systemClassLoader)
      parent = create(envLoader.getParent());

    synchronized (_localContainer) {
      manager = _localContainer.getLevel(envLoader);
       
      if (manager != null)
View Full Code Here

TOP

Related Classes of com.caucho.loader.EnvironmentClassLoader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.