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

The following examples show how to use org.osgi.service.blueprint.container.BlueprintContainer. 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 File: BGPClusterSingletonService.java    From bgpcep with 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 File: BgpDeployerImpl.java    From bgpcep with 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 File: BlueprintBeanLocator.java    From cxf with 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 File: OSGiProcessApplicationTest.java    From camunda-bpm-platform-osgi with Apache License 2.0 5 votes vote down vote up
@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 #5
Source File: PCEPTopologyDeployerImpl.java    From bgpcep with 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 #6
Source File: BlueprintBeanLocator.java    From cxf with 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
Source File: CXFBlueprintServlet.java    From cxf with 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 #8
Source File: BlueprintResourceFactory.java    From cxf with Apache License 2.0 4 votes vote down vote up
public void setBlueprintContainer(BlueprintContainer blueprintContainer) {
    this.blueprintContainer = blueprintContainer;
    init();
}
 
Example #9
Source File: OSGiProcessApplicationTest.java    From camunda-bpm-platform-osgi with Apache License 2.0 4 votes vote down vote up
private BlueprintContainer createBlueprintContainerMock() {
  return mock(BlueprintContainer.class);
}
 
Example #10
Source File: BlueprintBundleLocalELResolver.java    From camunda-bpm-platform-osgi with Apache License 2.0 4 votes vote down vote up
public BlueprintContainer getBlueprintContainer(){
  return blueprintContainer;
}
 
Example #11
Source File: BlueprintBundleLocalELResolver.java    From camunda-bpm-platform-osgi with Apache License 2.0 4 votes vote down vote up
public void setBlueprintContainer(BlueprintContainer blueprintContainer) {
  this.blueprintContainer = blueprintContainer;
}
 
Example #12
Source File: OSGiProcessApplication.java    From camunda-bpm-platform-osgi with Apache License 2.0 4 votes vote down vote up
public OSGiProcessApplication(Bundle bundle, BlueprintContainer blueprintContainer) {
  this.bundle = bundle;
  this.blueprintContainer = blueprintContainer;
  bundleDelegatingCL = new BundleDelegatingClassLoader(bundle);
}
 
Example #13
Source File: MyProcessApplication.java    From camunda-bpm-platform-osgi with Apache License 2.0 4 votes vote down vote up
public MyProcessApplication(BundleContext ctx, BlueprintContainer blueprintContainer) {
  super(ctx.getBundle(), blueprintContainer);
}
 
Example #14
Source File: BlueprintBus.java    From cxf with 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 #15
Source File: ConfigurerImpl.java    From cxf with Apache License 2.0 4 votes vote down vote up
public ConfigurerImpl(BlueprintContainer con) {
    container = con;
    initializeWildcardMap();
}
 
Example #16
Source File: JAXRSBPNamespaceHandler.java    From cxf with Apache License 2.0 4 votes vote down vote up
public void setBlueprintContainer(BlueprintContainer blueprintContainer) {
    this.blueprintContainer = blueprintContainer;
}
 
Example #17
Source File: JAXRSBPNamespaceHandler.java    From cxf with Apache License 2.0 4 votes vote down vote up
public BlueprintContainer getBlueprintContainer() {
    return blueprintContainer;
}
 
Example #18
Source File: BlueprintContextELResolver.java    From activiti6-boot2 with Apache License 2.0 4 votes vote down vote up
public BlueprintContextELResolver(BlueprintContainer blueprintContainer) {
  this.blueprintContainer = blueprintContainer;
}
 
Example #19
Source File: JAXRSBPNamespaceHandler.java    From cxf with Apache License 2.0 4 votes vote down vote up
public void setBlueprintContainer(BlueprintContainer blueprintContainer) {
    this.blueprintContainer = blueprintContainer;
}
 
Example #20
Source File: JAXRSBPNamespaceHandler.java    From cxf with Apache License 2.0 4 votes vote down vote up
public BlueprintContainer getBlueprintContainer() {
    return blueprintContainer;
}
 
Example #21
Source File: SimpleBPNamespaceHandler.java    From cxf with Apache License 2.0 4 votes vote down vote up
public void setBlueprintContainer(BlueprintContainer blueprintContainer) {
    this.blueprintContainer = blueprintContainer;
}
 
Example #22
Source File: SimpleBPNamespaceHandler.java    From cxf with Apache License 2.0 4 votes vote down vote up
public BlueprintContainer getBlueprintContainer() {
    return blueprintContainer;
}
 
Example #23
Source File: JAXWSBPNamespaceHandler.java    From cxf with Apache License 2.0 4 votes vote down vote up
public void setBlueprintContainer(BlueprintContainer blueprintContainer) {
    this.blueprintContainer = blueprintContainer;
}
 
Example #24
Source File: JAXWSBPNamespaceHandler.java    From cxf with Apache License 2.0 4 votes vote down vote up
public BlueprintContainer getBlueprintContainer() {
    return blueprintContainer;
}
 
Example #25
Source File: OSGiJaxwsEndpointManager.java    From cxf with Apache License 2.0 4 votes vote down vote up
public void setBlueprintContainer(BlueprintContainer c) {
    this.container = c;
}
 
Example #26
Source File: BlueprintContextELResolver.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
public void setBlueprintContainer(BlueprintContainer blueprintContainer) {
    this.blueprintContainer = blueprintContainer;
}
 
Example #27
Source File: BlueprintContextELResolver.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
public BlueprintContextELResolver(BlueprintContainer blueprintContainer) {
    this.blueprintContainer = blueprintContainer;
}
 
Example #28
Source File: BlueprintContextELResolver.java    From activiti6-boot2 with Apache License 2.0 4 votes vote down vote up
public void setBlueprintContainer(BlueprintContainer blueprintContainer) {
  this.blueprintContainer = blueprintContainer;
}