KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > hero > performerAssign > PerformerAssign


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: PerformerAssign.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 import java.io.Serializable JavaDoc;
35
36 public abstract class PerformerAssign implements Serializable JavaDoc{
37
38
39     public static final int CALLBACK=0;
40     public static final int PROPERTY=1;
41     
42     private String JavaDoc name;
43     private int type;
44
45     public static PerformerAssign make(String JavaDoc name, int type) throws HeroException {
46     if (type==CALLBACK) return new CallbackPerformerAssign(name,type);
47     if (type==PROPERTY) return new PropertyPerformerAssign(name,type);
48     throw new HeroException("Wrong PerformerAssign Type " + type);
49     }
50
51     protected PerformerAssign(String JavaDoc name, int type) {
52     this.name=name;
53     this.type=type;
54     }
55
56     public String JavaDoc getName() {return this.name;}
57     public void setName(String JavaDoc name) {this.name=name;}
58
59     public int getType() {return this.type;}
60     public void setType(int type) {this.type=type;}
61
62     public String JavaDoc toXML() {
63     String JavaDoc result=new String JavaDoc();
64     result="<performerAssign name=\""+this.getName()+
65         "\" type=\""+this.getType()+"\"/>";
66     return result;
67     }
68
69     public abstract void execute(Object JavaDoc bean, int type, BnNodeLocal role, String JavaDoc userName) throws HeroException;
70
71 }
72
Popular Tags