Bookshelf Home | Contents | Index | PDF |
Siebel System Administration Guide > Siebel Management Framework APIs > Example of Server-Level JMX APIThe following is an example of the Server-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) JmxServerMBean smb = new JmxServer(); //+ The following 2 need to be changed by the person using this program String ent = "siebel"; // enterprise name String srv = "sdchs21n016"; // server name String srvState = smb.getState (ent, srv); System.out.println("getState('" + srv + "'):" + srvState); Boolean shutdownSrv = smb.shutdownServer (ent, srv); System.out.println("shutdownServer('" + srv + "'):" + shutdownSrv); //A sleep time of 5 min before starting the siebel server// System.out.println("SleepTime:5 min"); catch ( InterruptedException e ) { System.out.println( "awakened prematurely" );} Boolean startSrv = smb.startServer (ent, srv); System.out.println("startServer('" + srv + "'):" + startSrv); //A sleep time of 5 min before starting the siebel server// System.out.println("SleepTime:5 min"); catch ( InterruptedException e ) { System.out.println( "awakened prematurely" );} String paramval = smb.getParam (ent, srv, param); System.out.println("getParam ('" + param + "'):" + paramval); String statval = smb.getStat (ent, srv, stat); System.out.println("getStat ('" + stat + "'):" + statval); String svalval = smb.getSval (ent, srv, sval); System.out.println("getSval ('" + sval + "'):" + svalval); String[] Comps = smb.getComps (ent, srv); System.out.println("Components:"); for (int i = 0; i < Comps.length; i++) System.out.println(" " + Comps[i]); String Compval = smb.getCompState (ent, srv, arg); System.out.println("getCompState ('" + arg + "'):" + Compval); Boolean compstop = smb.shutdownComp (ent, srv, Comp, false); System.out.println("shutdownComp ('" + Comp + "'):" + compstop); //A Sleep time of 2min before starting the component// System.out.println("Sleeptime: 2 min"); catch ( InterruptedException e ) { System.out.println( "awakened prematurely" ); } Boolean compstart = smb.startComp (ent, srv, Comp); System.out.println("startComp ('" + Comp + "'):" + compstart); |
Siebel System Administration Guide | Copyright © 2010, Oracle and/or its affiliates. All rights reserved. Legal Notices. | |