Posted By:
gomathi_periasamy
Posted On:
Thursday, August 24, 2006 11:55 PM
I created a web application (war file to manage the Logger component of our framework) and deployed in jboss server its working fine.. eg)import javax.servlet.ServletException; import javax.servlet.ServletConfig; import javax.servlet.ServletContext; import java.io.IOException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.lang.String; import javax.management.*; import java.lang.management.*; import com.wipro.j2ee.infrastructure.component.logging.ILogger; import com.wipro.j2ee.infrastructure.service.ServiceException; import com.wipro.j2ee.
More>>
I created a web application (war file to manage the Logger component of our framework) and deployed in jboss server its working fine..
eg)import javax.servlet.ServletException;
import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.lang.String;
import javax.management.*;
import java.lang.management.*;
import com.wipro.j2ee.infrastructure.component.logging.ILogger;
import com.wipro.j2ee.infrastructure.service.ServiceException;
import com.wipro.j2ee.infrastructure.service.logging.ILoggingService;
import com.wipro.j2ee.servicebus.cif.broker.CIFInfrastructureServiceLocator;
import com.wipro.j2ee.utils.misc.ServiceLocatorException;
import com.wipro.j2ee.infrastructure.component.logging.*;
public class LoggingS extends HttpServlet
{
public void init(ServletConfig c) throws
ServletException {
super.init (c);
MBeanServer mbs = null;
ILogger logger = null;
ILoggerMBean loggerManage = null;
ObjectName loggerName = null;
ObjectInstance obj =null;
try {
// Create an MBeanServer and HTML adaptor (J2SE
1.4)
mbs = ManagementFactory.getPlatformMBeanServer();
// HtmlAdaptorServer adapter = new
HtmlAdaptorServer();
// Unique identification of MBeans
ILoggingService loggingService =
(ILoggingService)
CIFInfrastructureServiceLocator.getInstance().getLoggingService();
logger = loggingService.getLogger(this.getClass().getName());
System.out.println("Oneee3logger"+logger);
loggerManage=loggingService.getLoggerMBean(this.getClass().getName());
System.out.println("OneeloggerManagee3"+loggerManage);
loggerName = new ObjectName("service:loggerName=LogOne");
mbs.registerMBean(loggerManage, loggerName);
getServletContext().setAttribute("mbServer",mbs);
getServletContext().setAttribute("logger",logger);
getServletContext().setAttribute("loggerName",loggerName);
} catch (ServiceException e) {
System.out.println("initLogger- Error Occured while Initlizing Logging Component");
e.printStackTrace();
} catch (ServiceLocatorException e) {
System.out.println("initLogger- Error Occured while Initlizing Logging Component");
e.printStackTrace();
} catch (Exception e) {
System.out.println("initLogger- Error Occured while Initlizing Logging Component");
e.printStackTrace();
}
and used the server instance for invoking management operations its working fine when i tested a sample with in the war file.
How to testit when an application is located externally?
whether i should use the connector?
Regards,
GOmz
<<Less