org.mule.modules.boot
Class ReflectionHelper

java.lang.Object
  extended byorg.mule.modules.boot.ReflectionHelper

public class ReflectionHelper
extends Object

JRockit VM has problems with MuleBootstrap's approach. Namely, for jars loaded dynamically into a system classloader (launcher) it can't resolve static method calls. At the same time, inspecting the dynamically loaded class reports all methods as available. The class implements all such calls via reflection as a workaround. Sun's VM had no problems with the original approach, and doesn't have any with this workaround either.


Method Summary
static String[][] getCliOptions()
          Workaround for JRockit unable to access a public static field value.
static String getCommandLineOption(String option, String[] args, String[][] opts)
          Wrap SystemUtils.getCommandLineOption(String, String[], String[][]).
static URL getResource(String resourceName, Class callingClass)
          Wrap ClassUtils.getResource(String, Class).
static boolean isClassOnPath(String className, Class currentClass)
          Wrap ClassUtils.isClassOnPath(String, Class).
static void wrapperMain(String[] args)
          Wrap WrapperSimpleApp.main(String[]).
static void wrapperStop(int exitCode)
          Wrap WrapperSimpleApp.stop(int).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getResource

public static URL getResource(String resourceName,
                              Class callingClass)
                       throws Exception
Wrap ClassUtils.getResource(String, Class).

Parameters:
resourceName - The name of the resource to load
callingClass - The Class object of the calling object
Throws:
Exception

isClassOnPath

public static boolean isClassOnPath(String className,
                                    Class currentClass)
                             throws Exception
Wrap ClassUtils.isClassOnPath(String, Class).

Parameters:
className - The class name to look for
currentClass - the calling class
Returns:
true if the class is on the path
Throws:
Exception

getCliOptions

public static String[][] getCliOptions()
                                throws Exception
Workaround for JRockit unable to access a public static field value.

Returns:
value of MuleServer.CLI_OPTIONS
Throws:
Exception

getCommandLineOption

public static String getCommandLineOption(String option,
                                          String[] args,
                                          String[][] opts)
                                   throws Exception
Wrap SystemUtils.getCommandLineOption(String, String[], String[][]).

Throws:
Exception

wrapperMain

public static void wrapperMain(String[] args)
                        throws Exception
Wrap WrapperSimpleApp.main(String[]).

Throws:
Exception

wrapperStop

public static void wrapperStop(int exitCode)
                        throws Exception
Wrap WrapperSimpleApp.stop(int).

Throws:
Exception


Copyright © 2003-2008 MuleSource, Inc.. All Rights Reserved.