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: TestDeadlineNodeStart.java,v 1.1 2005/09/26 08:10:59 mvaldes Exp $
26: *
27: --------------------------------------------------------------------------
28: */package hero.hook;
29:
30: import hero.util.HeroHookException;
31: import hero.interfaces.BnNodeLocal;
32: import hero.interfaces.Constants;
33: import hero.interfaces.*;
34:
35: public class TestDeadlineNodeStart implements hero.hook.NodeHookI {
36:
37: public String getMetadata() {
38: return Constants.Nd.ONDEADLINE;
39: }
40:
41: public void create(Object b, BnNodeLocal n)
42: throws HeroHookException {
43:
44: }
45:
46: public void beforeStart(Object b, BnNodeLocal n)
47: throws HeroHookException {
48: }
49:
50: public void afterStart(Object b, BnNodeLocal n)
51: throws HeroHookException {
52: }
53:
54: public void beforeTerminate(Object b, BnNodeLocal n)
55: throws HeroHookException {
56: }
57:
58: public void afterTerminate(Object b, BnNodeLocal n)
59: throws HeroHookException {
60: }
61:
62: public void onCancel(Object b, BnNodeLocal n)
63: throws HeroHookException {
64: }
65:
66: public void anticipate(Object b, BnNodeLocal n)
67: throws HeroHookException {
68: }
69:
70: public void onReady(Object b, BnNodeLocal n)
71: throws HeroHookException {
72: }
73:
74: public void onDeadline(Object b, BnNodeLocal n)
75: throws HeroHookException {
76: try {
77: String name = n.getName();
78: System.out.println("Deadline Test, node name: " + name);
79: UserSessionLocalHome ush = UserSessionUtil.getLocalHome();
80: UserSessionLocal usl = ush.create();
81: usl.terminateActivity(n.getBnProject().getName(), name);
82: } catch (Exception e) {
83: e.printStackTrace();
84: }
85: }
86:
87: }
|