FileDocCategorySizeDatePackage
EJBTimerManagementMBean.javaAPI DocGlassfish v2 API5248Fri May 04 22:24:10 BST 2007com.sun.enterprise.admin.mbeans

EJBTimerManagementMBean

public class EJBTimerManagementMBean extends com.sun.enterprise.admin.config.BaseConfigMBean implements com.sun.enterprise.admin.mbeanapi.IEJBTimerManagementMBean
object name for this mbean: :type=ejb-timer-management,category=config EJBTimerManagementMBean exposes list timers
author
sridatta

Fields Summary
private static final com.sun.enterprise.util.i18n.StringManager
_strMgr
private static Logger
_logger
Constructors Summary
public EJBTimerManagementMBean()

	    super();
	
Methods Summary
private voidfine(java.lang.String s)

         getLogger().log(Level.INFO, s); //FIXME. change to fine
     
protected com.sun.enterprise.admin.event.AdminEventResultforwardEvent(com.sun.enterprise.admin.event.AdminEvent e)


        AdminEventResult result = null;
        result = AdminEventMulticaster.multicastEvent(e);
        return result;
    
private java.util.logging.LoggergetLogger()

        if (_logger == null) {
            _logger = Logger.getLogger(LogDomains.ADMIN_LOGGER);
        }
        return _logger;
    
private java.lang.StringgetServerName()

	return ApplicationServer.getServerContext().getInstanceName();
    
public java.lang.String[]listTimers(java.lang.String target)
Lists ALL the ejb timers

param
target is ignored. It is always assumed to be the PE instance. can also be null. exception InstanceException
return
returns the list of timers as a string array

       
	fine("Entering list Timers"); 
	String server = getServerName(); 
        
	fine("List Timers: Sending Notification to server" + server);
	 
        String[] resStr = sendListTimerEvent(server, new String[] {server});
	fine("RESULT: " + resStr);
	if(resStr == null || resStr.length == 0) {
	   resStr = new String[] {"There are no Ejb Timers."};
	} 
	resStr[0] = server + ": " + resStr[0];
	return resStr;
    
protected java.lang.String[]sendListTimerEvent(java.lang.String server, java.lang.String[] allServers)

         AdminEvent event = new EjbTimerEvent(server, 
                        EjbTimerEvent.ACTION_LISTTIMERS, 
                        server, 
                        allServers);
         
	 event.setTargetDestination(server); 
         AdminEventResult res = forwardEvent(event);

	return (String[]) res.getAttribute(server,
			EjbTimerEvent.EJB_TIMER_CALL_RESULT_ATTRNAME);