Package com.caucho.loader

Examples of com.caucho.loader.EnvironmentClassLoader


    if (! _lifecycle.toDestroy())
      return;

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

    thread.setContextClassLoader(classLoader);

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

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


   * Adds a class transformer.
   */
  @Override
  public void addTransformer(ClassTransformer transformer)
  {
    EnvironmentClassLoader loader = _persistenceManager.getClassLoader();

    loader.addTransformer(new TransformerAdapter(transformer));
  }
View Full Code Here

   * Returns a temporary class loader.
   */
  @Override
  public ClassLoader getNewTempClassLoader()
  {
    EnvironmentClassLoader loader = _persistenceManager.getClassLoader();
   
    return loader.getNewTempClassLoader();
  }
View Full Code Here

    else if (true)
      return true;

    for (; loader != null; loader = loader.getParent()) {
      if (loader instanceof EnvironmentClassLoader) {
  EnvironmentClassLoader envLoader;
  envLoader = (EnvironmentClassLoader) loader;

  ArrayList<Permission> perms = envLoader.getPermissions();

  if (perms == null)
    return _parent.implies(domain, permission);
 
  for (int i = perms.size() - 1; i >= 0; i--) {
View Full Code Here

      ArrayList<EjbBean> beanConfig = new ArrayList<EjbBean>(_pendingBeans);
      _pendingBeans.clear();

      _deployingBeans.addAll(beanConfig);

      EnvironmentClassLoader parentLoader = _ejbContainer.getClassLoader();

      Path workDir = _ejbContainer.getWorkDir();

      JavaClassGenerator javaGen = new JavaClassGenerator();
      // need to be compatible with enhancement
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
    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)
      parent = create(envLoader.getParent());

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

    throws Exception
  {
    ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
   
    // wrap so the EJB code will work.
    EnvironmentClassLoader loader;

    loader = EnvironmentClassLoader.create(oldLoader);
    if (_appDir != null) {
      loader.addLoader(new SimpleLoader(loader,
                                        _appDir.lookup("WEB-INF/classes"),
          null));
    }

    Thread.currentThread().setContextClassLoader(loader);
View Full Code Here

  {
    ClassLoader loader = Thread.currentThread().getContextClassLoader();

    for (; loader != null; loader = loader.getParent()) {
      if (loader instanceof EnvironmentClassLoader) {
  EnvironmentClassLoader envLoader = (EnvironmentClassLoader) loader;

  ResourceArchiveManager manager = _localManager.getLevel(envLoader);

  if (manager != null) {
    ResourceArchive ra = manager.getResourceArchive(name);
View Full Code Here

  /**
   * Shuts the context down.
   */
  public void close()
  {
    EnvironmentClassLoader loader = _classLoader;
    _classLoader = null;

    if (loader != null) {
      loader.destroy();
    }
  }
View Full Code Here

  {
    if (getURL().equals("") && _parent != null) {
      _url = _parent.getURL();
    }

    EnvironmentClassLoader loader;
    loader = getEnvironmentClassLoader();

    // server/1al2
    // loader.setId("host:" + getURL());

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

    try {
      thread.setContextClassLoader(loader);

      initBam();

      // ioc/04010
      // loader needs to start first, so Host managed beans will be
      // initialized before the webappd
      loader.start();

      super.startImpl();

      if (_parent != null)
        _parent.clearCache();
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.