org.norther.tammi.core.base
Interface LoaderMBean

All Superinterfaces:
ReferableMBean
All Known Implementing Classes:
Loader

public interface LoaderMBean
extends ReferableMBean

An interface to class loader MBeans supporting loading of assembled classes dynamically.

Author:
Ilkka Priha

Field Summary
 
Fields inherited from interface org.norther.tammi.core.base.ReferableMBean
DEFAULT_ID, ID, MBEAN, MBEAN_DESCRIPTION, TYPE
 
Method Summary
 void addURL(URL url)
          Adds a new URL to search paths.
 Class defineClass(String name, org.objectweb.asm.ClassWriter cw)
          Defines an assembled class.
 Class defineSubclass(String name, Class clazz)
          Defines a subclass for a class with all super constructors.
 Class defineSubclass(String name, Class clazz, short access)
          Defines a subclass for a class with all super constructors but modified access flags.
 URL getResource(String name)
          Gets a resource with the specified name by going through the class loader hierarchy.
 InputStream getResourceAsStream(String name)
          Gets an input stream for reading the specified resource.
 Enumeration getResources(String name)
          Gets all resources with the given name by going through the class loader hierarchy.
 URL[] getURLs()
          Gets the array of URL search paths.
 boolean isClassDefined(String name)
          Checks whether the named class is defined.
 Class loadClass(String name)
          Loads the class with the specified name.
 
Methods inherited from interface org.norther.tammi.core.base.ReferableMBean
getMBean
 

Method Detail

getResource

URL getResource(String name)
Gets a resource with the specified name by going through the class loader hierarchy.

Parameters:
name - the resource name.
Returns:
a URL for reading the resource, or null if not found.

getResourceAsStream

InputStream getResourceAsStream(String name)
Gets an input stream for reading the specified resource.

Parameters:
name - the resource name.
Returns:
an input stream, or null if not found.

getResources

Enumeration getResources(String name)
                         throws IOException
Gets all resources with the given name by going through the class loader hierarchy.

Parameters:
name - the resource name.
Returns:
an enumeration of URLs to resources.
Throws:
IOException - for I/O errors.

isClassDefined

boolean isClassDefined(String name)
Checks whether the named class is defined.

Parameters:
name - the name of the class.
Returns:
true if defined, false otherwise.

loadClass

Class loadClass(String name)
                throws ClassNotFoundException
Loads the class with the specified name.

Parameters:
name - the name of the class.
Returns:
the loaded class.
Throws:
ClassNotFoundException - if not found.

defineClass

Class defineClass(String name,
                  org.objectweb.asm.ClassWriter cw)
                  throws ClassFormatError
Defines an assembled class.

Parameters:
name - the name of the class.
cw - the class writer.
Returns:
the defined class.
Throws:
ClassFormatError - if the definition is invalid.

defineSubclass

Class defineSubclass(String name,
                     Class clazz)
                     throws ClassFormatError
Defines a subclass for a class with all super constructors.

Parameters:
name - the name of the class.
clazz - the superclass.
Returns:
the defined class.
Throws:
ClassFormatError - if the definition is invalid.

defineSubclass

Class defineSubclass(String name,
                     Class clazz,
                     short access)
                     throws ClassFormatError
Defines a subclass for a class with all super constructors but modified access flags.

Parameters:
name - the name of the class.
clazz - the superclass.
access - access flags.
Returns:
the defined class.
Throws:
ClassFormatError - if the definition is invalid.

getURLs

URL[] getURLs()
Gets the array of URL search paths.

Returns:
an array of URLs.

addURL

void addURL(URL url)
Adds a new URL to search paths.

Parameters:
url - the new URL.


Copyright © 2004 The Norther Organization. All rights reserved.