Caucho maker of Resin Server | Application Server (Java EE Certified) and Web Server


 

Resin Documentation

Aug 2012: Resin outscales C-based web server nginx in AutoBench benchmark
Feb 2012: NetCraft survey says Resin experiencing strong growth in last year and used in number of the Million Busiest Sites.
home company blog wiki docs 
app server web server 
health cloud java ee pro 
 Resin Server | Application Server (Java EE Certified) and Web Server
 

environment: class loaders


Resin organizes resources and classloaders into nested environments. Each environment context merges its own configuration with configuration inherited from the parent environment. Each environment context: server, host, web-app, etc. may be configured with any of the environment configuration tags.

Classloaders

class-loader

Adds dynamic classloaders to the current environment.

Each environment (<server>, <host>, <web-app>) etc, can add dynamic classloaders. The environment will inherit the parent classloaders. Each <class-loader> is comprised of several implementing loader items: library-loader for WEB-INF/lib, compiling-loader for WEB-INF/classes, even make-loader for more complex auto-compilation.

<class-loader> in resin-web.xml
<web-app xmlns="http://caucho.com/ns/resin">
  <prologue>
    <class-loader>
      <compiling-loader path="WEB-INF/classes"/>

      <library-loader path="WEB-INF/lib"/>
    </class-loader>
  </prologue>
</web-app>

compiling-loader

child of class-loader

Configures an auto-compiling WEB-INF/classes-style class loader.

The compiling-loader will automatically compile Java code into .class files loading them.

compiling-loader Attributes
ATTRIBUTEDESCRIPTIONDEFAULT
argsAdditional arguments to be passed to the Java compiler. Resin 3.0none
batchIf true, multiple changed *.java files will be compiled in a single batch. Resin 3.0.7true
encodingI18N encoding for the Java compiler. Since Resin 3.0none
pathFilesystem path for the class loader. Since Resin 3.0required
sourceJava source directory. Since Resin 3.0value of path
require-sourceIf true, .class files without matching .java files will be deleted. Since Resin 3.0false

library-loader

child of class-loader

Configures a jar library, WEB-INF/lib-style class loader.

The library-loader will add jar files in its path to the current classpath. Jar files are recognized when they have a filename extension of .jar or .zip.

library-loader Attributes
ATTRIBUTEDESCRIPTIONDEFAULT
pathFilesystem path for the class loader. Since Resin 3.0required

See com.caucho.loader.DirectoryLoader.

tree-loader

child of class-loader

Configures a jar library, WEB-INF/lib-style class loader similar to library-loader, but will also find .jar and .zip files in subdirectories.

tree-loader Attributes
ATTRIBUTEDESCRIPTIONDEFAULT
pathFilesystem path for the class loader. Since Resin 3.0required

See com.caucho.loader.TreeLoader.

make-loader

child of class-loader

Configures a custom make-style loader.

servlet-hack

child of class-loader

Use of servlet-hack is discouraged. Using servlet-hack violates the JDK's classloader delegation model and can produce surprising ClassCastExceptions.

servlet-hack reverses the normal class loader order. Instead of parent classloaders having priority, child classloaders have priority.

simple-loader

child of class-loader

Configures a simple classes-style class loader.

.class files in the specified directory will be loaded without any special compilation steps (in contrast with compiling-loader.)

simple-loader Attributes
ATTRIBUTEDESCRIPTIONDEFAULT
pathFilesystem path for the class loader. Since Resin 3.0required
prefixClass package prefix to only load to a subset of classes. Resin 3.0none

Copyright © 1998-2012 Caucho Technology, Inc. All rights reserved. Resin ® is a registered trademark. Quercustm, and Hessiantm are trademarks of Caucho Technology.