« Creating a WorkManager using wsadmin/jmx | Main | Wireless LAN Linux = LinuxANT »

December 04, 2003

Creating a WorkManager using java/jmx

For those of you looking for an example of making WebSphere admin object using Java, here's a java snippet showing how to make a WorkManager from a Java class:

// Create the WorkManager

// Prepare the attribute list
AttributeList wmAttrs = new AttributeList();
wmAttrs.add(new Attribute("category", "ABFVT"));
wmAttrs.add(new Attribute("description", "AsynchBeans FVT WorkManager"));
wmAttrs.add(new Attribute("isGrowable", new Boolean(true)));
wmAttrs.add(new Attribute("jndiName", "wm/ABFVT2"));
wmAttrs.add(new Attribute("maxThreads", new Integer(30)));
wmAttrs.add(new Attribute("minThreads", new Integer(20)));
wmAttrs.add(new Attribute("name", "ABFVT_WM2"));
wmAttrs.add(new Attribute("numAlarmThreads", new Integer(10)));

ArrayList arraylist = new ArrayList();
arraylist.add("security");
arraylist.add("UserWorkArea");
arraylist.add("com.ibm.ws.i18n");
arraylist.add("AppProfileService");
wmAttrs.add(new Attribute("serviceNames", arraylist ));

wmAttrs.add(new Attribute("threadPriority", new Integer(5)));

ObjectName theWorkManager = configService.createConfigData(session,
handle,
"WorkManagerInfo",
"workmanager:WorkManager",
wmAttrs);

Thanks to Kevin for this snippet.

December 4, 2003 | Permalink

Comments

Post a comment