LogUtils.DEBUG( "Classloader finished..." );
}
catch (MalformedURLException mfe )
{
// Framework error
throw new ScriptFrameworkErrorException(
mfe.getMessage(), null,
metaData.getLanguageName(), metaData.getLanguage(),
ScriptFrameworkErrorType.MALFORMED_URL );
}
catch (NoSuitableClassLoaderException ncl )
{
// Framework error
throw new ScriptFrameworkErrorException(
ncl.getMessage(), null,
metaData.getLanguageName(), metaData.getLanguage(),
ScriptFrameworkErrorType.UNKNOWN );
}
catch (ArrayStoreException e )
{
// Framework error
throw new ScriptFrameworkErrorException(
e.getMessage(), null,
metaData.getLanguageName(), metaData.getLanguage(),
ScriptFrameworkErrorType.UNKNOWN );
}
ArrayList invocationArgList = new ArrayList();
Object[] invocationArgs = null;
LogUtils.DEBUG( "Parameter Mapping..." );
// Setup Context Object
XScriptContext xSc = ScriptContext.createContext(m_xModel, m_xInvocContext,
m_xContext, m_xMultiComponentFactory);
scriptDesc.addArgumentType( XScriptContext.class );
invocationArgList.add( xSc );
for ( int i = 0; i < params.length; i++ )
{
scriptDesc.addArgumentType( params[ i ].getClass() );
invocationArgList.add( params[ i ] );
}
if ( !invocationArgList.isEmpty() )
{
invocationArgs = invocationArgList.toArray();
}
LogUtils.DEBUG( "ScriptProxy starting... " );
ScriptProxy script = null;
try
{
String className = metaData.getLanguageName().substring( 0,
metaData.getLanguageName().lastIndexOf( '.' ) );
LogUtils.DEBUG( "About to load Class " + className + " starting... " );
long start = new java.util.Date().getTime();
Class c = scriptLoader.loadClass( className );
long end = new java.util.Date().getTime();
LogUtils.DEBUG("loadClass took: " + String.valueOf(end - start) +
"milliseconds");
try
{
LogUtils.DEBUG( "class loaded ... " );
script = m_resolutionPolicy.getProxy( scriptDesc, c );
LogUtils.DEBUG( "script resolved ... " );
}
catch( NoSuchMethodException e )
{
// Framework error
throw new ScriptFrameworkErrorException(
e.getMessage(), null,
metaData.getLanguageName(), metaData.getLanguage(),
ScriptFrameworkErrorType.NO_SUCH_SCRIPT );
}
}
catch ( ClassNotFoundException e )
{
// Framework error
throw new ScriptFrameworkErrorException(
e.getMessage(), null,
metaData.getLanguageName(), metaData.getLanguage(),
ScriptFrameworkErrorType.NO_SUCH_SCRIPT );
}
LogUtils.DEBUG( "Starting Invoke on Proxy ..." );
Object result = null;
try
{
long start = new java.util.Date().getTime();
result = script.invoke( invocationArgs );
long end = new java.util.Date().getTime();
LogUtils.DEBUG("invoke took: " +
String.valueOf(end - start) + "milliseconds");
}
catch ( java.lang.IllegalArgumentException iae )
{
throw new ScriptFrameworkErrorException(
iae.getMessage(), null,
metaData.getLanguageName(), metaData.getLanguage(),
ScriptFrameworkErrorType.UNKNOWN );
}
catch ( java.lang.IllegalAccessException ia )
{
throw new ScriptFrameworkErrorException(
ia.getMessage(), null,
metaData.getLanguageName(), metaData.getLanguage(),
ScriptFrameworkErrorType.UNKNOWN );
}
catch ( java.lang.reflect.InvocationTargetException ite )