Package org.osgi.service.component.runtime.dto

Examples of org.osgi.service.component.runtime.dto.ComponentDescriptionDTO


    return componentRegistry.getComponentHolder(b, name);
  }

  private ComponentDescriptionDTO holderToDescription( ComponentHolder<?> holder )
  {
    ComponentDescriptionDTO dto = new ComponentDescriptionDTO();
    ComponentMetadata m = holder.getComponentMetadata();
    dto.activate = m.getActivate();
    dto.bundle = bundleToDTO(holder.getActivator().getBundleContext());
    dto.configurationPid = m.getConfigurationPid().toArray(new String[m.getConfigurationPid().size()]);
    dto.configurationPolicy = m.getConfigurationPolicy();
View Full Code Here


        _logService.log(LogService.LOG_WARNING, sw.toString());
    }

    private void dumpState(StringWriter sw, String name)
    {
        ComponentDescriptionDTO c = _scr.getComponentDescriptionDTO(_ctx.getBundleContext().getBundle(), name);
        if ( c != null )
        {
            sw.append( name ).append( "[" ).append( _scr.isComponentEnabled(c)? "enabled":"disabled" ).append( "] " );
        }
    }
View Full Code Here

        TestCase.assertEquals( PROP_NAME, SimpleComponent.INSTANCE.getProperty( PROP_NAME ) );

        deleteConfig( pid );
        delay();

        ComponentDescriptionDTO cd = checkConfigurationCount(name, 0, -1);
        TestCase.assertNull( SimpleComponent.INSTANCE );

        disableAndCheck( cd );
        TestCase.assertNull( SimpleComponent.INSTANCE );
    }
View Full Code Here

        TestCase.assertNull( SimpleComponent.INSTANCE );

        configure( pid );
        delay();

        ComponentDescriptionDTO cd = checkConfigurationCount(name, 0, -1);
        TestCase.assertNull( SimpleComponent.INSTANCE );

        deleteConfig( pid );
        delay();
       
View Full Code Here

        return b.toString();
    }

    private void dumpA()
    {
        ComponentDescriptionDTO c = m_scr
            .getComponentDescriptionDTO(m_bctx.getBundle(), "org.apache.felix.scr.integration.components.felix3680_2.A" );
        m_logService.log( LogService.LOG_WARNING, "State of " + c.name + " enabled:" + m_scr.isComponentEnabled(c) + "\n" );
    }
View Full Code Here

    @Test
    public void test_concurrent_injection_with_bundleContext() throws Throwable
    {
        for ( int i = 0; i < 6; i++ )
        {
            final ComponentDescriptionDTO main = findComponentDescriptorByName( "org.apache.felix.scr.integration.components.felix3680_2.Main" );
            enableAndCheck(main);
            delay( 5 ); //run test for 30 seconds
            disableAndCheck(main);
            delay(); //async deactivate
            if ( log.getFirstFrameworkThrowable() != null )
View Full Code Here

    protected void doTest(String componentName) throws Exception
    {
        ServiceRegistration dep1Reg = register(new SimpleComponent(), 0);
        ServiceRegistration dep2Reg = register(new SimpleComponent2(), 1000);
       
        final ComponentDescriptionDTO main = findComponentDescriptorByName(componentName);
        TestCase.assertNotNull(main);

        asyncEnable(main); //needs to be async
        delay(300); //dep2 getService has not yet returned
        dep1Reg.unregister();
View Full Code Here

    }

    @Test
    public void test_concurrent_reference_bindings() throws Exception
    {
        final ComponentDescriptionDTO main = findComponentDescriptorByName( "org.apache.felix.scr.integration.components.felix3680.Main" );
        enableAndCheck(main);

        delay(30);
        disableAndCheck( main );
        delay( ); //async deactivate
View Full Code Here

        ServiceComponentRuntime scr = scrTracker.getService();
        if ( scr == null )
        {
          TestCase.fail("no ServiceComponentRuntime");
        }
        ComponentDescriptionDTO cd = scr.getComponentDescriptionDTO(b, name);
        Collection<ComponentConfigurationDTO> ccs = scr.getComponentConfigurationDTOs(cd);
        if (expected != -1)
        {
          for (ComponentConfigurationDTO cc: ccs)
          {
View Full Code Here

    ServiceComponentRuntime scr = scrTracker.getService();
        if ( scr == null )
        {
          TestCase.fail("no ServiceComponentRuntime");
        }
      ComponentDescriptionDTO cd = scr.getComponentDescriptionDTO(b, name);
      Assert.assertFalse("Expected component disabled", scr.isComponentEnabled(cd));
      scr.enableComponent(cd).getValue();
      Assert.assertTrue("Expected component enabled", scr.isComponentEnabled(cd));
     
      Collection<ComponentConfigurationDTO> ccs = scr.getComponentConfigurationDTOs(cd);
View Full Code Here

TOP

Related Classes of org.osgi.service.component.runtime.dto.ComponentDescriptionDTO

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.