import org.opendaylight.controller.sal.binding.impl.RootBindingAwareBroker;
import org.opendaylight.controller.sal.core.api.BrokerService;
import org.opendaylight.controller.sal.core.spi.data.DOMStore;
-import org.opendaylight.controller.sal.dom.broker.BrokerImpl;
import org.opendaylight.mdsal.binding.dom.codec.gen.impl.DataObjectSerializerGenerator;
import org.opendaylight.mdsal.binding.dom.codec.gen.impl.StreamWriterGenerator;
import org.opendaylight.mdsal.binding.dom.codec.impl.BindingNormalizedNodeCodecRegistry;
private HeliumNotificationProviderServiceAdapter baNotifyImpl;
- private BrokerImpl biBrokerImpl;
-
private final ListeningExecutorService executor;
private final ClassPool classPool;
final ClassToInstanceMap<BrokerService> services = MutableClassToInstanceMap.create();
services.put(DOMRpcService.class, this.domRouter);
-
- this.biBrokerImpl = new BrokerImpl(this.domRouter,services);
-
}
public void startBindingNotificationBroker() {
+++ /dev/null
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.core.api;
-
-import java.util.Collection;
-import java.util.Collections;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.util.tracker.ServiceTracker;
-import org.osgi.util.tracker.ServiceTrackerCustomizer;
-
-/**
- * Deprecated.
- *
- * @deprecated Use blueprint instead for code wiring.
- */
-@Deprecated
-public abstract class AbstractConsumer implements Consumer, BundleActivator,ServiceTrackerCustomizer<Broker, Broker> {
-
- private BundleContext context;
- private ServiceTracker<Broker, Broker> tracker;
- private Broker broker;
-
- @Override
- public final void start(final BundleContext bundleContext) throws Exception {
- this.context = bundleContext;
- this.startImpl(bundleContext);
- tracker = new ServiceTracker<>(bundleContext, Broker.class, this);
- tracker.open();
- }
-
- @Override
- public final void stop(final BundleContext bundleContext) throws Exception {
- stopImpl(bundleContext);
- broker = null;
-
- if (tracker != null) {
- tracker.close();
- }
- }
-
- protected void startImpl(final BundleContext bundleContext) {
- // NOOP
- }
-
- protected void stopImpl(final BundleContext bundleContext) {
- // NOOP
- }
-
- @Override
- public Collection<ConsumerFunctionality> getConsumerFunctionality() {
- return Collections.emptySet();
- }
-
-
- @Override
- public Broker addingService(final ServiceReference<Broker> reference) {
- if (broker == null && context != null) {
- broker = context.getService(reference);
- broker.registerConsumer(this, context);
- return broker;
- }
-
- return null;
- }
-
- @Override
- public void modifiedService(final ServiceReference<Broker> reference, final Broker service) {
- // NOOP
- }
-
- @Override
- public void removedService(final ServiceReference<Broker> reference, final Broker service) {
- stopImpl(context);
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.core.api;
-
-import java.util.Collection;
-import java.util.Collections;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.util.tracker.ServiceTracker;
-import org.osgi.util.tracker.ServiceTrackerCustomizer;
-
-/**
- * Deprecated.
- *
- * @deprecated Use blueprint instead for code wiring.
- */
-@Deprecated
-public abstract class AbstractProvider implements BundleActivator, Provider,ServiceTrackerCustomizer<Broker, Broker> {
-
- private Broker broker;
- private BundleContext context;
- private ServiceTracker<Broker, Broker> tracker;
-
- @Override
- public Collection<ProviderFunctionality> getProviderFunctionality() {
- return Collections.emptySet();
- }
-
- @Override
- public final void start(final BundleContext bundleContext) throws Exception {
- this.context = bundleContext;
- this.startImpl(bundleContext);
- tracker = new ServiceTracker<>(bundleContext, Broker.class, this);
- tracker.open();
- }
-
- protected void startImpl(final BundleContext bundleContext) {
- // NOOP
- }
-
- protected void stopImpl(final BundleContext bundleContext) {
- // NOOP
- }
-
- @Override
- public final void stop(final BundleContext bundleContext) throws Exception {
- broker = null;
-
- if (tracker != null) {
- tracker.close();
- }
-
- tracker = null;
- stopImpl(bundleContext);
- }
-
- @Override
- public Broker addingService(final ServiceReference<Broker> reference) {
- if (broker == null && context != null) {
- broker = context.getService(reference);
- broker.registerProvider(this, context);
- return broker;
- }
-
- return null;
- }
-
- @Override
- public void modifiedService(final ServiceReference<Broker> reference, final Broker service) {
- // NOOP
- }
-
- @Override
- public void removedService(final ServiceReference<Broker> reference, final Broker service) {
- stopImpl(context);
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.core.api;
-
-import org.osgi.framework.BundleContext;
-
-/**
- * Core component of the SAL layer responsible for wiring the SAL consumers.
- *
- * <p>
- * The responsibility of the broker is to maintain registration of SAL
- * functionality {@link Consumer}s and {@link Provider}s, store provider and
- * consumer specific context and functionality registration via
- * {@link ConsumerSession} and provide access to infrastructure services, which
- * removes direct dependencies between providers and consumers.
- *
- * <p>
- * The services are exposed via session.
- *
- * <h3>Session-based access</h3>
- *
- * <p>
- * The providers and consumers needs to register in order to use the
- * binding-independent SAL layer and to expose functionality via SAL layer.
- *
- * <p>
- * For more information about session-based access see {@link ConsumerSession}
- * and {@link ProviderSession}
- *
- * @deprecated Use blueprint instead for code wiring.
- */
-@Deprecated
-public interface Broker {
-
- /**
- * Registers the {@link Consumer}, which will use the SAL layer.
- *
- * <p>
- * During the registration, the broker obtains the initial functionality
- * from consumer, using the {@link Consumer#getConsumerFunctionality()}, and
- * register that functionality into system and concrete infrastructure
- * services.
- *
- * <p>
- * Note that consumer could register additional functionality at later point
- * by using service and functionality specific APIs.
- *
- * <p>
- * The consumer is required to use returned session for all communication
- * with broker or one of the broker services. The session is announced to
- * the consumer by invoking
- * {@link Consumer#onSessionInitiated(ConsumerSession)}.
- *
- * @param cons
- * Consumer to be registered.
- * @return a session specific to consumer registration
- * @throws IllegalArgumentException
- * If the consumer is <code>null</code>.
- * @throws IllegalStateException
- * If the consumer is already registered.
- */
- ConsumerSession registerConsumer(Consumer cons);
-
- /*
- * @deprecated Use registerConsumer(Consumer cons) instead (BundleContext is no longer used)
- */
- @Deprecated
- ConsumerSession registerConsumer(Consumer cons, BundleContext context);
-
- /**
- * Registers the {@link Provider}, which will use the SAL layer.
- *
- * <p>
- * During the registration, the broker obtains the initial functionality
- * from consumer, using the {@link Provider#getProviderFunctionality()}, and
- * register that functionality into system and concrete infrastructure
- * services.
- *
- * <p>
- * The consumer is <b>required to use</b> returned session for all
- * communication with broker or one of the broker services. The session is
- * announced to the consumer by invoking
- * {@link Provider#onSessionInitiated(ProviderSession)}.
- *
- *
- * @param prov
- * Provider to be registered.
- * @return a session unique to the provider registration.
- * @throws IllegalArgumentException
- * If the provider is <code>null</code>.
- * @throws IllegalStateException
- * If the consumer is already registered.
- */
- ProviderSession registerProvider(Provider prov);
-
- /*
- * @deprecated Use registerProvider(Provider cons) instead (BundleContext is no longer used)
- */
- @Deprecated
- ProviderSession registerProvider(Provider prov, BundleContext context);
-
- /**
- * {@link Consumer} specific access to the SAL functionality.
- *
- * <p>
- * ConsumerSession is {@link Consumer}-specific access to the SAL
- * functionality and infrastructure services.
- *
- * <p>
- * The session serves to store SAL context (e.g. registration of
- * functionality) for the consumer and provides access to the SAL
- * infrastructure services and other functionality provided by
- * {@link Provider}s.
- *
- *
- *
- */
- interface ConsumerSession {
-
- boolean isClosed();
-
- /**
- * Returns a session specific instance (implementation) of requested service.
- *
- * @param service
- * Broker service
- * @return Session specific implementation of service
- */
- <T extends BrokerService> T getService(Class<T> service);
-
- /**
- * Closes a session between consumer and broker.
- *
- * <p>
- * The close operation unregisters a consumer and remove all registered
- * functionality of the consumer from the system.
- *
- */
- void close();
- }
-
- /**
- * {@link Provider} specific access to the SAL functionality.
- *
- * <p>
- * ProviderSession is {@link Provider}-specific access to the SAL
- * functionality and infrastructure services, which also allows for exposing
- * the provider's functionality to the other {@link Consumer}s.
- *
- * <p>
- * The session serves to store SAL context (e.g. registration of
- * functionality) for the providers and exposes access to the SAL
- * infrastructure services, dynamic functionality registration and any other
- * functionality provided by other {@link Provider}s.
- *
- */
- interface ProviderSession extends ConsumerSession {
- /**
- * Closes a session between provider and SAL.
- *
- * <p>
- * The close operation unregisters a provider and remove all registered
- * functionality of the provider from the system.
- */
- @Override
- void close();
-
- @Override
- boolean isClosed();
- }
-}
package org.opendaylight.controller.sal.core.api;
/**
- * Session-specific instance of the broker functionality.
- *
- * <p>
- * BrokerService is marker interface for infrastructure services provided by the
- * SAL. These services are session-specific, each {@link Provider} and
- * {@link Consumer} usually has own instance of the service with it's own
- * context.
- *
- * <p>
- * The consumer's (or provider's) instance of specific service could be obtained
- * by invoking {@link org.opendaylight.controller.sal.core.api.Broker.ConsumerSession#getService(Class)}
- * method on session assigned to the consumer.
- *
- * <p>
- * {@link BrokerService} and {@link Provider} may seem similar, but provider
- * provides YANG model-based functionality and {@link BrokerService} exposes the
- * necessary supporting functionality to implement specific functionality of
- * YANG and to reuse it in the development of {@link Consumer}s and
- * {@link Provider}s.
+ * Session-specific instance of the broker functionality. BrokerService is marker interface for infrastructure services
+ * provided by the SAL.
*
* @deprecated Use blueprint instead for code wiring.
*/
+++ /dev/null
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.core.api;
-
-import java.util.Collection;
-import org.opendaylight.controller.sal.core.api.Broker.ConsumerSession;
-
-/**
- * Defines the component of controller and supplies additional metadata. A
- * component of the controller or application supplies a concrete implementation
- * of this interface.
- *
- * <p>
- * A user-implemented component (application) which facilitates the SAL and SAL
- * services to access infrastructure services or providers' functionality.
- *
- * @deprecated Use blueprint instead for code wiring.
- */
-@Deprecated
-public interface Consumer {
-
- /**
- * Callback signaling initialization of the consumer session to the SAL.
- *
- * <p>
- * The consumer MUST use the session for all communication with SAL or
- * retrieving SAL infrastructure services.
- *
- * <p>
- * This method is invoked by {@link Broker#registerConsumer(Consumer)}
- *
- * @param session
- * Unique session between consumer and SAL.
- */
- void onSessionInitiated(ConsumerSession session);
-
- /**
- * Deprecated.
- *
- * @deprecated - no longer used or needed. Suggested implementation until removed:
- * {@code
- * public Collection<ConsumerFunctionality> getConsumerFunctionality() {
- * return Collections.emptySet();
- * }
- * }
- */
- @Deprecated
- Collection<ConsumerFunctionality> getConsumerFunctionality();
-
- /**
- * Deprecated.
- *
- * @deprecated - no longer used or needed
- */
- @Deprecated
- interface ConsumerFunctionality {
-
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.core.api;
-
-import java.util.Collection;
-import org.opendaylight.controller.sal.core.api.Broker.ProviderSession;
-
-/**
- * Defines the component of controller and supplies additional metadata. A
- * component of the controller or application supplies a concrete implementation
- * of this interface.
- *
- * <p>
- * A user-implemented component (application) which facilitates the SAL and SAL
- * services to access infrastructure services and to provide functionality to
- * {@link Consumer}s and other providers.
- *
- * @deprecated Use blueprint instead for code wiring.
- */
-@Deprecated
-public interface Provider {
-
- /**
- * Callback signaling initialization of the provider session to the SAL.
- *
- * <p>
- * The provider <b>MUST use the session</b> for all communication with SAL
- * or retrieving SAL infrastructure services.
- *
- * <p>
- * This method is invoked by {@link Broker#registerConsumer(Consumer)}
- *
- * @param session
- * Unique session between provider and SAL.
- */
- void onSessionInitiated(ProviderSession session);
-
- /**
- * Deprecated.
- *
- * @deprecated - No longer used or needed. Suggested implementation until removed:
- * {@code
- * public Collection<ProviderFunctionality> getProviderFunctionality() {
- * return Collections.emptySet();
- * }
- * }
- */
- @Deprecated
- Collection<ProviderFunctionality> getProviderFunctionality();
-
- /**
- * Deprecated.
- *
- * @deprecated - no longer used or needed
- */
- @Deprecated
- interface ProviderFunctionality {
-
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.dom.broker;
-
-import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ClassToInstanceMap;
-import com.google.common.collect.ImmutableClassToInstanceMap;
-import com.google.common.util.concurrent.CheckedFuture;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-import org.opendaylight.controller.md.sal.dom.api.DOMRpcAvailabilityListener;
-import org.opendaylight.controller.md.sal.dom.api.DOMRpcException;
-import org.opendaylight.controller.md.sal.dom.api.DOMRpcIdentifier;
-import org.opendaylight.controller.md.sal.dom.api.DOMRpcImplementation;
-import org.opendaylight.controller.md.sal.dom.api.DOMRpcImplementationRegistration;
-import org.opendaylight.controller.md.sal.dom.api.DOMRpcProviderService;
-import org.opendaylight.controller.md.sal.dom.api.DOMRpcResult;
-import org.opendaylight.controller.md.sal.dom.api.DOMRpcService;
-import org.opendaylight.controller.md.sal.dom.broker.impl.DOMRpcRouter;
-import org.opendaylight.controller.sal.core.api.Broker;
-import org.opendaylight.controller.sal.core.api.BrokerService;
-import org.opendaylight.controller.sal.core.api.Consumer;
-import org.opendaylight.controller.sal.core.api.Provider;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
-import org.opendaylight.yangtools.yang.model.api.SchemaPath;
-import org.osgi.framework.BundleContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@Deprecated
-public class BrokerImpl implements Broker, DOMRpcProviderService, DOMRpcService, AutoCloseable {
- private static final Logger LOG = LoggerFactory.getLogger(BrokerImpl.class);
-
- // Broker Generic Context
- private final Set<ConsumerContextImpl> sessions = Collections
- .synchronizedSet(new HashSet<ConsumerContextImpl>());
- private final Set<ProviderContextImpl> providerSessions = Collections
- .synchronizedSet(new HashSet<ProviderContextImpl>());
-
- private AutoCloseable deactivator;
-
- private final DOMRpcService rpcService;
- private final DOMRpcProviderService rpcProvider;
-
- private final ClassToInstanceMap<BrokerService> services;
-
- public BrokerImpl(final DOMRpcRouter router,final ClassToInstanceMap<BrokerService> services) {
- this(router, router, services);
- }
-
- public BrokerImpl(final DOMRpcService rpcService, final DOMRpcProviderService rpcProvider,
- final ClassToInstanceMap<BrokerService> services) {
- this.rpcService = Preconditions.checkNotNull(rpcService, "DOMRpcService must not be null");
- this.rpcProvider = Preconditions.checkNotNull(rpcProvider, "DOMRpcProviderService must not be null");
- this.services = ImmutableClassToInstanceMap.copyOf(services);
- }
-
- @Override
- public ConsumerSession registerConsumer(final Consumer consumer,
- final BundleContext ctx) {
- return registerConsumer(consumer);
- }
-
- @Override
- public ConsumerSession registerConsumer(final Consumer consumer) {
- checkPredicates(consumer);
- LOG.trace("Registering consumer {}", consumer);
- final ConsumerContextImpl session = newSessionFor(consumer);
- consumer.onSessionInitiated(session);
- sessions.add(session);
- return session;
- }
-
- @Override
- public ProviderSession registerProvider(final Provider provider,
- final BundleContext ctx) {
- return registerProvider(provider);
- }
-
- @Override
- public ProviderSession registerProvider(final Provider provider) {
- checkPredicates(provider);
- final ProviderContextImpl session = newSessionFor(provider);
- provider.onSessionInitiated(session);
- providerSessions.add(session);
- return session;
- }
-
- // Validation
- private void checkPredicates(final Provider prov) {
- Preconditions.checkNotNull(prov, "Provider should not be null.");
- synchronized (providerSessions) {
- for (final ProviderContextImpl session : providerSessions) {
- if (prov.equals(session.getProvider())) {
- throw new IllegalStateException("Provider already registered");
- }
- }
- }
-
- }
-
- private void checkPredicates(final Consumer cons) {
- Preconditions.checkNotNull(cons, "Consumer should not be null.");
- synchronized (sessions) {
- for (final ConsumerContextImpl session : sessions) {
- if (cons.equals(session.getConsumer())) {
- throw new IllegalStateException("Consumer already registered");
- }
- }
- }
- }
-
- // Private Factory methods
- private ConsumerContextImpl newSessionFor(final Consumer provider) {
- final ConsumerContextImpl ret = new ConsumerContextImpl(provider, this);
- return ret;
- }
-
- private ProviderContextImpl newSessionFor(final Provider provider) {
- final ProviderContextImpl ret = new ProviderContextImpl(provider, this);
- return ret;
- }
-
- protected void consumerSessionClosed(
- final ConsumerContextImpl consumerContextImpl) {
- sessions.remove(consumerContextImpl);
- providerSessions.remove(consumerContextImpl);
- }
-
- @Override
- public void close() throws Exception {
- if (deactivator != null) {
- deactivator.close();
- deactivator = null;
- }
- }
-
- /**
- * Gets deactivator.
- *
- * @return the deactivator
- */
- public AutoCloseable getDeactivator() {
- return deactivator;
- }
-
- /**
- * Sets deactivator.
- *
- * @param deactivator
- * the deactivator to set
- */
- public void setDeactivator(final AutoCloseable deactivator) {
- this.deactivator = deactivator;
- }
-
- protected <T extends BrokerService> Optional<T> getGlobalService(final Class<T> service) {
- return Optional.fromNullable(services.getInstance(service));
- }
-
- @Nonnull
- @Override
- public <T extends DOMRpcImplementation> DOMRpcImplementationRegistration<T> registerRpcImplementation(
- @Nonnull final T implementation, @Nonnull final DOMRpcIdentifier... rpcs) {
- return rpcProvider.registerRpcImplementation(implementation, rpcs);
- }
-
- @Nonnull
- @Override
- public <T extends DOMRpcImplementation> DOMRpcImplementationRegistration<T> registerRpcImplementation(
- @Nonnull final T implementation, @Nonnull final Set<DOMRpcIdentifier> rpcs) {
- return rpcProvider.registerRpcImplementation(implementation, rpcs);
- }
-
- @Nonnull
- @Override
- public CheckedFuture<DOMRpcResult, DOMRpcException> invokeRpc(@Nonnull final SchemaPath type,
- @Nullable final NormalizedNode<?, ?> input) {
- return rpcService.invokeRpc(type, input);
- }
-
- @Nonnull
- @Override
- public <T extends DOMRpcAvailabilityListener> ListenerRegistration<T> registerRpcListener(
- @Nonnull final T listener) {
- return rpcService.registerRpcListener(listener);
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.dom.broker;
-
-import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ClassToInstanceMap;
-import com.google.common.collect.MutableClassToInstanceMap;
-import java.util.Collection;
-import java.util.concurrent.atomic.AtomicBoolean;
-import org.opendaylight.controller.sal.core.api.Broker.ConsumerSession;
-import org.opendaylight.controller.sal.core.api.BrokerService;
-import org.opendaylight.controller.sal.core.api.Consumer;
-import org.opendaylight.controller.sal.dom.broker.osgi.AbstractBrokerServiceProxy;
-import org.opendaylight.controller.sal.dom.broker.osgi.ProxyFactory;
-
-@Deprecated
-class ConsumerContextImpl implements ConsumerSession {
-
- private final ClassToInstanceMap<BrokerService> instantiatedServices = MutableClassToInstanceMap.create();
- private final Consumer consumer;
-
- private final BrokerImpl broker;
- private final AtomicBoolean closed = new AtomicBoolean(false);
-
- ConsumerContextImpl(final Consumer provider, final BrokerImpl brokerImpl) {
- broker = brokerImpl;
- consumer = provider;
- }
-
- @Override
- public <T extends BrokerService> T getService(final Class<T> service) {
- checkNotClosed();
- final T localProxy = instantiatedServices.getInstance(service);
- if (localProxy != null) {
- return localProxy;
- }
- final Optional<T> serviceImpl = broker.getGlobalService(service);
- if (serviceImpl.isPresent()) {
- final T ret = ProxyFactory.createProxy(null, serviceImpl.get());
- instantiatedServices.putInstance(service, ret);
- return ret;
- } else {
- return null;
- }
- }
-
- @Override
- public void close() {
- if (closed.compareAndSet(false, true)) {
- Collection<BrokerService> toStop = instantiatedServices.values();
- for (BrokerService brokerService : toStop) {
- if (brokerService instanceof AbstractBrokerServiceProxy<?>) {
- ((AbstractBrokerServiceProxy<?>) brokerService).close();
- }
- }
- broker.consumerSessionClosed(this);
- }
- }
-
-
- @Override
- public boolean isClosed() {
- return closed.get();
- }
-
- /**
- * Gets broker.
- *
- * @return the broker
- */
- protected final BrokerImpl getBrokerChecked() {
- checkNotClosed();
- return broker;
- }
-
- /**
- * Gets consumer.
- *
- * @return the _consumer
- */
- public Consumer getConsumer() {
- return consumer;
- }
-
- protected final void checkNotClosed() {
- Preconditions.checkState(!closed.get(), "Session is closed.");
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.dom.broker;
-
-import org.opendaylight.controller.sal.core.api.Broker.ProviderSession;
-import org.opendaylight.controller.sal.core.api.Provider;
-
-@Deprecated
-class ProviderContextImpl extends ConsumerContextImpl implements ProviderSession {
- private final Provider provider;
-
- ProviderContextImpl(final Provider provider, final BrokerImpl broker) {
- super(null, broker);
- this.provider = provider;
- }
-
- @Override
- public void close() {
- }
-
- public Provider getProvider() {
- return provider;
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.dom.broker;
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.core.spi;
-
-import java.util.Set;
-import org.opendaylight.controller.sal.core.api.Broker.ConsumerSession;
-import org.opendaylight.controller.sal.core.api.BrokerService;
-import org.opendaylight.controller.sal.core.api.Consumer.ConsumerFunctionality;
-import org.opendaylight.controller.sal.core.api.Provider.ProviderFunctionality;
-
-/**
- * Deprecated.
- *
- * @deprecated Use blueprint instead for code wiring.
- */
-@Deprecated
-public interface BrokerModule {
-
- Set<Class<? extends BrokerService>> getProvidedServices();
-
- Set<Class<? extends ConsumerFunctionality>> getSupportedConsumerFunctionality();
-
- <T extends BrokerService> T getServiceForSession(Class<T> service,
- ConsumerSession session);
-
- Set<Class<? extends ProviderFunctionality>> getSupportedProviderFunctionality();
-}
+++ /dev/null
-/*
- * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.core.spi;
-
-import org.opendaylight.controller.sal.core.api.Broker.ConsumerSession;
-import org.opendaylight.controller.sal.core.api.BrokerService;
-
-/**
- * Deprecated.
- *
- * @deprecated Use blueprint instead for code wiring.
- */
-@Deprecated
-public abstract class ForwardingConsumerSession implements ConsumerSession {
-
- protected abstract ConsumerSession delegate();
-
- @Override
- public void close() {
- delegate().close();
- }
-
- @Override
- public <T extends BrokerService> T getService(Class<T> arg0) {
- return delegate().getService(arg0);
- }
-
- @Override
- public boolean isClosed() {
- return delegate().isClosed();
- }
-
-}
+++ /dev/null
-/*
- * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.controller.sal.core.spi;
-
-import org.opendaylight.controller.sal.core.api.Broker.ProviderSession;
-import org.opendaylight.controller.sal.core.api.BrokerService;
-
-/**
- * Deprecated.
- *
- * @deprecated Use blueprint instead for code wiring.
- */
-@Deprecated
-public abstract class ForwardingProviderSession implements ProviderSession {
-
- protected abstract ProviderSession delegate();
-
- @Override
- public void close() {
- delegate().close();
- }
-
- @Override
- public <T extends BrokerService> T getService(Class<T> arg0) {
- return delegate().getService(arg0);
- }
-
- @Override
- public boolean isClosed() {
- return delegate().isClosed();
- }
-
-}
+++ /dev/null
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.core.spi;
\ No newline at end of file