Examples of ComponentContext


Examples of org.osgi.service.component.ComponentContext

                logger.debug("Registering {} resources with OSGi installer: {}", resources.size(), resources);
                installer.registerResources(URL_SCHEME, resources.toArray(new InstallableResource[resources.size()]));
            } catch (final RepositoryException re) {
                logger.error("Repository exception during startup - deactivating installer!", re);
                active = false;
                final ComponentContext ctx = componentContext;
                if ( ctx  != null ) {
                    final String name = (String) componentContext.getProperties().get(
                            ComponentConstants.COMPONENT_NAME);
                    ctx.disableComponent(name);
                }
            }
            while (active) {
                runOneCycle();
            }
View Full Code Here

Examples of org.osoa.sca.ComponentContext

        // Lookup the component in the domain
        Component component = components.get(componentName);
        if (component == null) {
            throw new ServiceRuntimeException("Component not found: " + componentName);
        }
        ComponentContext componentContext = null;

        // If the component is a composite, then we need to find the
        // non-composite
        // component that provides the requested service
        if (component.getImplementation() instanceof Composite) {
            ComponentService promotedService = null;
            for (ComponentService componentService : component.getServices()) {
                if (serviceName == null || serviceName.equals(componentService.getName())) {

                    CompositeService compositeService = (CompositeService)componentService.getService();
                    if (compositeService != null) {
                        promotedService = compositeService.getPromotedService();
                        SCABinding scaBinding = promotedService.getBinding(SCABinding.class);
                        if (scaBinding != null) {
                            Component promotedComponent = scaBinding.getComponent();
                            if (serviceName != null) {
                                serviceName = "$promoted$." + serviceName;
                            }
                            componentContext = (ComponentContext)promotedComponent;
                        }
                    }
                    break;
                }
            }
            if (componentContext == null) {
                throw new ServiceRuntimeException("Composite service not found: " + name);
            }
        } else {
            componentContext = (ComponentContext)component;
        }

        ServiceReference<B> serviceReference;
        if (serviceName != null) {
            serviceReference = componentContext.createSelfReference(businessInterface, serviceName);
        } else {
            serviceReference = componentContext.createSelfReference(businessInterface);
        }
        return serviceReference;

    }
View Full Code Here

Examples of org.xmatthew.spy2servers.core.context.ComponentContext

    public void afterPropertiesSet() throws Exception {
        if (context == null) {
            LOGGER.error("context is null");
        }
       
        ComponentContext componentContext;
        componentContext = ComponentContextUtils.getComponentContext(context);
       
        //start CoreComponent
        fireComponent(this, componentContext);
       
        for (Component component : componentContext.getComponents()) {
            if (component instanceof CoreComponent) {
                continue;
            }
            fireComponent(component, componentContext);
        }
View Full Code Here

Examples of org.zkoss.cdi.weld.context.ComponentContext

  public void afterBeanDiscovery(@Observes AfterBeanDiscovery event, BeanManager manager) {
    //register ZK contexts
    event.addContext(new DesktopContext());
    event.addContext(new PageContext());
    event.addContext(new IdSpaceContext());
    event.addContext(new ComponentContext());
    event.addContext(new ExecutionContext());
    log.info("ZK Weld Extension "+Version.UID);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.