Package org.jboss.system.metadata

Examples of org.jboss.system.metadata.ServiceConstructorMetaData


   }

   private void createTopLevelServiceBeanWithMetaData(String contextId, DeploymentUnit unit, T deployment)
   {
      // Provide a constructor for the service bean
      ServiceConstructorMetaData serviceConstructor = new ServiceConstructorMetaData();
      serviceConstructor.setSignature(new String[]{String.class.getName(), this.getMetaDataClassType().getName(),
            Boolean.class.getName()});
      serviceConstructor.setParameters(new Object[]{contextId, deployment, Boolean.TRUE});
      createJaccPolicyBean(serviceConstructor, unit);
   }
View Full Code Here


            ": malformed EjbModule name", e);
      }

      ejbModule.setObjectName(moduleObjectName);

      ServiceConstructorMetaData ctor = new ServiceConstructorMetaData();
      ctor.setSignature(
         new String[]{VFSDeploymentUnit.class.getName(), ApplicationMetaData.class.getName()}
      );
      ctor.setParameters(new Object[]{unit, legacyMD});
      ejbModule.setConstructor(ctor);

      // set attributes
      List<ServiceAttributeMetaData> attrs = new ArrayList<ServiceAttributeMetaData>();
      // Transaction manager
View Full Code Here

   private static ServiceInstance installStandardMBean(MBeanServer server, ObjectName objectName, ServiceMetaData metaData) throws Exception
   {
      ObjectName loaderName = metaData.getClassLoaderName();
      ClassLoader loader = server.getClassLoader(loaderName);
      String code = metaData.getCode();
      ServiceConstructorMetaData constructor = metaData.getConstructor();
      String interfaceName = metaData.getInterfaceName();

      Class<?> intf = loader.loadClass(interfaceName);
      log.debug("About to create bean resource: " + objectName + " with code: " + code + " and interface " + interfaceName);
      Object resource = server.instantiate(code,
                                           loaderName,
                                           constructor.getParameters(loader),
                                           constructor.getSignature());

      log.debug("About to register StandardMBean : " + objectName);
      ObjectInstance instance = server.createMBean(StandardMBean.class.getName(),
                                                   objectName,
                                                   loaderName,
View Full Code Here

   private static ServiceInstance installPlainMBean(MBeanServer server, ObjectName objectName, ServiceMetaData metaData) throws Exception
   {
      ObjectName loaderName = metaData.getClassLoaderName();
      ClassLoader loader = server.getClassLoader(loaderName);
      String code = metaData.getCode();
      ServiceConstructorMetaData constructor = metaData.getConstructor();
     
      // This is a standard or dynamic mbean
      log.debug("About to create bean: " + objectName + " with code: " + code);
      ObjectInstance instance = server.createMBean(code,
                                                   objectName,
                                                   loaderName,
                                                   constructor.getParameters(loader),
                                                   constructor.getSignature());

      MBeanEntry entry = (MBeanEntry) server.invoke(MBEAN_REGISTRY, "get", new Object[] { objectName }, new String[] { ObjectName.class.getName() });
      Object resource = entry.getResourceInstance();
      return new ServiceInstance(instance, resource);
   }
View Full Code Here

   private static ServiceInstance installEmbeddedXMBean(MBeanServer server, ObjectName objectName, ServiceMetaData metaData) throws Exception
   {
      ObjectName loaderName = metaData.getClassLoaderName();
      ClassLoader loader = server.getClassLoader(loaderName);
      String code = metaData.getCode();
      ServiceConstructorMetaData constructor = metaData.getConstructor();

      // This is an xmbean with an embedded mbean descriptor
      log.debug("About to create xmbean object: " + objectName + " with code: " + code + " with embedded descriptor");
      //xmbean: construct object first.
      Object resource = server.instantiate(code,
                                           loaderName,
                                           constructor.getParameters(loader),
                                           constructor.getSignature());

      String xmbeanCode = metaData.getXMBeanCode();
      Element mbeanDescriptor = metaData.getXMBeanDescriptor();
      Object[] args = { resource, mbeanDescriptor, ServiceConstants.PUBLIC_JBOSSMX_XMBEAN_DTD_1_0 };
      String[] sig = { Object.class.getName(), Element.class.getName(), String.class.getName() };
View Full Code Here

   private static ServiceInstance installExternalXMBean(MBeanServer server, ObjectName objectName, ServiceMetaData metaData) throws Exception
   {
      ObjectName loaderName = metaData.getClassLoaderName();
      ClassLoader loader = server.getClassLoader(loaderName);
      String code = metaData.getCode();
      ServiceConstructorMetaData constructor = metaData.getConstructor();
      String xmbeanDD = metaData.getXMBeanDD();
     
      // This is an xmbean with an external descriptor
      log.debug("About to create xmbean object: " + objectName  + " with code: " + code + " with descriptor: " + xmbeanDD);
      //xmbean: construct object first.
      Object resource = server.instantiate(code,
                                           loaderName,
                                           constructor.getParameters(loader),
                                           constructor.getSignature());
      // Try to find the dd first as a resource then as a URL
      URL xmbeanddUrl = null;
      try
      {
         xmbeanddUrl = resource.getClass().getClassLoader().getResource(xmbeanDD);
View Full Code Here

/*     */     throws Exception
/*     */   {
/* 157 */     ObjectName loaderName = metaData.getClassLoaderName();
/* 158 */     ClassLoader loader = server.getClassLoader(loaderName);
/* 159 */     String code = metaData.getCode();
/* 160 */     ServiceConstructorMetaData constructor = metaData.getConstructor();
/* 161 */     String interfaceName = metaData.getInterfaceName();
/*     */
/* 163 */     Class intf = loader.loadClass(interfaceName);
/* 164 */     log.debug("About to create bean resource: " + objectName + " with code: " + code + " and interface " + interfaceName);
/* 165 */     Object resource = server.instantiate(code, loaderName, constructor.getParameters(loader), constructor.getSignature());
/*     */
/* 170 */     log.debug("About to register StandardMBean : " + objectName);
/* 171 */     ObjectInstance instance = server.createMBean(StandardMBean.class.getName(), objectName, loaderName, new Object[] { resource, intf }, new String[] { Object.class.getName(), Class.class.getName() });
/*     */
/* 176 */     return new ServiceInstance(instance, resource);
View Full Code Here

/*     */     throws Exception
/*     */   {
/* 190 */     ObjectName loaderName = metaData.getClassLoaderName();
/* 191 */     ClassLoader loader = server.getClassLoader(loaderName);
/* 192 */     String code = metaData.getCode();
/* 193 */     ServiceConstructorMetaData constructor = metaData.getConstructor();
/*     */
/* 196 */     log.debug("About to create bean: " + objectName + " with code: " + code);
/* 197 */     ObjectInstance instance = server.createMBean(code, objectName, loaderName, constructor.getParameters(loader), constructor.getSignature());
/*     */
/* 203 */     MBeanEntry entry = (MBeanEntry)server.invoke(MBEAN_REGISTRY, "get", new Object[] { objectName }, new String[] { ObjectName.class.getName() });
/* 204 */     Object resource = entry.getResourceInstance();
/* 205 */     return new ServiceInstance(instance, resource);
/*     */   }
View Full Code Here

/*     */     throws Exception
/*     */   {
/* 219 */     ObjectName loaderName = metaData.getClassLoaderName();
/* 220 */     ClassLoader loader = server.getClassLoader(loaderName);
/* 221 */     String code = metaData.getCode();
/* 222 */     ServiceConstructorMetaData constructor = metaData.getConstructor();
/*     */
/* 225 */     log.debug("About to create xmbean object: " + objectName + " with code: " + code + " with embedded descriptor");
/*     */
/* 227 */     Object resource = server.instantiate(code, loaderName, constructor.getParameters(loader), constructor.getSignature());
/*     */
/* 232 */     String xmbeanCode = metaData.getXMBeanCode();
/* 233 */     Element mbeanDescriptor = metaData.getXMBeanDescriptor();
/* 234 */     Object[] args = { resource, mbeanDescriptor, "-//JBoss//DTD JBOSS XMBEAN 1.0//EN" };
/* 235 */     String[] sig = { Object.class.getName(), Element.class.getName(), String.class.getName() };
View Full Code Here

/*     */     throws Exception
/*     */   {
/* 255 */     ObjectName loaderName = metaData.getClassLoaderName();
/* 256 */     ClassLoader loader = server.getClassLoader(loaderName);
/* 257 */     String code = metaData.getCode();
/* 258 */     ServiceConstructorMetaData constructor = metaData.getConstructor();
/* 259 */     String xmbeanDD = metaData.getXMBeanDD();
/*     */
/* 262 */     log.debug("About to create xmbean object: " + objectName + " with code: " + code + " with descriptor: " + xmbeanDD);
/*     */
/* 264 */     Object resource = server.instantiate(code, loaderName, constructor.getParameters(loader), constructor.getSignature());
/*     */
/* 269 */     URL xmbeanddUrl = null;
/*     */     try
/*     */     {
/* 272 */       xmbeanddUrl = resource.getClass().getClassLoader().getResource(xmbeanDD);
View Full Code Here

TOP

Related Classes of org.jboss.system.metadata.ServiceConstructorMetaData

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.