01: /**
02: *
03: * Bonita
04: * Copyright (C) 1999 Bull S.A.
05: * Bull 68 route de versailles 78434 Louveciennes Cedex France
06: * Further information: bonita@objectweb.org
07: *
08: * This library is free software; you can redistribute it and/or
09: * 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: */package hero.performerAssign;
29:
30: import hero.interfaces.BnNodeLocal;
31: import hero.util.HeroException;
32: import java.io.Serializable;
33:
34: public abstract class PerformerAssign implements Serializable {
35:
36: public static final int CALLBACK = 0;
37: public static final int PROPERTY = 1;
38:
39: private String name;
40: private int type;
41:
42: public static PerformerAssign make(String name, int type)
43: throws HeroException {
44: if (type == CALLBACK)
45: return new CallbackPerformerAssign(name, type);
46: if (type == PROPERTY)
47: return new PropertyPerformerAssign(name, type);
48: throw new HeroException("Wrong PerformerAssign Type " + type);
49: }
50:
51: protected PerformerAssign(String name, int type) {
52: this .name = name;
53: this .type = type;
54: }
55:
56: public String getName() {
57: return this .name;
58: }
59:
60: public void setName(String name) {
61: this .name = name;
62: }
63:
64: public int getType() {
65: return this .type;
66: }
67:
68: public void setType(int type) {
69: this .type = type;
70: }
71:
72: public String toXML() {
73: String result = new String();
74: result = "<performerAssign name=\"" + this .getName()
75: + "\" type=\"" + this .getType() + "\"/>";
76: return result;
77: }
78:
79: public abstract void execute(Object bean, int type,
80: BnNodeLocal role, String userName) throws HeroException;
81:
82: }
|