Package org.jboss.system

Examples of org.jboss.system.Service


    */
   private Service getServiceProxy(ObjectName objectName, String serviceFactory)
         throws ClassNotFoundException, InstantiationException,
         IllegalAccessException, JMException
   {
      Service service = null;
      ClassLoader loader = Thread.currentThread().getContextClassLoader();
      if (serviceFactory != null && serviceFactory.length() > 0)
      {
         Class clazz = loader.loadClass(serviceFactory);
         ServiceFactory factory = (ServiceFactory) clazz.newInstance();
View Full Code Here


    */
   private Service getServiceProxy(ObjectName objectName, String serviceFactory)
         throws ClassNotFoundException, InstantiationException,
         IllegalAccessException, JMException
   {
      Service service = null;
      ClassLoader loader = Thread.currentThread().getContextClassLoader();
      if (serviceFactory != null && serviceFactory.length() > 0)
      {
         Class clazz = loader.loadClass(serviceFactory);
         ServiceFactory factory = (ServiceFactory) clazz.newInstance();
View Full Code Here

    * @return The Service value
    * @throws Exception for any error
    */
   public static Service getServiceProxy(ObjectName objectName, MBeanServer server, boolean includeLifecycle) throws Exception
   {
      Service service = null;
      MBeanInfo info = server.getMBeanInfo(objectName);
      MBeanOperationInfo[] opInfo = info.getOperations();
      Class<?>[] interfaces = { Service.class };
      InvocationHandler handler = new ServiceProxy(objectName, server, opInfo);
      if (includeLifecycle == false)
View Full Code Here

*/
public class CreateDestroyLifecycleAction extends ServiceControllerContextAction
{
   public void installAction(ServiceControllerContext context) throws Throwable
   {
      Service service = context.getServiceProxy();
      service.create();

      context.getServiceContext().state = ServiceContext.CREATED;
     
      ObjectName objectName = context.getObjectName();
      ServiceController serviceController = context.getServiceController();
View Full Code Here

   public void uninstallAction(ServiceControllerContext context)
   {
      try
      {
         Service service = context.getServiceProxy();
         service.destroy();

         context.getServiceContext().state = ServiceContext.DESTROYED;

         ObjectName objectName = context.getObjectName();
         ServiceController serviceController = context.getServiceController();
View Full Code Here

*/
public class StartStopLifecycleAction extends ServiceControllerContextAction
{
   public void installAction(ServiceControllerContext context) throws Throwable
   {
      Service service = context.getServiceProxy();
      service.start();

      context.getServiceContext().state = ServiceContext.RUNNING;

      ObjectName objectName = context.getObjectName();
      ServiceController serviceController = context.getServiceController();
View Full Code Here

   public void uninstallAction(ServiceControllerContext context)
   {
      try
      {
         Service service = context.getServiceProxy();
         service.stop();

         context.getServiceContext().state = ServiceContext.STOPPED;

         ObjectName objectName = context.getObjectName();
         ServiceController serviceController = context.getServiceController();
View Full Code Here

/*    */ public class CreateDestroyLifecycleAction extends ServiceControllerContextAction
/*    */ {
/*    */   public void installAction(ServiceControllerContext context)
/*    */     throws Throwable
/*    */   {
/* 41 */     Service service = context.getServiceProxy();
/* 42 */     service.create();
/*    */
/* 44 */     context.getServiceContext().state = 2;
/*    */
/* 46 */     ObjectName objectName = context.getObjectName();
/* 47 */     ServiceController serviceController = context.getServiceController();
View Full Code Here

/*    */
/*    */   public void uninstallAction(ServiceControllerContext context)
/*    */   {
/*    */     try
/*    */     {
/* 55 */       Service service = context.getServiceProxy();
/* 56 */       service.destroy();
/*    */
/* 58 */       context.getServiceContext().state = 6;
/*    */
/* 60 */       ObjectName objectName = context.getObjectName();
/* 61 */       ServiceController serviceController = context.getServiceController();
View Full Code Here

/*    */ public class StartStopLifecycleAction extends ServiceControllerContextAction
/*    */ {
/*    */   public void installAction(ServiceControllerContext context)
/*    */     throws Throwable
/*    */   {
/* 41 */     Service service = context.getServiceProxy();
/* 42 */     service.start();
/*    */
/* 44 */     context.getServiceContext().state = 3;
/*    */
/* 46 */     ObjectName objectName = context.getObjectName();
/* 47 */     ServiceController serviceController = context.getServiceController();
View Full Code Here

TOP

Related Classes of org.jboss.system.Service

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.