Bookshelf Home | Contents | Index | PDF |
Siebel System Administration Guide > Siebel Management Framework APIs > Example of Enterprise-Level JMX APIThe following is an example of the Enterprise-level JMX API. CAUTION: You must test these methods carefully before deploying into production, as some of these commands can shutdown or disable components, servers, or even the enterprise. import com.siebel.management.jmxapi.*; public static void main(String[] args) JmxEnterpriseMBean emb = new JmxEnterprise(); //+ The following 2 need to be changed by the person using this program String ent = "siebel"; // enterprise name System.out.println("Servers:"); String[] Servers = emb.getServers (ent); for (int i = 0; i < Servers.length; i++) System.out.println(" " + Servers[i]); System.out.println("ConnectedServers:"); String[] ConnectedServers = emb.getConnectedServers (ent); for (int i = 0; i < ConnectedServers.length; i++) System.out.println(" " + ConnectedServers[i]); System.out.println("DisconnectedServers:"); String[] DisconnectedServers = emb.getDisconnectedServers (ent); for (int i = 0; i < DisconnectedServers.length; i++) System.out.println(" " + DisconnectedServers[i]); Float compState = emb.getComponentAvailability (ent, arg); System.out.println("getComponentAvailability('" + arg + "'):" + compState); Boolean shutdownComp = emb.shutdownComponent(ent, arg1, false); System.out.println("shutdownComponent('" + arg1 + "'):" + shutdownComp); //A sleep time of 2min before staring the component// System.out.println("SleepTime:2 min"); catch ( InterruptedException e ) { System.out.println( "awakened prematurely" );} Boolean startComp = emb.startComponent(ent, arg1); System.out.println("startComponent('" + arg1 + "'):" + startComp); //A sleep time of 2min before staring the component// System.out.println("SleepTime:2 min"); catch ( InterruptedException e ) { System.out.println( "awakened prematurely" );} String Param = emb.getParam (ent, arg2); System.out.println("getParam('" + arg2 + "'):" + Param); Boolean shutdownEnt = emb.shutdownEnterprise (ent); System.out.println("shutdownEnterprise('" + ent + "'):" + shutdownEnt); //A sleeptime of 5 min before starting the enterprise// System.out.println("SleepTime:5 min"); catch ( InterruptedException e ) { System.out.println( "awakened prematurely" ); } Boolean startEnt = emb.startEnterprise (ent); System.out.println("startEnterprise('" + ent + "'):" + startEnt); |
Siebel System Administration Guide | Copyright © 2010, Oracle and/or its affiliates. All rights reserved. Legal Notices. | |