KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > hero > performerAssign > PropertyPerformerAssign


1 /**
2  *
3  * Bonita
4  * Copyright (C) 1999 Bull S.A.
5  * Bull 68 route de versailles 78434 Louveciennes Cedex France
6  * Further information: bonita@objectweb.org
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
21  * USA
22  *
23  *
24 --------------------------------------------------------------------------
25  * $Id: PropertyPerformerAssign.java,v 1.1 2004/07/30 14:57:58 mvaldes Exp $
26  *
27 --------------------------------------------------------------------------
28  */

29
30 package hero.performerAssign;
31
32 import hero.interfaces.BnNodeLocal;
33 import hero.util.HeroException;
34
35 import java.lang.reflect.InvocationTargetException JavaDoc;
36 import java.lang.reflect.Method JavaDoc;
37
38 import org.apache.log4j.Category;
39
40 public class PropertyPerformerAssign extends PerformerAssign {
41
42     // Utility variable
43
private static final Category log = Category.getInstance(PropertyPerformerAssign.class);
44
45
46     public PropertyPerformerAssign(String JavaDoc name, int type) {
47     super(name,type);
48     }
49
50     public void execute(Object JavaDoc bean, int type, BnNodeLocal node, String JavaDoc userName) throws HeroException {
51     log.debug("execute: type="+type+" node="+node.getName());
52         
53     try {
54         Class JavaDoc clperformerAssign=Class.forName("hero.performerAssign.PropertySelectActors");
55         NodePerformerAssignI ndh =(NodePerformerAssignI)clperformerAssign.newInstance();
56         Class JavaDoc[] param={
57         Class.forName("java.lang.Object"),
58         Class.forName("hero.interfaces.BnNodeLocal"),
59         Class.forName("java.lang.String")};
60         Method JavaDoc evth=clperformerAssign.getMethod("selectActors",param);
61         Object JavaDoc[] o={bean,node,userName};
62         evth.invoke(ndh,o);
63     } catch (InvocationTargetException JavaDoc ite) {
64         ite.printStackTrace();
65         throw new HeroException("Failure during performerAssign execution : " + ite.getMessage());
66     } catch (Exception JavaDoc e) {
67         throw new HeroException("Dynamic invocation of performerAssign failed :"+this.getName()+" Node:"+node.getName()+"--> performerAssign type = "+type+" ///"+e);
68     }
69     }
70
71
72 }
73
Popular Tags