org.norther.tammi.core.base
Class Loader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by java.security.SecureClassLoader
          extended by java.net.URLClassLoader
              extended by org.norther.tammi.acorn.net.URLClassLoader
                  extended by org.norther.tammi.core.base.Loader
All Implemented Interfaces:
Serializable, MBeanRegistration, NotificationBroadcaster, LoaderMBean, NamePattern, ReferableMBean

public class Loader
extends URLClassLoader
implements LoaderMBean, NamePattern, MBeanRegistration, NotificationBroadcaster, Serializable

A default implementation of LoaderMBean.

Author:
Ilkka Priha
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.norther.tammi.core.base.ReferableMBean
DEFAULT_ID, ID, MBEAN, MBEAN_DESCRIPTION, TYPE
 
Constructor Summary
Loader()
          Constructs a new MBean loader.
Loader(ClassLoader parent)
          Constructs a new MBean loader with a parent.
Loader(URL[] urls)
          Constructs a new MBean loader with URLs.
Loader(URL[] urls, ClassLoader parent)
          Constructs a new MBean loader with URLs and a parent.
 
Method Summary
 void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
           
 void addURL(URL url)
          Adds a new URL to search paths.
 MBeanReference getMBean()
          Gets a reference to the MBean.
 String getNamePattern()
          Gets the name pattern as a string.
 MBeanNotificationInfo[] getNotificationInfo()
           
 ObjectName getQueryPattern()
          Gets the name pattern as an object name query.
 boolean isClassDefined(String name)
          Checks whether the named class is defined.
 void postDeregister()
           
 void postRegister(Boolean done)
           
 void preDeregister()
           
 ObjectName preRegister(MBeanServer server, ObjectName name)
           
 void removeNotificationListener(NotificationListener listener)
           
 void setNamePattern(String pattern)
          Sets the name pattern as a string.
 void setQueryPattern(ObjectName pattern)
          Sets the name pattern as an object name query.
 
Methods inherited from class org.norther.tammi.acorn.net.URLClassLoader
defineClass, defineSubclass, defineSubclass
 
Methods inherited from class java.net.URLClassLoader
definePackage, findClass, findResource, findResources, getPermissions, getURLs, newInstance, newInstance
 
Methods inherited from class java.security.SecureClassLoader
defineClass, defineClass
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.norther.tammi.core.base.LoaderMBean
defineClass, defineSubclass, defineSubclass, getResource, getResourceAsStream, getResources, getURLs, loadClass
 

Constructor Detail

Loader

public Loader()
Constructs a new MBean loader.


Loader

public Loader(URL[] urls)
Constructs a new MBean loader with URLs.

Parameters:
urls - an array of resource URLs.

Loader

public Loader(ClassLoader parent)
Constructs a new MBean loader with a parent.

Parameters:
parent - the parent class loader.

Loader

public Loader(URL[] urls,
              ClassLoader parent)
Constructs a new MBean loader with URLs and a parent.

Parameters:
urls - an array of resource URLs.
parent - the parent class loader.
Method Detail

preRegister

public ObjectName preRegister(MBeanServer server,
                              ObjectName name)
                       throws Exception
Specified by:
preRegister in interface MBeanRegistration
Throws:
Exception

postRegister

public void postRegister(Boolean done)
Specified by:
postRegister in interface MBeanRegistration

preDeregister

public void preDeregister()
                   throws Exception
Specified by:
preDeregister in interface MBeanRegistration
Throws:
Exception

postDeregister

public void postDeregister()
Specified by:
postDeregister in interface MBeanRegistration

getMBean

public MBeanReference getMBean()
Description copied from interface: ReferableMBean
Gets a reference to the MBean.

Specified by:
getMBean in interface ReferableMBean
Returns:
a reference to the MBean.

isClassDefined

public boolean isClassDefined(String name)
Description copied from interface: LoaderMBean
Checks whether the named class is defined.

Specified by:
isClassDefined in interface LoaderMBean
Parameters:
name - the name of the class.
Returns:
true if defined, false otherwise.

addURL

public void addURL(URL url)
Description copied from interface: LoaderMBean
Adds a new URL to search paths.

Specified by:
addURL in interface LoaderMBean
Overrides:
addURL in class URLClassLoader
Parameters:
url - the new URL.

getNamePattern

public String getNamePattern()
Description copied from interface: NamePattern
Gets the name pattern as a string.

Specified by:
getNamePattern in interface NamePattern
Returns:
the name pattern or null.

setNamePattern

public void setNamePattern(String pattern)
                    throws MalformedObjectNameException
Description copied from interface: NamePattern
Sets the name pattern as a string.

Specified by:
setNamePattern in interface NamePattern
Parameters:
pattern - the name pattern.
Throws:
MalformedObjectNameException - for an invalid name.

getQueryPattern

public ObjectName getQueryPattern()
Description copied from interface: NamePattern
Gets the name pattern as an object name query.

Specified by:
getQueryPattern in interface NamePattern
Returns:
the query pattern or null.

setQueryPattern

public void setQueryPattern(ObjectName pattern)
Description copied from interface: NamePattern
Sets the name pattern as an object name query. The name pattern is applied when generating a unique name during registration of an unnamed MBean.

Specified by:
setQueryPattern in interface NamePattern
Parameters:
pattern - the query pattern.

addNotificationListener

public void addNotificationListener(NotificationListener listener,
                                    NotificationFilter filter,
                                    Object handback)
Specified by:
addNotificationListener in interface NotificationBroadcaster

removeNotificationListener

public void removeNotificationListener(NotificationListener listener)
                                throws ListenerNotFoundException
Specified by:
removeNotificationListener in interface NotificationBroadcaster
Throws:
ListenerNotFoundException

getNotificationInfo

public MBeanNotificationInfo[] getNotificationInfo()
Specified by:
getNotificationInfo in interface NotificationBroadcaster


Copyright © 2004 The Norther Organization. All rights reserved.