Package org.jboss.managed.plugins

Examples of org.jboss.managed.plugins.ManagedComponentImpl


            ops.add(shutdown);
            MutableManagedObject mmo = MutableManagedObject.class.cast(serverMO);
            mmo.setOperations(ops);
         }
      }
      ManagedComponentImpl serverComp = new ManagedComponentImpl(type, null, serverMO);

      // ServerConfig
      type = new ComponentType("MCBean", "ServerConfig");
      ManagedObject mo = managedObjectFactory.initManagedObject(server.getConfiguration(), null);
      ManagedComponentImpl configComp = new ManagedComponentImpl(type, null, mo);

      view.addManagedComponent(serverComp);
      view.addManagedComponent(configComp);
     
   }
View Full Code Here


      CollectionValue bindingSets = (CollectionValue) mo.getProperty("standardBindings").getValue();
      assertNotNull(bindingSets);
      setPortValue("HttpsConnector", bindingSets, 13245);

      // Persist
      ManagedComponent component = new ManagedComponentImpl(null, null, mo);
      PersistenceRoot root = getPersistenceFactory().updateComponent(deploymentMO, component);
      root.setClassName(AbstractKernelDeployment.class.getName());
      root = restore(root);
     
      // Undeploy
View Full Code Here

      // Create ManagedComponents for ManagedObjects annotated with ManagementComponent
      ManagementComponent mc = (ManagementComponent) moAnns.get(ManagementComponent.class.getName());
      if (mc != null && md.getComponent(mo.getName()) == null)
      {
         ComponentType type = new ComponentType(mc.type(), mc.subtype());
         ManagedComponentImpl comp = new TempManagedComponentImpl(type, md, mo);
         md.addComponent(mo.getName(), comp);
         log.debug("Processing ManagementComponent("+mo.getName()+"): "+comp);
         Set<ManagedComponent> typeComps = compByCompType.get(type);
         if (typeComps == null)
         {
View Full Code Here

   }

   private Object writeReplace() throws ObjectStreamException
   {
      // Only expose the ManagedComponentImpl
      ManagedComponentImpl comp = new ManagedComponentImpl(getType(), getDeployment(), getDelegate(), getStateMapper());
      comp.setRunState(getRunState());
      return comp;
   }
View Full Code Here

      // Create ManagedComponents for ManagedObjects annotated with ManagementComponent
      ManagementComponent mc = (ManagementComponent) moAnns.get(ManagementComponent.class.getName());
      if (mc != null && md.getComponent(mo.getName()) == null)
      {
         ComponentType type = new ComponentType(mc.type(), mc.subtype());
         ManagedComponentImpl comp = new ManagedComponentImpl(type, md, mo);
         md.addComponent(mo.getName(), comp);
         log.debug("Processing ManagementComponent("+mo.getName()+"): "+comp);
         Set<ManagedComponent> typeComps = compByCompType.get(type);
         if (typeComps == null)
         {
View Full Code Here

      ManagedObject q1MO = (ManagedObject) q1GV.getValue();
      assertNotNull(q1MO);

      ComponentType type = new ComponentType("JMSDestination", "queue");
      RunStateMapper stateMapper = null;
      ManagedComponentImpl mc = new ManagedComponentImpl(type, md, q1MO, stateMapper);
      md.addComponent(q1MO.getName(), mc);

      RunState state = mc.getRunState();
      assertEquals(RunState.RUNNING, state);
   }
View Full Code Here

      // Create ManagedComponents for
      ManagementComponent mc = (ManagementComponent) moAnns.get(ManagementComponent.class.getName());
      if (mc != null)
      {
         ComponentType type = new ComponentType(mc.type(), mc.subtype());
         ManagedComponentImpl comp = new ManagedComponentImpl(type, md, mo);
         md.addComponent(mo.getName(), comp);
      }

      // Scan for @ManagementObjectRef
      for(ManagedProperty prop : mo.getProperties().values())
View Full Code Here

               ManagementComponent mc = (ManagementComponent) moAnns.get(ManagementComponent.class.getName());
               if(mc != null)
               {
                  type = new ComponentType(mc.type(), mc.subtype());
               }
               ManagedComponentImpl comp = new ManagedComponentImpl(type, md, bmdMO);
               md.addComponent(bmdMO.getName(), comp);
               log.debug("Created ManagedComponent("+comp.getName()+") of type: "
                     +type
                     +" for MO: "+bmdMO.getName()
                     +", componentName: "+bmdMO.getComponentName());              
            }

            if(md != null)
               bootstrapMDs.put(kd.getName(), md);
         }

         // Add other Server managed objects
         if(firstDeployment != null)
         {
            ComponentType type = new ComponentType("MCBean", "MCServer");
            ManagedObject serverMO = mof.initManagedObject(mcserver, null);
            if (serverMO.getOperations() != null && serverMO.getOperations().size() == 0)
            {
               ManagedOperationImpl shutdown = new ManagedOperationImpl("Shutdown the server", "shutdown");
               if(serverMO instanceof MutableManagedObject)
               {
                  HashSet<ManagedOperation> ops = new HashSet<ManagedOperation>();
                  ops.add(shutdown);
                  MutableManagedObject mmo = MutableManagedObject.class.cast(serverMO);
                  mmo.setOperations(ops);
               }
            }
            ManagedComponentImpl serverComp = new ManagedComponentImpl(type, firstDeployment, serverMO);
            firstDeployment.addComponent("MCServer", serverComp);
            try
            {
               BeanInfo mcserverInfo = configurator.getBeanInfo(mcserver.getClass());
               BeanKernelRegistryEntry entry = new BeanKernelRegistryEntry(mcserver, mcserverInfo);
               bootstrapEntries.put(serverComp.getComponentName(), entry);
            }
            catch(Throwable t)
            {
               log.error("Failed to create BeanInfo for: "+serverComp, t);
            }
            // ServerConfig
            type = new ComponentType("MCBean", "ServerConfig");
            ServerConfig config = mcserver.getConfig();
            ManagedObject mo = mof.initManagedObject(config, null);
            ManagedComponentImpl configComp = new ManagedComponentImpl(type, firstDeployment, mo);
            firstDeployment.addComponent("ServerConfig", configComp);
            log.debug("Created ManagedComponent of type: "+type+" for ServerConfig");
         }
      }
   }
View Full Code Here

/* 263 */     ManagementComponent mc = (ManagementComponent)moAnns.get(ManagementComponent.class.getName());
/* 264 */     if (mc != null)
/*     */     {
/* 266 */       log.debug("Processing ManagementComponent: " + mc);
/* 267 */       ComponentType type = new ComponentType(mc.type(), mc.subtype());
/* 268 */       ManagedComponentImpl comp = new ManagedComponentImpl(type, md, mo);
/* 269 */       md.addComponent(mo.getName(), comp);
/* 270 */       Set typeComps = (Set)this.compByCompType.get(type);
/* 271 */       if (typeComps == null)
/*     */       {
/* 273 */         typeComps = new HashSet();
View Full Code Here

TOP

Related Classes of org.jboss.managed.plugins.ManagedComponentImpl

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.