Java Code Examples for org.osgi.service.blueprint.container.BlueprintContainer

The following examples show how to use org.osgi.service.blueprint.container.BlueprintContainer. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: bgpcep   Source File: BGPClusterSingletonService.java    License: Eclipse Public License 1.0 6 votes vote down vote up
BGPClusterSingletonService(
        final @NonNull PeerGroupConfigLoader peerGroupLoader,
        final @NonNull ClusterSingletonServiceProvider provider,
        final @NonNull BGPTableTypeRegistryConsumer tableTypeRegistry,
        final @NonNull BlueprintContainer container,
        final @NonNull BundleContext bundleContext,
        final @NonNull InstanceIdentifier<Bgp> bgpIid) {
    this.peerGroupLoader = peerGroupLoader;
    this.tableTypeRegistry = tableTypeRegistry;
    this.container = container;
    this.bundleContext = bundleContext;
    this.bgpIid = bgpIid;
    final String ribInstanceName = getRibInstanceName(bgpIid);
    this.serviceGroupIdentifier = ServiceGroupIdentifier.create(ribInstanceName + "-service-group");
    LOG.info("BGPClusterSingletonService {} registered", this.serviceGroupIdentifier.getName());
    ClusterSingletonServiceRegistrationHelper
            .registerSingletonService(provider, this);
}
 
Example 2
Source Project: bgpcep   Source File: BgpDeployerImpl.java    License: Eclipse Public License 1.0 6 votes vote down vote up
public BgpDeployerImpl(final String networkInstanceName,
                       final ClusterSingletonServiceProvider provider,
                       final BlueprintContainer container,
                       final BundleContext bundleContext,
                       final DataBroker dataBroker,
                       final BGPTableTypeRegistryConsumer mappingService) {
    this.dataBroker = requireNonNull(dataBroker);
    this.provider = requireNonNull(provider);
    this.networkInstanceName = requireNonNull(networkInstanceName);
    this.container = requireNonNull(container);
    this.bundleContext = requireNonNull(bundleContext);
    this.tableTypeRegistry = requireNonNull(mappingService);
    this.networkInstanceIId = InstanceIdentifier.create(NetworkInstances.class)
            .child(NetworkInstance.class, new NetworkInstanceKey(networkInstanceName));
    initializeNetworkInstance(dataBroker, this.networkInstanceIId).addCallback(new FutureCallback<CommitInfo>() {
        @Override
        public void onSuccess(final CommitInfo result) {
            LOG.debug("Network Instance {} initialized successfully.", networkInstanceName);
        }

        @Override
        public void onFailure(final Throwable throwable) {
            LOG.error("Failed to initialize Network Instance {}.", networkInstanceName, throwable);
        }
    }, MoreExecutors.directExecutor());
}
 
Example 3
Source Project: cxf   Source File: BlueprintBeanLocator.java    License: Apache License 2.0 6 votes vote down vote up
static Class<?> getClassForMetaData(BlueprintContainer container, ComponentMetadata cmd) {
    Class<?> cls = null;
    if (cmd instanceof BeanMetadata) {
        BeanMetadata bm = (BeanMetadata)cmd;
        if (bm instanceof ExtendedBeanMetadata) {
            cls = ((ExtendedBeanMetadata)bm).getRuntimeClass();
        }
        if (cls == null && container instanceof ExtendedBlueprintContainer && bm.getClassName() != null) {
            try {
                cls = ((ExtendedBlueprintContainer)container).loadClass(bm.getClassName());
            } catch (ClassNotFoundException cnfe) {
                //ignore
            }
        }
    }
    return cls;
}
 
Example 4
Source Project: bgpcep   Source File: PCEPTopologyDeployerImpl.java    License: Eclipse Public License 1.0 5 votes vote down vote up
public PCEPTopologyDeployerImpl(final BlueprintContainer container,
        final DataBroker dataBroker, final InstructionSchedulerFactory instructionSchedulerFactory) {
    this.container = requireNonNull(container);
    this.dataBroker = requireNonNull(dataBroker);
    this.instructionSchedulerFactory = requireNonNull(instructionSchedulerFactory);
    this.networTopology = InstanceIdentifier.builder(NetworkTopology.class).build();
}
 
Example 5
Source Project: cxf   Source File: CXFBlueprintServlet.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected void loadBus(ServletConfig servletConfig) {
    BlueprintContainer container =
        (BlueprintContainer)servletConfig.getServletContext().getAttribute(CONTAINER_ATTRIBUTE);

    if (container != null) {
        Object busComponent = container.getComponentInstance("cxf");
        setBus((Bus)busComponent);
    } else {
        busCreated = true;
        setBus(BusFactory.newInstance().createBus());
    }
}
 
Example 6
Source Project: cxf   Source File: BlueprintBeanLocator.java    License: Apache License 2.0 5 votes vote down vote up
public BlueprintBeanLocator(ConfiguredBeanLocator orig,
                            BlueprintContainer cont,
                            BundleContext context) {
    this.orig = orig;
    this.container = cont;
    this.context = context;
    if (orig instanceof ExtensionManagerImpl) {
        List<String> names = new ArrayList<>(container.getComponentIds());
        ((ExtensionManagerImpl)orig).removeBeansOfNames(names);
    }
}
 
Example 7
@Test
public void initProcessApplicationElResolver() {
  BlueprintContainer containerMock = createBlueprintContainerMock();
  OSGiProcessApplication app = new OSGiProcessApplication(createBundleMock(), containerMock);
  ELResolver elResolver = app.getElResolver();
  assertThat(elResolver, is(instanceOf(BlueprintBundleLocalELResolver.class)));
  assertThat(((BlueprintBundleLocalELResolver) elResolver).getBlueprintContainer(), is(sameInstance(containerMock)));
}
 
Example 8
public BlueprintContextELResolver(BlueprintContainer blueprintContainer) {
  this.blueprintContainer = blueprintContainer;
}
 
Example 9
public void setBlueprintContainer(BlueprintContainer blueprintContainer) {
  this.blueprintContainer = blueprintContainer;
}
 
Example 10
public BlueprintContextELResolver(BlueprintContainer blueprintContainer) {
    this.blueprintContainer = blueprintContainer;
}
 
Example 11
public void setBlueprintContainer(BlueprintContainer blueprintContainer) {
    this.blueprintContainer = blueprintContainer;
}
 
Example 12
Source Project: cxf   Source File: OSGiJaxwsEndpointManager.java    License: Apache License 2.0 4 votes vote down vote up
public void setBlueprintContainer(BlueprintContainer c) {
    this.container = c;
}
 
Example 13
Source Project: cxf   Source File: JAXWSBPNamespaceHandler.java    License: Apache License 2.0 4 votes vote down vote up
public BlueprintContainer getBlueprintContainer() {
    return blueprintContainer;
}
 
Example 14
Source Project: cxf   Source File: JAXWSBPNamespaceHandler.java    License: Apache License 2.0 4 votes vote down vote up
public void setBlueprintContainer(BlueprintContainer blueprintContainer) {
    this.blueprintContainer = blueprintContainer;
}
 
Example 15
Source Project: cxf   Source File: SimpleBPNamespaceHandler.java    License: Apache License 2.0 4 votes vote down vote up
public BlueprintContainer getBlueprintContainer() {
    return blueprintContainer;
}
 
Example 16
Source Project: cxf   Source File: SimpleBPNamespaceHandler.java    License: Apache License 2.0 4 votes vote down vote up
public void setBlueprintContainer(BlueprintContainer blueprintContainer) {
    this.blueprintContainer = blueprintContainer;
}
 
Example 17
Source Project: cxf   Source File: JAXRSBPNamespaceHandler.java    License: Apache License 2.0 4 votes vote down vote up
public BlueprintContainer getBlueprintContainer() {
    return blueprintContainer;
}
 
Example 18
Source Project: cxf   Source File: JAXRSBPNamespaceHandler.java    License: Apache License 2.0 4 votes vote down vote up
public void setBlueprintContainer(BlueprintContainer blueprintContainer) {
    this.blueprintContainer = blueprintContainer;
}
 
Example 19
Source Project: cxf   Source File: BlueprintResourceFactory.java    License: Apache License 2.0 4 votes vote down vote up
public void setBlueprintContainer(BlueprintContainer blueprintContainer) {
    this.blueprintContainer = blueprintContainer;
    init();
}
 
Example 20
Source Project: cxf   Source File: JAXRSBPNamespaceHandler.java    License: Apache License 2.0 4 votes vote down vote up
public BlueprintContainer getBlueprintContainer() {
    return blueprintContainer;
}
 
Example 21
Source Project: cxf   Source File: JAXRSBPNamespaceHandler.java    License: Apache License 2.0 4 votes vote down vote up
public void setBlueprintContainer(BlueprintContainer blueprintContainer) {
    this.blueprintContainer = blueprintContainer;
}
 
Example 22
Source Project: cxf   Source File: ConfigurerImpl.java    License: Apache License 2.0 4 votes vote down vote up
public ConfigurerImpl(BlueprintContainer con) {
    container = con;
    initializeWildcardMap();
}
 
Example 23
Source Project: cxf   Source File: BlueprintBus.java    License: Apache License 2.0 4 votes vote down vote up
public void setBlueprintContainer(BlueprintContainer con) {
    container = con;
    setExtension(new ConfigurerImpl(con), Configurer.class);
    setExtension(new BlueprintBeanLocator(getExtension(ConfiguredBeanLocator.class), container, context),
                       ConfiguredBeanLocator.class);
}
 
Example 24
public MyProcessApplication(BundleContext ctx, BlueprintContainer blueprintContainer) {
  super(ctx.getBundle(), blueprintContainer);
}
 
Example 25
public OSGiProcessApplication(Bundle bundle, BlueprintContainer blueprintContainer) {
  this.bundle = bundle;
  this.blueprintContainer = blueprintContainer;
  bundleDelegatingCL = new BundleDelegatingClassLoader(bundle);
}
 
Example 26
public void setBlueprintContainer(BlueprintContainer blueprintContainer) {
  this.blueprintContainer = blueprintContainer;
}
 
Example 27
public BlueprintContainer getBlueprintContainer(){
  return blueprintContainer;
}
 
Example 28
private BlueprintContainer createBlueprintContainerMock() {
  return mock(BlueprintContainer.class);
}