Package org.jboss.system.metadata

Examples of org.jboss.system.metadata.ServiceMetaData


      // assert
      assertEquals(SimpleValueSupport.wrap(123456),  component.getProperty("downCacheSize").getValue());
     
     
      // Assert attachment meta data
      ServiceMetaData service = deployment.getServices().get(0);
      assertNotNull(service);
      boolean foundAttribute = false;
      for(ServiceAttributeMetaData attribute : service.getAttributes())
      {
         if("DownCacheSize".equals(attribute.getName()))
         {
            String text = ((ServiceTextValueMetaData) attribute.getValue()).getText();
            assertEquals("123456", text);
View Full Code Here


   }
  
   @Override
   public ServiceMetaData build(ManagedConnectionFactoryDeploymentMetaData mcfmd)
   {
      ServiceMetaData md = null;
     
      if(mcfmd.getTypeMapping() != null || mcfmd.getDBMSMetaData() != null)
      {
         md = super.build(mcfmd);
        
View Full Code Here

   public abstract ObjectName buildObjectName(ManagedConnectionFactoryDeploymentMetaData md);
   public abstract String getCode(ManagedConnectionFactoryDeploymentMetaData md);

   public ServiceMetaData buildService(ManagedConnectionFactoryDeploymentMetaData mcfmd)
   {
      ServiceMetaData md = new ServiceMetaData();
      ObjectName on = buildObjectName(mcfmd);
      md.setObjectName(on);
      String code = getCode(mcfmd);
      md.setCode(code);
      ServiceConstructorMetaData cmd = buildConstructor(mcfmd);
      md.setConstructor(cmd);
      return md;
     
   }
View Full Code Here

   }
  
  
   public ServiceMetaData build(ManagedConnectionFactoryDeploymentMetaData mcfmd)
   {
      ServiceMetaData md = buildService(mcfmd);
      List<ServiceAttributeMetaData> attributes = buildAttributes(mcfmd);
      md.setAttributes(attributes);     
      List<ServiceDependencyMetaData> dependencies = buildDependencies(mcfmd);
      md.setDependencies(dependencies);
     
      return md;     
     
   }
View Full Code Here

   public ServiceMetaData unmarshal(Object e) throws Exception
   {
      ServiceMetaDataParser parser = new ServiceMetaDataParser((Element)e);     
      List<ServiceMetaData> services = parser.parse();     
     
      ServiceMetaData md = null;
     
      if(services != null)
      {
         md = services.get(0);
        
View Full Code Here

               type = KnownComponentTypes.DataSourceTypes.XA.getType();
         }

         for (AbstractBuilder builder : builders)
         {
            ServiceMetaData candidate = builder.build(data);
           
            if(candidate != null)
            {
               componentServices.add(candidate);
            }
View Full Code Here

  
   public void deploy(DeploymentUnit unit, RARDeploymentMetaData rdmd) throws DeploymentException
   {
      try
      {
         ServiceMetaData rarDeployment = new ServiceMetaData();
         String name = getObjectName(unit, rdmd);
         ObjectName objectName = new ObjectName(name);
         rarDeployment.setObjectName(objectName);
         rarDeployment.setCode(RARDeployment.class.getName());
         ServiceConstructorMetaData constructor = new ServiceConstructorMetaData();
         constructor.setSignature(new String[] { RARDeploymentMetaData.class.getName() });
         constructor.setParameters(new Object[] { rdmd });
         rarDeployment.setConstructor(constructor);
        
         List<ServiceAttributeMetaData> attributes = new ArrayList<ServiceAttributeMetaData>();
         ServiceAttributeMetaData attribute = null;
         if (workManagerName != null)
         {
            attribute = new ServiceAttributeMetaData();
            attribute.setName("WorkManager");
            attribute.setValue(new ServiceInjectionValueMetaData(workManagerName));
            attributes.add(attribute);
         }
         if (xaTerminatorName != null)
         {
            attribute = new ServiceAttributeMetaData();
            attribute.setName("XATerminator");
            attribute.setValue(new ServiceInjectionValueMetaData(xaTerminatorName, "XATerminator"));
            attributes.add(attribute);
         }
         if (attributes.isEmpty() == false)
            rarDeployment.setAttributes(attributes);
        
         // We will have to see how to define the set of dependencies
         JBossRAMetaData jmd = rdmd.getRaXmlMetaData();
         if(jmd.getDependsMetaData() != null)
         {
           //String dependsObjectName = jmd.getDependsMetaData().getDependsName();
           List<ServiceDependencyMetaData> dependencies = new ArrayList<ServiceDependencyMetaData>();
                     
           List<DependsMetaData> depends = jmd.getDependsMetaData();
          
           if(!depends.isEmpty())
           {
             Iterator<DependsMetaData> iter = depends.iterator();
             while(iter.hasNext())
             {
               DependsMetaData dmd = iter.next();
               String dependsObjectName = dmd.getDependsName();
               ServiceDependencyMetaData dependency = new ServiceDependencyMetaData();
                   dependency.setIDependOn(dependsObjectName);
                   System.out.println(unit.getSimpleName()+ "  have got the dependency on ---->>>>> "+dependsObjectName);
                   dependencies.add(dependency);
             }                
           }          
           rarDeployment.setDependencies(dependencies);
         }
         
         unit.addAttachment(ServiceMetaData.class, rarDeployment);
      }
      catch (Exception e)
View Full Code Here

   protected void deployWebModule(DeploymentUnit unit, JBossWebMetaData metaData, AbstractWarDeployment deployment) throws Exception
   {
      log.debug("deployWebModule: " + unit.getName());
      try
      {
         ServiceMetaData webModule = new ServiceMetaData();
         String name = getObjectName(metaData);
         ObjectName objectName = new ObjectName(name);
         webModule.setObjectName(objectName);
         webModule.setCode(WebModule.class.getName());
         // WebModule(DeploymentUnit, AbstractWarDeployer, AbstractWarDeployment)
         ServiceConstructorMetaData constructor = new ServiceConstructorMetaData();
         constructor.setSignature(new String[] { DeploymentUnit.class.getName(), AbstractWarDeployer.class.getName(), AbstractWarDeployment.class.getName() });
         constructor.setParameters(new Object[] { unit, this, deployment });
         webModule.setConstructor(constructor);

         List<ServiceAttributeMetaData> attrs = new ArrayList<ServiceAttributeMetaData>();

         ServiceAttributeMetaData attr = new ServiceAttributeMetaData();
         attr.setName("SecurityManagement");
         ServiceInjectionValueMetaData injectionValue = new ServiceInjectionValueMetaData(deployment.getSecurityManagementName());
         attr.setValue(injectionValue);
         attrs.add(attr);

         ServiceAttributeMetaData attrPR = new ServiceAttributeMetaData();
         attrPR.setName("PolicyRegistration");
         ServiceInjectionValueMetaData injectionValuePR = new ServiceInjectionValueMetaData(deployment.getPolicyRegistrationName());
         attrPR.setValue(injectionValuePR);
         attrs.add(attrPR);

         ServiceAttributeMetaData attrKernel = new ServiceAttributeMetaData();
         attrKernel.setName("Kernel");
         ServiceInjectionValueMetaData injectionValueKernel = new ServiceInjectionValueMetaData(KernelConstants.KERNEL_NAME);
         attrKernel.setValue(injectionValueKernel);
         attrs.add(attrKernel);

         webModule.setAttributes(attrs);

         // Dependencies...Still have old jmx names here
         Collection<String> depends = metaData.getDepends();
         List<ServiceDependencyMetaData> dependencies = new ArrayList<ServiceDependencyMetaData>();
         if (depends != null && depends.isEmpty() == false)
         {
            if (log.isTraceEnabled())
               log.trace(name + " has dependencies: " + depends);

            for (String iDependOn : depends)
            {
               ServiceDependencyMetaData sdmd = new ServiceDependencyMetaData();
               sdmd.setIDependOn(iDependOn);
               dependencies.add(sdmd);
            }
         }
         webModule.setDependencies(dependencies);

         // Here's where a bit of magic happens. By attaching the ServiceMetaData
         // to the deployment, we now make the deployment "relevant" to
         // deployers that use ServiceMetaData as an input (e.g. the
         // org.jboss.system.deployers.ServiceDeployer). Those deployers
View Full Code Here

   }

   @Override
   protected ServiceMetaData getServiceMetaData()
   {
      ServiceMetaData serviceMetaData = new ServiceMetaData();
      serviceMetaData.setCode(WarPolicyConfigurationFacade.class.getName());
      return serviceMetaData;
   }
View Full Code Here

{   
  
   @Override
   protected ServiceMetaData getServiceMetaData()
   {
      ServiceMetaData subjaccPolicy = new ServiceMetaData();
      subjaccPolicy.setCode(EarPolicyConfigurationFacade.class.getName());
      return subjaccPolicy;
   }
View Full Code Here

TOP

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

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.