org.jboss.test.classloader.resource
Class ResourceTest

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src) 
      extended byorg.jboss.system.ServiceMBeanSupport (src) 
          extended byorg.jboss.test.classloader.resource.ResourceTest
All Implemented Interfaces:
MBeanRegistration (src) , NotificationBroadcaster (src) , NotificationEmitter (src) , ResourceTestMBean (src) , java.lang.Runnable, Service (src) , ServiceMBean (src)

public class ResourceTest
extends ServiceMBeanSupport (src)
implements ResourceTestMBean (src) , java.lang.Runnable

A simple service to test resource loading.


Field Summary
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport (src)
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean (src)
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
ResourceTest()
           
 
Method Summary
 void findResources()
          Check that the URLClassLoader.getResources locates the resource across the repository class loader.
 java.lang.String getDtdName()
           
 void loadGlobalResource()
          Checks we can find a global resource located in the conf dir
 void loadLocalResource()
          Checks we can find a local resource in our deployment unit
 void run()
          Load resources in the background to test MT access to the repository during resource lookup
 void setDtdName(java.lang.String dtdName)
           
protected  void startService()
          Sub-classes should override this method to provide custum 'start' logic.
protected  void stopService()
          Sub-classes should override this method to provide custum 'stop' logic.
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport (src)
create, createService, destroy, destroyService, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, stop
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport (src)
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.system.ServiceMBean (src)
getName, getState, getStateString, jbossInternalLifecycle
 
Methods inherited from interface org.jboss.system.Service (src)
create, destroy, start, stop
 

Constructor Detail

ResourceTest

public ResourceTest()
Method Detail

getDtdName

public java.lang.String getDtdName()
Specified by:
getDtdName in interface ResourceTestMBean (src)

setDtdName

public void setDtdName(java.lang.String dtdName)
Specified by:
setDtdName in interface ResourceTestMBean (src)

startService

protected void startService()
                     throws java.lang.Exception
Description copied from class: ServiceMBeanSupport (src)
Sub-classes should override this method to provide custum 'start' logic.

This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.

Overrides:
startService in class ServiceMBeanSupport (src)
Throws:
java.lang.Exception

stopService

protected void stopService()
                    throws java.lang.Exception
Description copied from class: ServiceMBeanSupport (src)
Sub-classes should override this method to provide custum 'stop' logic.

This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.

Overrides:
stopService in class ServiceMBeanSupport (src)
Throws:
java.lang.Exception

loadLocalResource

public void loadLocalResource()
                       throws java.lang.Exception
Checks we can find a local resource in our deployment unit

Throws:
java.lang.Exception

loadGlobalResource

public void loadGlobalResource()
                        throws java.lang.Exception
Checks we can find a global resource located in the conf dir

Throws:
java.lang.Exception

findResources

public void findResources()
                   throws java.lang.Exception
Check that the URLClassLoader.getResources locates the resource across the repository class loader.

Throws:
java.lang.Exception

run

public void run()
Load resources in the background to test MT access to the repository during resource lookup

Specified by:
run in interface java.lang.Runnable