Package com.caucho.loader

Examples of com.caucho.loader.EnvironmentClassLoader


  public void run()
  {
    if (! _lifecycle.toActive())
      return;

    EnvironmentClassLoader envLoader
      = EnvironmentClassLoader.create(_system.getClassLoader());
   
    Thread thread = Thread.currentThread();
   
    WriteStream jvmOut = null;
    ServerSocket ss = null;
    Socket s = null;

    try {
      thread.setContextClassLoader(envLoader);
      envLoader.start();

      ss = new ServerSocket(0, 5, InetAddress.getByName("127.0.0.1"));

      int port = ss.getLocalPort();
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

    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

   * 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

    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

  {
    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

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

    EnvironmentClassLoader loader = _classLoader;

    // 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();
     
      getWebAppContainer().start();

      if (_parent != null)
        _parent.clearCache();
View Full Code Here

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

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

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

      _webAppContainer.stop();

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

      envLoader.stop();

      return true;
    } finally {
      _lifecycle.toStop();
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.