org.ow2.jasmine.monitoring.mbeancmd.osgi
Class CommandDispatcher

java.lang.Object
  extended by org.ow2.jasmine.monitoring.mbeancmd.CommandDispatcher
      extended by org.ow2.jasmine.monitoring.mbeancmd.osgi.CommandDispatcher

public class CommandDispatcher
extends org.ow2.jasmine.monitoring.mbeancmd.CommandDispatcher

This is the main class of the archive. It dispatches the processing of the command to the right class. The available commands in the current archive are retrieved by introspection of the archive.


Constructor Summary
CommandDispatcher()
           
 
Method Summary
protected  java.io.InputStreamReader getInputStreamReader(java.lang.String name)
          Return an inputStreamReader for the specified resource, by using the bundle context.
protected  java.lang.Class<?> loadClass(java.lang.String cname)
          Load and return a class for a given class name, by using the bundle context.
static void removeContext()
          Delete the reference to the bundle context.
static void setContext(org.osgi.framework.BundleContext context)
          Set a bundle context
 
Methods inherited from class org.ow2.jasmine.monitoring.mbeancmd.CommandDispatcher
getAvailableCommands, getCommand, init, isEmbedded, isOSGiEnabled, main, setEmbedded, setOSGiEnabled, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandDispatcher

public CommandDispatcher()
Method Detail

setContext

public static void setContext(org.osgi.framework.BundleContext context)
Set a bundle context

Parameters:
context - bundle context

removeContext

public static void removeContext()
Delete the reference to the bundle context.


getInputStreamReader

protected java.io.InputStreamReader getInputStreamReader(java.lang.String name)
                                                  throws java.io.IOException
Return an inputStreamReader for the specified resource, by using the bundle context.

Overrides:
getInputStreamReader in class org.ow2.jasmine.monitoring.mbeancmd.CommandDispatcher
Parameters:
name - the resource name
Returns:
an inputStreamReader for the specified resource
Throws:
java.io.IOException - if an I/O exception occurs

loadClass

protected java.lang.Class<?> loadClass(java.lang.String cname)
                                throws java.lang.ClassNotFoundException
Load and return a class for a given class name, by using the bundle context.

Overrides:
loadClass in class org.ow2.jasmine.monitoring.mbeancmd.CommandDispatcher
Parameters:
cname - a class name
Returns:
a loaded class for a given class name
Throws:
java.lang.ClassNotFoundException - if the class cannot be found


Copyright © 2010 OW2 Consortium. All Rights Reserved.