Package com.sun.enterprise.loader

Examples of com.sun.enterprise.loader.EJBClassLoader


     */
    public Application getDescriptor(
        String moduleID, ClassLoader parentClassLoader)
            throws ConfigException {

        ClassLoader cl = new EJBClassLoader(parentClassLoader);
        String[] classPaths = (String[]) EJBClassPathUtils.getModuleClasspath(
                                moduleID, null, this).toArray(new String[0]);

        if (classPaths != null) {
            int classPathSize    = classPaths.length;
View Full Code Here


    try {
      //System RARs are placed in classpath and hence would be handled
      //by the parent classloader
      if(!ResourcesUtil.createInstance().belongToSystemRar(rarName)) {
        File file= new File(moduleDir);
        EJBClassLoader cl= new EJBClassLoader(parent);
        cl.appendURL(file.toURI().toURL());
        classLoaderChain.add(cl);
        rarModuleClassLoaders.put(rarName, cl);
      }
    } catch (MalformedURLException ex) {
      _logger.log(
View Full Code Here

   * list
   *
   * @param moduleName the connector module that needs to be removed.
   */
  public void removeResourceAdapter(String moduleName) {
    EJBClassLoader classLoaderToRemove=
    (EJBClassLoader) rarModuleClassLoaders.get(moduleName);
    if (classLoaderToRemove != null) {
      classLoaderChain.remove(classLoaderToRemove);
      rarModuleClassLoaders.remove(moduleName);
      classLoaderToRemove = null;
View Full Code Here

    }
         
    //Going through the connector module classloader chain to find
    // class and return the first match.
    for (Iterator iter= classLoaderChain.iterator(); iter.hasNext();) {
      EJBClassLoader ccl= (EJBClassLoader) iter.next();
      try {
        clz= ccl.loadClass(name);
        if (clz != null){
          if(resolve) {
            resolveClass(clz);
          }
          return clz;
View Full Code Here

     */
   
    public String getClasspath(){
            StringBuffer strBuf = new StringBuffer();
            for (int i = 0; i < classLoaderChain.size(); i++) {
                    EJBClassLoader ecl= (EJBClassLoader) classLoaderChain.get(i);
                    String eclClasspath = ecl.getClasspath();
                    if ( eclClasspath != null) {
                            if (i > 0) strBuf.append(File.pathSeparator);
                            strBuf.append(eclClasspath);
                    }
            }
View Full Code Here

    /**
     * Returns the classloader for the module
     * @return ClassLoader
     */
    public ClassLoader getModuleClassLoader() {
        return new EJBClassLoader();
    }
View Full Code Here

     * @return ClassLoader
     * @throws IOException
     */
    protected ClassLoader createClassLoader()
            throws IOException {
        EJBClassLoader ejbClassLoader = new EJBClassLoader(webd.getClassLoader());
        ejbClassLoader.appendURL(jspOutDir);
        return ejbClassLoader;
    }
View Full Code Here

    private ClassLoader createClassLoader(AbstractArchive archive, URL[] persistenceURLs)
        throws IOException {
        List<String> paths = getClassPaths(archive);
        ClassLoader parent = Thread.currentThread().getContextClassLoader();
        EJBClassLoader loader = new EJBClassLoader(parent);

        final int LIST_SZ = paths.size();
        for (int i=0; i<LIST_SZ; i++) {
            String path = paths.get(i);
            loader.appendURL(new File(path));
        }
       
        if (_logger.isLoggable(Level.FINE)) {
            for (int i = 0; i < paths.size(); i++) {
                _logger.fine("Added path to classloader ==> " + paths.get(i));
            }
        }
       
        for (URL url : persistenceURLs) {
            loader.appendURL(url);
            _logger.fine("Added path to classloader ==> " + url);
        }

        return loader;
    }
View Full Code Here

            /*
             *Use the list of class paths already set up on the EJBClassLoader.
             *Then for each element in the class path, write a part of the policy
             *file granting the privs specified in the selected template to the code path.
             */
            EJBClassLoader loader = (EJBClassLoader) getClassLoader();
            for (URL classPathElement : loader.getURLs()) {
                /*
                 *Convert the URL into a proper codebase expression suitable for
                 *a grant clause in the policy file.
                 */
                String codeBase = Util.URLtoCodeBase(classPathElement);
View Full Code Here

     *                                   class loader
     */
    public static EJBClassLoader getClassLoader(List paths, ClassLoader parent,
            File other) throws IOException {

        EJBClassLoader ejbCl  = null;

        if (parent != null) {
            ejbCl  = new EJBClassLoader(parent);
        } else {
            ejbCl  = new EJBClassLoader();
        }

        final int LIST_SZ = paths.size();
        for (int i=0; i<LIST_SZ; i++) {
            String path = (String) paths.get(i);
            ejbCl.appendURL(new File(path));
        }

        if (other != null) {
            ejbCl.appendURL(other);
        }

        return ejbCl;
    }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.loader.EJBClassLoader

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.