1 29 30 package hero.client.samples; 31 32 import javax.security.auth.login.LoginContext ; 33 import hero.client.test.SimpleCallbackHandler; 34 35 import hero.interfaces.Constants; 36 import hero.interfaces.ProjectSession; 37 import hero.interfaces.ProjectSessionHome; 38 import hero.interfaces.ProjectSessionUtil; 39 40 import hero.interfaces.UserSession; 41 import hero.interfaces.UserSessionHome; 42 import hero.interfaces.UserSessionUtil; 43 import hero.util.BonitaConfigClient; 44 45 public class BonitaConfigSample { 46 47 static public void main(String [] args) throws Exception { 48 char[] password={'t','o','t','o'}; 50 SimpleCallbackHandler handler = new SimpleCallbackHandler("admin",password); 51 LoginContext lc = new LoginContext ("TestClient", handler); 52 lc.login(); 53 54 ProjectSessionHome projectSessionh=ProjectSessionUtil.getHome(); 55 UserSessionHome usersh=UserSessionUtil.getHome(); 56 UserSession usr=usersh.create(); 57 58 ProjectSession pss=projectSessionh.create(); 59 pss.initModel("NoEvents"); 60 61 BonitaConfigClient bc = new BonitaConfigClient(); 62 bc.updateJMS(false); 63 64 pss.addNode("node1",Constants.Nd.AND_JOIN_NODE); 65 pss.setNodeRole("node1","admin"); 66 pss.addNode("node2",Constants.Nd.AND_JOIN_NODE); 67 pss.addEdge("node1","node2"); 68 pss.addNodeHook("node1","hero.hook.TestDeadline",hero.interfaces.Constants.Nd.ONDEADLINE,Constants.Hook.JAVA); 69 70 String instName=pss.instantiateProject("NoEvents"); 71 72 usr.startActivity(instName,"node1"); 73 74 System.out.println("Bonita JMS flag was updated and JMS notifications were disabled. You can launch the Manager application in order to verify it !!"); 75 } 76 } 77 78 79 | Popular Tags |