public JarClassLoader[] deploy(final String jarNames[],final byte[][] jarBytes) throws IOException, ClassNotFoundException {
  JarClassLoader[] jarClassLoaders=new JarClassLoader[jarNames.length];
  verifyWritableDeployDirectory();
  lock.lock();
  try {
    for (int i=0; i < jarNames.length; i++) {
      if (!JarClassLoader.isValidJarContent(jarBytes[i])) {
        throw new IllegalArgumentException("File does not contain valid JAR content: " + jarNames[i]);
      }
    }
    for (int i=0; i < jarNames.length; i++) {
      jarClassLoaders[i]=deployWithoutRegistering(jarNames[i],jarBytes[i]);
    }
    for (    JarClassLoader jarClassLoader : jarClassLoaders) {
      if (jarClassLoader != null) {
        jarClassLoader.loadClassesAndRegisterFunctions();
      }
    }
  }
  finally {
    lock.unlock();
  }
  return jarClassLoaders;
}

public JarClassLoader [ ] deploy ( final String jarNames [ ] , final byte [ ] [ ] jarBytes ) throws IOException , ClassNotFoundException { JarClassLoader [ ] jarClassLoaders = new JarClassLoader [ jarNames . length ] ; verifyWritableDeployDirectory ( ) ; lock . lock ( ) ; try { for ( int i = 0 ; i < jarNames . length ; i ++ ) { if ( ! JarClassLoader . isValidJarContent ( jarBytes [ i ] ) ) { throw new IllegalArgumentException ( "File does not contain valid JAR content: " + jarNames [ i ] ) ; } } for ( int i = 0 ; i < jarNames . length ; i ++ ) { jarClassLoaders [ i ] = deployWithoutRegistering ( jarNames [ i ] , jarBytes [ i ] ) ; } for ( JarClassLoader jarClassLoader : jarClassLoaders ) { if ( jarClassLoader != null ) { jarClassLoader . loadClassesAndRegisterFunctions ( ) ; } } } finally { lock . unlock ( ) ; } return jarClassLoaders ; }
deploy the given jar files .
