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: DeployedEntities.java,v 1.3 2005/08/29 13:39:05 mvaldes Exp $
26: *
27: --------------------------------------------------------------------------
28: */package hero.client.samples;
29:
30: import java.util.Collection;
31: import java.util.Iterator;
32:
33: import javax.security.auth.login.LoginContext;
34: import hero.client.test.SimpleCallbackHandler;
35:
36: import hero.interfaces.Constants;
37:
38: import hero.interfaces.AdminSession;
39: import hero.interfaces.AdminSessionHome;
40: import hero.interfaces.AdminSessionUtil;
41:
42: public class DeployedEntities {
43:
44: static public void main(String[] args) throws Exception {
45: // Admin login
46: char[] password = { 't', 'o', 't', 'o' };
47: SimpleCallbackHandler handler = new SimpleCallbackHandler(
48: "admin", password);
49: LoginContext lc = new LoginContext("TestClient", handler);
50: lc.login();
51:
52: AdminSessionHome ah = AdminSessionUtil.getHome();
53: AdminSession as = ah.create();
54:
55: // Hooks list
56: Collection hooks = as.getJavaHooks(Constants.Nd.BEFORESTART);
57: Iterator i = hooks.iterator();
58: while (i.hasNext())
59: System.out.println("HookName, BeforeStart = " + i.next());
60:
61: hooks = as.getJavaHooks(Constants.Nd.AFTERSTART);
62: i = hooks.iterator();
63: while (i.hasNext())
64: System.out.println("HookName, Aftertart = " + i.next());
65:
66: hooks = as.getJavaHooks(Constants.Nd.ONDEADLINE);
67: i = hooks.iterator();
68: while (i.hasNext())
69: System.out.println("HookName, OnDeadline = " + i.next());
70:
71: hooks = as.getJavaHooks(Constants.Pj.ONINSTANTIATE);
72: i = hooks.iterator();
73: while (i.hasNext())
74: System.out.println("HookName, OnInstantiate = " + i.next());
75:
76: // Mapper list
77: Collection mappers = as.getCustomMappers();
78: i = mappers.iterator();
79: while (i.hasNext())
80: System.out.println("MapperName = " + i.next());
81:
82: // Performer assignments list
83: Collection performers = as.getCallbackPerformers();
84: i = performers.iterator();
85: while (i.hasNext())
86: System.out.println("PerformerName = " + i.next());
87:
88: // Performer assignments list
89: Collection initiators = as.getCustomInitiators();
90: i = initiators.iterator();
91: while (i.hasNext())
92: System.out.println("InitiatorName = " + i.next());
93:
94: }
95: }
|