Package org.jboss.system.metadata

Examples of org.jboss.system.metadata.ServiceMetaData


  
   @Override
   protected ManagedObject getComponent(Object attachment, PersistedComponent component, boolean create)
   {
      ServiceDeployment deployment = (ServiceDeployment) attachment;
      ServiceMetaData service = null;
      List<ServiceMetaData> services = deployment.getServices();
      if(services == null)
      {
         services = new ArrayList<ServiceMetaData>();
         deployment.setServices(services);
View Full Code Here


      deployment.setServices(services);
   }
  
   protected ServiceMetaData createEmptyServiceMetaData(PersistedComponent component)
   {
      ServiceMetaData service = new ServiceMetaData();
      ObjectName objectName = null;
      try
      {
         objectName = new ObjectName(component.getOriginalName());
         service.setObjectName(objectName);
      }
      catch (MalformedObjectNameException e)
      {
         // TODO: this should not happen, but we might could just ignore this
         // as the Persistence should restore the object name anyway
View Full Code Here

/*     */     }
/* 356 */     ServiceMetaDataParser parser = new ServiceMetaDataParser(mbeanElement);
/* 357 */     List metaDatas = parser.parse();
/* 358 */     if (metaDatas.isEmpty())
/* 359 */       throw new DeploymentException("No mbeans found in passed configuration for " + mbeanName);
/* 360 */     ServiceMetaData metaData = (ServiceMetaData)metaDatas.get(0);
/* 361 */     metaData.setClassLoaderName(loaderName);
/* 362 */     ServiceInstance instance = install(this.server, mbeanName, metaData, null);
/* 363 */     return instance.getObjectInstance();
/*     */   }
View Full Code Here

/*     */     throws Exception
/*     */   {
/* 635 */     this.log.debug("deployWebModule");
/*     */     try
/*     */     {
/* 638 */       ServiceMetaData webModule = new ServiceMetaData();
/* 639 */       String name = getObjectName(metaData);
/* 640 */       ObjectName objectName = new ObjectName(name);
/* 641 */       webModule.setObjectName(objectName);
/* 642 */       webModule.setCode(WebModule.class.getName());
/*     */
/* 644 */       ServiceConstructorMetaData constructor = new ServiceConstructorMetaData();
/* 645 */       constructor.setSignature(new String[] { VFSDeploymentUnit.class.getName(), AbstractWarDeployer.class.getName(), AbstractWarDeployment.class.getName() });
/*     */
/* 647 */       constructor.setParameters(new Object[] { unit, this, deployment });
/* 648 */       webModule.setConstructor(constructor);
/*     */
/* 651 */       Collection depends = metaData.getDepends();
/* 652 */       List dependencies = new ArrayList();
/* 653 */       if (depends != null)
/*     */       {
/* 655 */         for (String iDependOn : depends)
/*     */         {
/* 657 */           ServiceDependencyMetaData sdmd = new ServiceDependencyMetaData();
/* 658 */           sdmd.setIDependOn(iDependOn);
/*     */         }
/*     */       }
/* 661 */       webModule.setDependencies(dependencies);
/*     */
/* 665 */       unit.addAttachment(ServiceMetaData.class, webModule);
/*     */     }
/*     */     catch (Exception e)
/*     */     {
View Full Code Here

/* 105 */         throw new DeploymentException("Failed to find ServiceDeployment in " + unit.getName());
/* 106 */       List services = service.getServices();
/*     */
/* 108 */       if (services.size() != 1)
/* 109 */         throw new DeploymentException("Expected only 1 ServiceMetaData but saw " + services.size() + " in " + unit.getName());
/* 110 */       ServiceMetaData dsMetaData = (ServiceMetaData)services.get(0);
/* 111 */       String attachName = ServiceMetaData.class.getName();
/* 112 */       ManagedObject mo = new ServiceManagedObject(attachName, dsMetaData, this.propertyNameMappings);
/* 113 */       ManagedObject wrapMO = WrapperAdvice.wrapManagedObject(mo);
/* 114 */       map.put(attachName, wrapMO);
/*     */
View Full Code Here

/*     */   {
/* 139 */     ServiceDeployment deployment = new ServiceDeployment();
/* 140 */     DataSourceDeployment ds = new DataSourceDeployment();
/* 141 */     ds.parse(document);
/*     */
/* 143 */     ServiceMetaData dsMbean = createDsServiceMetaData(ds);
/* 144 */     ArrayList services = new ArrayList();
/* 145 */     services.add(dsMbean);
/* 146 */     deployment.setServices(services);
/*     */
/* 148 */     ComponentType type = new ComponentType("FakeDataSource", "LocalTx");
View Full Code Here

/*     */   }
/*     */
/*     */   public ServiceMetaData createDsServiceMetaData(DataSourceDeployment ds)
/*     */     throws Exception
/*     */   {
/* 163 */     ServiceMetaData dsMbean = new ServiceMetaData();
/* 164 */     this.log.info("DataSource settings: " + ds);
/*     */
/* 166 */     String jndiName = ds.getJndiName() == null ? "DefaultFakeDS" : ds.getJndiName();
/* 167 */     ObjectName objectName = new ObjectName("jboss.jca:type=FakeDataSourceConn,jndiName=" + jndiName);
/* 168 */     dsMbean.setObjectName(objectName);
/* 169 */     dsMbean.setCode(FakeDataSourceConn.class.getName());
/*     */
/* 171 */     ServiceConstructorMetaData constructor = new ServiceConstructorMetaData();
/* 172 */     constructor.setSignature(new String[] { DataSourceDeployment.class.getName() });
/* 173 */     constructor.setParameters(new Object[] { ds });
/* 174 */     dsMbean.setConstructor(constructor);
/*     */
/* 177 */     List attributes = new ArrayList();
/* 178 */     ServiceAttributeMetaData attribute = new ServiceAttributeMetaData();
/*     */
/* 180 */     attribute.setName("JndiName");
/* 181 */     attribute.setReplace(true);
/* 182 */     attribute.setTrim(true);
/* 183 */     attribute.setValue(new ServiceTextValueMetaData(jndiName));
/* 184 */     attributes.add(attribute);
/*     */
/* 186 */     attribute = new ServiceAttributeMetaData();
/* 187 */     attribute.setName("JdbcURL");
/* 188 */     if (ds.getJdbcURL() != null)
/* 189 */       attribute.setValue(new ServiceTextValueMetaData(ds.getJdbcURL()));
/* 190 */     attributes.add(attribute);
/*     */
/* 192 */     attribute = new ServiceAttributeMetaData();
/* 193 */     attribute.setName("DriverClass");
/* 194 */     if (ds.getDriverClass() != null)
/* 195 */       attribute.setValue(new ServiceTextValueMetaData(ds.getDriverClass()));
/* 196 */     attributes.add(attribute);
/*     */
/* 198 */     attribute = new ServiceAttributeMetaData();
/* 199 */     attribute.setName("Username");
/* 200 */     if (ds.getUsername() != null)
/* 201 */       attribute.setValue(new ServiceTextValueMetaData(ds.getUsername()));
/* 202 */     attributes.add(attribute);
/*     */
/* 204 */     attribute = new ServiceAttributeMetaData();
/* 205 */     attribute.setName("Password");
/* 206 */     if (ds.getPassword() != null)
/* 207 */       attribute.setValue(new ServiceTextValueMetaData(ds.getPassword()));
/* 208 */     attributes.add(attribute);
/*     */
/* 210 */     attribute = new ServiceAttributeMetaData();
/* 211 */     attribute.setName("SecurityDomain");
/* 212 */     if (ds.getSecurityDomain() != null)
/* 213 */       attribute.setValue(new ServiceTextValueMetaData(ds.getSecurityDomain()));
/* 214 */     attributes.add(attribute);
/*     */
/* 216 */     attribute = new ServiceAttributeMetaData();
/* 217 */     attribute.setName("MinPoolSize");
/* 218 */     if (ds.getMinPoolSize() != null)
/* 219 */       attribute.setValue(new ServiceTextValueMetaData(ds.getMinPoolSize()));
/* 220 */     attributes.add(attribute);
/*     */
/* 222 */     attribute = new ServiceAttributeMetaData();
/* 223 */     attribute.setName("MaxPoolSize");
/* 224 */     if (ds.getMaxPoolSize() != null)
/* 225 */       attribute.setValue(new ServiceTextValueMetaData(ds.getMaxPoolSize()));
/* 226 */     attributes.add(attribute);
/*     */
/* 228 */     attribute = new ServiceAttributeMetaData();
/* 229 */     attribute.setName("ConnectionProperties");
/* 230 */     if (ds.getMaxPoolSize() != null)
/* 231 */       attribute.setValue(new ServiceTextValueMetaData(ds.getMaxPoolSize()));
/* 232 */     attributes.add(attribute);
/*     */
/* 234 */     dsMbean.setAttributes(attributes);
/*     */
/* 237 */     Collection depends = ds.getDepends();
/* 238 */     List dependencies = new ArrayList();
/* 239 */     for (String iDependOn : depends)
/*     */     {
/* 241 */       ServiceDependencyMetaData sdmd = new ServiceDependencyMetaData();
/* 242 */       sdmd.setIDependOn(iDependOn);
/*     */     }
/* 244 */     dsMbean.setDependencies(dependencies);
/* 245 */     return dsMbean;
/*     */   }
View Full Code Here

/*    */   {
/* 46 */     ServiceController controller = context.getServiceController();
/* 47 */     MBeanServer server = controller.getMBeanServer();
/* 48 */     ObjectName objectName = context.getObjectName();
/*    */
/* 51 */     ServiceMetaData metaData = context.getServiceMetaData();
/* 52 */     if (metaData != null)
/*    */     {
/* 54 */       List attrs = metaData.getAttributes();
/* 55 */       if (attrs.size() > 0)
/*    */       {
/* 57 */         ObjectName classLoaderName = metaData.getClassLoaderName();
/* 58 */         ServiceConfigurator.configure(null, controller, objectName, classLoaderName, attrs);
/*    */       }
/*    */
/*    */     }
/*    */
View Full Code Here

/*    */   public void installAction(ServiceControllerContext context)
/*    */     throws Throwable
/*    */   {
/* 41 */     MBeanServer server = context.getServiceController().getMBeanServer();
/* 42 */     ObjectName objectName = context.getObjectName();
/* 43 */     ServiceMetaData metaData = context.getServiceMetaData();
/* 44 */     Object mbean = context.getTarget();
/* 45 */     ServiceInstance instance = ServiceCreator.install(server, objectName, metaData, mbean);
/* 46 */     context.setTarget(instance.getResource());
/*    */   }
View Full Code Here

/*    */   public void uninstallAction(ServiceControllerContext context)
/*    */   {
/* 51 */     MBeanServer server = context.getServiceController().getMBeanServer();
/* 52 */     ObjectName objectName = context.getObjectName();
/* 53 */     ServiceCreator.uninstall(server, objectName);
/* 54 */     ServiceMetaData metaData = context.getServiceMetaData();
/* 55 */     if (metaData != null)
/* 56 */       context.setTarget(null);
/*    */   }
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.