Thank you Herb,
Its good to know you are back 'on the road'!
I am on a very short engagement with Fermilab at St Charles, Illinois, that
started last Monday, where Carin Sinclair works, and she showed me quite a
few photographs of most the long timers, which included you, Dan Bloom,
Misi, Kelly Deaver, David Easter, Rick Cook, Doug Mueller off course (but
then who hasn’t seen pictures of Doug!) and many others including the band
that played there.. Looks like I missed a fun time! It was nice to put an
image to all these names I know as email address for so many years!
And good to know my drink didn’t go to waste :-) Having lived in a total
prohibition country, Kuwait for near 6 and 1/2 years, that would have been a
very sad thought if it were wasted!
Joe
-Original Message-
From: Herb Partlow
Sent: Friday, October 29, 2010 5:05 PM Newsgroups:
public.remedy.arsystem.general
To: arslist@ARSLIST.ORG
Subject: Congrats Joe D'Sousa
Congrats Joe
Arslist MVP
Missed you at wwRug10, but your drink did not go to waste. :-)
Maybe next year
Herb Partlow
IB Technical Consulting
O- 408.253.0344
F - 408.253.0344
C - 408.309.5316
Sent from iPhone
On Oct 29, 2010, at 1:39 PM, Roys, Eric D eric.r...@verizonbusiness.com
wrote:
Many thanks to John Baker from Java Systems Solutions for a work-around
to this via modification to the plugin code (see below and I hope I
incorporated it correctly :-). I would still like to know if it is
possible to configure per plugin threads via the pluginsvr.conf
configuration or other mechanism. This is for an ARS 7.5 / 7.6
environment.
Thanks,
Eric
Example singleton plugin:
--
package com.company.samples;
import java.util.List;
import com.bmc.arsys.api.ARException;
import com.bmc.arsys.api.Value;
import com.bmc.arsys.pluginsvr.*;
import com.bmc.arsys.pluginsvr.plugins.ARFilterAPIPluggable;
import com.bmc.arsys.pluginsvr.plugins.ARPluggable;
import com.bmc.arsys.pluginsvr.plugins.ARFilterAPIPlugin;
import com.bmc.arsys.pluginsvr.plugins.ARPluginContext;
import com.bmc.arsys.*;
import org.apache.log4j.Logger;
import com.company.someotherstuff*;
/**
* A class representing a singletone Plugin service.
* This will run as a java plugin under the Remedy Java plugin framework
* as a single instance instead of x instances as defined by arpluginsvr
coreThreads
*
* Useful when the plugin calls it's own management mechanism for work
distribution
* or a poller mechanism that should only be initialized once.
*
*/
public class MyPlugin extends ARFilterAPIPlugin {
// initiate logger
private static final Logger logger = Logger.getLogger(MyPlugin.class);
// for our singleton
private static MyPlugin myplug;
public MyPlugin() {};
/* Initialize the Remedy plugin */
public void initialize(ARPluginContext context) throws ARException {
logger.info(Started plugin init);
super.initialize(context);
/* check if it's already available, if not it's safe to init the
code for other stuff to do
*/
if(myplug == null){
myplug = getInstance();
//initialize the stuff we want to run outside of current
thread
initializeApp(context);
}
}
public void terminate(ARPluginContext context) throws ARException {
logger.info(Terminating context);
//cleanup routine here for graceful shutdown
super.terminate(context);
}
/* start it (the plugin) */
public static void main(String[] args) {
//'cause it's not ultimately useful at this juncture to accept
params at startup...
if(args!= null){
logger.warn(This plugin does not accept command line
messaging...);
}
}
/* initialize the meat of the plugin outside of the plugin
initialization thread
so the init process can complete and we aren't mucking things up
(according to the docs)
*/
private void initializeApp(ARPluginContext context) throws
ARException{
//class for storing config variables in memory instead of dealing
with an overload of i/o
ConfigParams cp = new ConfigParams();
try{
logger.info(calling init...);
cp.initialize(); // load config file parameters into mem
Thread t = new Thread(new Poller()); //thread our poller
mechanism
t.start(); //start the poller
} catch (RuntimeException rte){
terminate(context);
}
}
/* we aren't allowing filter api calls to this plugin because the
plugin
polls remedy asynchronously for all work to process
*/
public ListValue filterAPICall(ARPluginContext context, ListValue
in) throws ARException {
return null;
}
/* we aren't allowing event calls to this plugin
*/
public void onEvent(ARPluginContext context, int arg1) throws
ARException {
//do nothing
}
/* get an instance of this plugin */
private synchronized static MyPlugin getInstance()
{
if (myplug==null) myplug = new MyPlugin();
return plug;
}
}
Previous message:
Is it possible to configure individual plugins