Package org.jboss.ejb3.annotation

Examples of org.jboss.ejb3.annotation.Service


   }

   @Override
   public JBossSessionBeanMetaData create(Class<?> beanClass)
   {
      Service annotation = finder.getAnnotation(beanClass, Service.class);
      if(annotation == null)
         return null;
     
      JBossServiceBeanMetaData bean = new JBossServiceBeanMetaData();
      bean.setEjbClass(beanClass.getName());
      String ejbName;
      if(annotation.name() == null || annotation.name().length() == 0)
         ejbName = beanClass.getSimpleName();
      else
         ejbName = annotation.name();
      bean.setEjbName(ejbName);
     
      bean.setObjectName(annotation.objectName());
      bean.setXmbean(annotation.xmbean());
     
      TransactionManagement txMgmt = finder.getAnnotation(beanClass, TransactionManagement.class);
      TransactionManagementType txType = TransactionManagementType.CONTAINER;
      if(txMgmt != null)
         txType = txMgmt.value();
View Full Code Here


         }

         /*
          * Construct the ObjectName
          */
         Service service = this.getAnnotation(Service.class);
         String objname = service.objectName();
         delegateObjectName = (objname == null || objname.equals("")) ? new ObjectName(getObjectName()
               .getCanonicalName()
               + ",type=ManagementInterface") : new ObjectName(objname);

         // For @Management
         if (intf != null)
         {
            if (mbeanServer == null)
               throw new RuntimeException("There is a @Management interface on " + ejbName
                     + " but the MBeanServer has not been initialized for it");

            delegate = new ServiceMBeanDelegate(mbeanServer, this, intf, delegateObjectName);

            /*
             *
             * This section is in place to replace the KernelAbstraction.installMBean
             * method which will be removed JBossASKernel (AS/trunk/ejb3) for 5.0.1.
             *
             * Here to be backwards-compatible with JBossAS 5.0.0.GA
             *
             * http://www.jboss.com/index.html?module=bb&op=viewtopic&t=148497
             *
             */

            // The old/deprecated access
            //getDeployment().getKernelAbstraction().installMBean(delegateObjectName, newPolicy, delegate);
            // Register w/ MBean Server
            mbeanServer.registerMBean(delegate, delegateObjectName);

            // Install into MC
            getDeployment().getKernelAbstraction().install(delegateObjectName.getCanonicalName(), newPolicy, null,
                  delegate);

            /*
             *
             * End backwards-compatible replacement for:
             * getDeployment().getKernelAbstraction().installMBean
             *
             */
         }
         // XMBeans
         else
         {
            if (service.xmbean().length() > 0)
            {

               if (mbeanServer == null)
                  throw new RuntimeException(ejbName
                        + "is defined as an XMBean, but the MBeanServer has not been initialized for it");

               delegate = new ServiceMBeanDelegate(mbeanServer, this, service.xmbean(), delegateObjectName);

               getDeployment().getKernelAbstraction().installMBean(delegateObjectName, newPolicy, delegate);
            }
         }

View Full Code Here

         }

         /*
          * Construct the ObjectName
          */
         Service service = this.getAnnotation(Service.class);
         String objname = service.objectName();
         delegateObjectName = (objname == null || objname.equals("")) ? new ObjectName(getObjectName()
               .getCanonicalName()
               + ",type=ManagementInterface") : new ObjectName(objname);

         // For @Management
         if (intf != null)
         {
            if (mbeanServer == null)
               throw new RuntimeException("There is a @Management interface on " + ejbName
                     + " but the MBeanServer has not been initialized for it");

            delegate = new ServiceMBeanDelegate(mbeanServer, this, intf, delegateObjectName);

            /*
             *
             * This section is in place to replace the KernelAbstraction.installMBean
             * method which will be removed JBossASKernel (AS/trunk/ejb3) for 5.0.1.
             *
             * Here to be backwards-compatible with JBossAS 5.0.0.GA
             *
             * http://www.jboss.com/index.html?module=bb&op=viewtopic&t=148497
             *
             */

            // The old/deprecated access
            //getDeployment().getKernelAbstraction().installMBean(delegateObjectName, newPolicy, delegate);
            // Register w/ MBean Server
            mbeanServer.registerMBean(delegate, delegateObjectName);

            // Install into MC
            getDeployment().getKernelAbstraction().install(delegateObjectName.getCanonicalName(), newPolicy, null,
                  delegate);

            /*
             *
             * End backwards-compatible replacement for:
             * getDeployment().getKernelAbstraction().installMBean
             *
             */
         }
         // XMBeans
         else
         {
            if (service.xmbean().length() > 0)
            {

               if (mbeanServer == null)
                  throw new RuntimeException(ejbName
                        + "is defined as an XMBean, but the MBeanServer has not been initialized for it");

               delegate = new ServiceMBeanDelegate(mbeanServer, this, service.xmbean(), delegateObjectName);

               getDeployment().getKernelAbstraction().installMBean(delegateObjectName, newPolicy, delegate);
            }
         }

View Full Code Here

               mbeanServer = org.jboss.mx.util.MBeanServerLocator.locateJBoss();

            if (mbeanServer == null)
               throw new RuntimeException("There is a @Management interface on " + ejbName + " but the MBeanServer has not been initialized for it");

            Service service = (Service)resolveAnnotation(Service.class);

            String objname = service.objectName();
            delegateObjectName = (objname == null || objname.equals("")) ?
                            new ObjectName(getObjectName().getCanonicalName() + ",type=ManagementInterface") : new ObjectName(service.objectName());

            delegate = new ServiceMBeanDelegate(mbeanServer, this, intf, delegateObjectName);

            getDeployment().getKernelAbstraction().installMBean(delegateObjectName, getDependencyPolicy(), delegate);
         }
         else
         {
            Service service = (Service)resolveAnnotation(Service.class);
            if (service.xmbean().length() > 0)
            {
               if (mbeanServer == null)
                  mbeanServer = org.jboss.mx.util.MBeanServerLocator.locateJBoss();

               if (mbeanServer == null)
                  throw new RuntimeException(ejbName + "is defined as an XMBean, but the MBeanServer has not been initialized for it");

               String objname = service.objectName();
               delegateObjectName = (objname == null || objname.equals("")) ?
                               new ObjectName(getObjectName().getCanonicalName() + ",type=ManagementInterface") : new ObjectName(service.objectName());

               delegate = new ServiceMBeanDelegate(mbeanServer, this, service.xmbean(), delegateObjectName);

               getDeployment().getKernelAbstraction().installMBean(delegateObjectName, getDependencyPolicy(), delegate);
            }
         }
        
View Full Code Here

         }

         /*
          * Construct the ObjectName
          */
         Service service = this.getAnnotation(Service.class);
         String objname = service.objectName();
         delegateObjectName = (objname == null || objname.equals("")) ? new ObjectName(getObjectName()
               .getCanonicalName()
               + ",type=ManagementInterface") : new ObjectName(objname);

         // For @Management
         if (intf != null)
         {
            if (mbeanServer == null)
               throw new RuntimeException("There is a @Management interface on " + ejbName
                     + " but the MBeanServer has not been initialized for it");

            delegate = new ServiceMBeanDelegate(mbeanServer, this, intf, delegateObjectName);

            /*
             *
             * This section is in place to replace the KernelAbstraction.installMBean
             * method which will be removed JBossASKernel (AS/trunk/ejb3) for 5.0.1.
             *
             * Here to be backwards-compatible with JBossAS 5.0.0.GA
             *
             * http://www.jboss.com/index.html?module=bb&op=viewtopic&t=148497
             *
             */

            // The old/deprecated access
            //getDeployment().getKernelAbstraction().installMBean(delegateObjectName, newPolicy, delegate);
            // Register w/ MBean Server
            mbeanServer.registerMBean(delegate, delegateObjectName);

            // Install into MC
            getDeployment().getKernelAbstraction().install(delegateObjectName.getCanonicalName(), newPolicy, null,
                  delegate);

            /*
             *
             * End backwards-compatible replacement for:
             * getDeployment().getKernelAbstraction().installMBean
             *
             */
         }
         // XMBeans
         else
         {
            if (service.xmbean().length() > 0)
            {

               if (mbeanServer == null)
                  throw new RuntimeException(ejbName
                        + "is defined as an XMBean, but the MBeanServer has not been initialized for it");

               delegate = new ServiceMBeanDelegate(mbeanServer, this, service.xmbean(), delegateObjectName);

               getDeployment().getKernelAbstraction().installMBean(delegateObjectName, newPolicy, delegate);
            }
         }

View Full Code Here

         }

         /*
          * Construct the ObjectName
          */
         Service service = this.getAnnotation(Service.class);
         String objname = service.objectName();
         delegateObjectName = (objname == null || objname.equals("")) ? new ObjectName(getObjectName()
               .getCanonicalName()
               + ",type=ManagementInterface") : new ObjectName(objname);

         // For @Management
         if (intf != null)
         {
            if (mbeanServer == null)
               throw new RuntimeException("There is a @Management interface on " + ejbName
                     + " but the MBeanServer has not been initialized for it");

            delegate = new ServiceMBeanDelegate(mbeanServer, this, intf, delegateObjectName);

            /*
             *
             * This section is in place to replace the KernelAbstraction.installMBean
             * method which will be removed JBossASKernel (AS/trunk/ejb3) for 5.0.1.
             *
             * Here to be backwards-compatible with JBossAS 5.0.0.GA
             *
             * http://www.jboss.com/index.html?module=bb&op=viewtopic&t=148497
             *
             */

            // The old/deprecated access
            //getDeployment().getKernelAbstraction().installMBean(delegateObjectName, newPolicy, delegate);
            // Register w/ MBean Server
            mbeanServer.registerMBean(delegate, delegateObjectName);

            // Install into MC
            getDeployment().getKernelAbstraction().install(delegateObjectName.getCanonicalName(), newPolicy, null,
                  delegate);

            /*
             *
             * End backwards-compatible replacement for:
             * getDeployment().getKernelAbstraction().installMBean
             *
             */
         }
         // XMBeans
         else
         {
            if (service.xmbean().length() > 0)
            {

               if (mbeanServer == null)
                  throw new RuntimeException(ejbName
                        + "is defined as an XMBean, but the MBeanServer has not been initialized for it");

               delegate = new ServiceMBeanDelegate(mbeanServer, this, service.xmbean(), delegateObjectName);

               getDeployment().getKernelAbstraction().installMBean(delegateObjectName, newPolicy, delegate);
            }
         }

View Full Code Here

            if (mbeanServer == null)
               throw new RuntimeException("There is a @Management interface on " + ejbName
                     + " but the MBeanServer has not been initialized for it");

            Service service = (Service) resolveAnnotation(Service.class);

            String objname = service.objectName();
            delegateObjectName = (objname == null || objname.equals("")) ? new ObjectName(getObjectName()
                  .getCanonicalName()
                  + ",type=ManagementInterface") : new ObjectName(service.objectName());

            delegate = new ServiceMBeanDelegate(mbeanServer, this, intf, delegateObjectName);

            getDeployment().getKernelAbstraction().installMBean(delegateObjectName, getDependencyPolicy(), delegate);
         }
         else
         {
            Service service = (Service) resolveAnnotation(Service.class);
            if (service.xmbean().length() > 0)
            {
               if (mbeanServer == null)
                  mbeanServer = org.jboss.mx.util.MBeanServerLocator.locateJBoss();

               if (mbeanServer == null)
                  throw new RuntimeException(ejbName
                        + "is defined as an XMBean, but the MBeanServer has not been initialized for it");

               String objname = service.objectName();
               delegateObjectName = (objname == null || objname.equals("")) ? new ObjectName(getObjectName()
                     .getCanonicalName()
                     + ",type=ManagementInterface") : new ObjectName(service.objectName());

               delegate = new ServiceMBeanDelegate(mbeanServer, this, service.xmbean(), delegateObjectName);

               getDeployment().getKernelAbstraction().installMBean(delegateObjectName, getDependencyPolicy(), delegate);
            }
         }
View Full Code Here

         }

         /*
          * Construct the ObjectName
          */
         Service service = this.getAnnotation(Service.class);
         String objname = service.objectName();
         delegateObjectName = (objname == null || objname.equals("")) ? new ObjectName(getObjectName()
               .getCanonicalName()
               + ",type=ManagementInterface") : new ObjectName(objname);

         // For @Management
         if (intf != null)
         {
            if (mbeanServer == null)
               throw new RuntimeException("There is a @Management interface on " + ejbName
                     + " but the MBeanServer has not been initialized for it");

            delegate = new ServiceMBeanDelegate(mbeanServer, this, intf, delegateObjectName);

            /*
             *
             * This section is in place to replace the KernelAbstraction.installMBean
             * method which will be removed JBossASKernel (AS/trunk/ejb3) for 5.0.1.
             *
             * Here to be backwards-compatible with JBossAS 5.0.0.GA
             *
             * http://www.jboss.com/index.html?module=bb&op=viewtopic&t=148497
             *
             */

            // The old/deprecated access
            //getDeployment().getKernelAbstraction().installMBean(delegateObjectName, newPolicy, delegate);
            // Register w/ MBean Server
            mbeanServer.registerMBean(delegate, delegateObjectName);

            // Install into MC
            getDeployment().getKernelAbstraction().install(delegateObjectName.getCanonicalName(), newPolicy, null,
                  delegate);

            /*
             *
             * End backwards-compatible replacement for:
             * getDeployment().getKernelAbstraction().installMBean
             *
             */
         }
         // XMBeans
         else
         {
            if (service.xmbean().length() > 0)
            {

               if (mbeanServer == null)
                  throw new RuntimeException(ejbName
                        + "is defined as an XMBean, but the MBeanServer has not been initialized for it");

               delegate = new ServiceMBeanDelegate(mbeanServer, this, service.xmbean(), delegateObjectName);

               getDeployment().getKernelAbstraction().installMBean(delegateObjectName, newPolicy, delegate);
            }
         }

View Full Code Here

         }

         /*
          * Construct the ObjectName
          */
         Service service = this.getAnnotation(Service.class);
         String objname = service.objectName();
         delegateObjectName = (objname == null || objname.equals("")) ? new ObjectName(getObjectName()
               .getCanonicalName()
               + ",type=ManagementInterface") : new ObjectName(objname);

         // For @Management
         if (intf != null)
         {
            if (mbeanServer == null)
               throw new RuntimeException("There is a @Management interface on " + ejbName
                     + " but the MBeanServer has not been initialized for it");

            delegate = new ServiceMBeanDelegate(mbeanServer, this, intf, delegateObjectName);

            /*
             *
             * This section is in place to replace the KernelAbstraction.installMBean
             * method which will be removed JBossASKernel (AS/trunk/ejb3) for 5.0.1.
             *
             * Here to be backwards-compatible with JBossAS 5.0.0.GA
             *
             * http://www.jboss.com/index.html?module=bb&op=viewtopic&t=148497
             *
             */

            // The old/deprecated access
            //getDeployment().getKernelAbstraction().installMBean(delegateObjectName, newPolicy, delegate);
            // Register w/ MBean Server
            mbeanServer.registerMBean(delegate, delegateObjectName);

            // Install into MC
            getDeployment().getKernelAbstraction().install(delegateObjectName.getCanonicalName(), newPolicy, null,
                  delegate);

            /*
             *
             * End backwards-compatible replacement for:
             * getDeployment().getKernelAbstraction().installMBean
             *
             */
         }
         // XMBeans
         else
         {
            if (service.xmbean().length() > 0)
            {

               if (mbeanServer == null)
                  throw new RuntimeException(ejbName
                        + "is defined as an XMBean, but the MBeanServer has not been initialized for it");

               delegate = new ServiceMBeanDelegate(mbeanServer, this, service.xmbean(), delegateObjectName);

               getDeployment().getKernelAbstraction().installMBean(delegateObjectName, newPolicy, delegate);
            }
         }

View Full Code Here

         }
        
         /*
          * Construct the ObjectName
          */
         Service service = this.getAnnotation(Service.class);
         String objname = service.objectName();
         delegateObjectName = (objname == null || objname.equals("")) ? new ObjectName(getObjectName()
               .getCanonicalName()
               + ",type=ManagementInterface") : new ObjectName(objname);

         // For @Management
         if (intf != null)
         {
            if (mbeanServer == null)
               throw new RuntimeException("There is a @Management interface on " + ejbName
                     + " but the MBeanServer has not been initialized for it");

            delegate = new ServiceMBeanDelegate(mbeanServer, this, intf, delegateObjectName);
           
            /*
             *
             * This section is in place to replace the KernelAbstraction.installMBean
             * method which will be removed JBossASKernel (AS/trunk/ejb3) for 5.0.1.
             *
             * Here to be backwards-compatible with JBossAS 5.0.0.GA
             *
             * http://www.jboss.com/index.html?module=bb&op=viewtopic&t=148497
             *
             */
           
            // The old/deprecated access
            //getDeployment().getKernelAbstraction().installMBean(delegateObjectName, newPolicy, delegate);
           
            // Register w/ MBean Server
            mbeanServer.registerMBean(delegate, delegateObjectName);
           
            // Install into MC
            getDeployment().getKernelAbstraction().install(delegateObjectName.getCanonicalName(), newPolicy, null, delegate);

            /*
             *
             * End backwards-compatible replacement for:
             * getDeployment().getKernelAbstraction().installMBean
             *
             */
         }
         // XMBeans
         else
         {
            if (service.xmbean().length() > 0)
            {

               if (mbeanServer == null)
                  throw new RuntimeException(ejbName
                        + "is defined as an XMBean, but the MBeanServer has not been initialized for it");


               delegate = new ServiceMBeanDelegate(mbeanServer, this, service.xmbean(), delegateObjectName);

               getDeployment().getKernelAbstraction().installMBean(delegateObjectName, newPolicy, delegate);
            }
         }

View Full Code Here

TOP

Related Classes of org.jboss.ejb3.annotation.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.