1 package hero.util; 2 3 /** 4 * 5 * Bonita 6 * Copyright (C) 1999 Bull S.A. 7 * Bull 68 route de versailles 78434 Louveciennes Cedex France 8 * Further information: bonita@objectweb.org 9 * 10 * This library is free software; you can redistribute it and/or 11 * modify it under the terms of the GNU Lesser General Public 12 * License as published by the Free Software Foundation; either 13 * version 2.1 of the License, or any later version. 14 * 15 * This library is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 * Lesser General Public License for more details. 19 * 20 * You should have received a copy of the GNU Lesser General Public 21 * License along with this library; if not, write to the Free Software 22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 23 * USA 24 * 25 * 26 -------------------------------------------------------------------------- 27 * $Id: BonitaLoadClassService.java,v 1.2 2004/11/10 17:10:50 mvaldes Exp $ 28 * 29 -------------------------------------------------------------------------- 30 */ 31 32 import java.io.File; 33 import javax.naming.Context; 34 35 import org.objectweb.jonas.common.JProp; 36 import org.objectweb.jonas.server.JClassLoader; 37 import org.objectweb.jonas.service.AbsServiceImpl; 38 import org.objectweb.jonas.service.ServiceException; 39 40 41 public class BonitaLoadClassService extends AbsServiceImpl implements BonitaLoadClassServiceMBean 42 { 43 44 JClassLoader serviceLoader = null; 45 46 private static final String JONAS_BASE = JProp.getJonasBase(); 47 private static final String JARS_DIR = JONAS_BASE + File.separator + "bonitaScripts"; 48 49 public void doInit(Context ctx) { 50 51 try { 52 serviceLoader = (JClassLoader) Thread.currentThread().getContextClassLoader(); 53 File f = new File(JARS_DIR); 54 serviceLoader.addURL(f.toURI().toURL()); 55 } catch (java.net.MalformedURLException e) { 56 e.printStackTrace(); 57 } 58 59 } 60 61 public void doStart() throws ServiceException { 62 } 63 64 public void doStop() throws ServiceException { 65 } 66 67 } 68 69 70