import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
import org.opendaylight.controller.sal.core.IContainer;
import org.opendaylight.controller.sal.utils.ServiceHelper;
-import org.opendaylight.controller.switchmanager.ISwitchManager;
import org.osgi.framework.BundleContext;
import org.osgi.framework.FrameworkUtil;
import org.slf4j.Logger;
private GroupConsumerImpl groupImplRef;
private static DataProviderService dataProviderService;
- private static IClusterContainerServices clusterContainerService = null;
- private static ISwitchManager switchManager;
- private static IContainer container;
-
- @Override
+ private static IClusterContainerServices clusterContainerService = null;
+ private static IContainer container;
+
+ @Override
public void onSessionInitiated(ProviderContext session) {
FRMConsumerImpl.p_session = session;
FRMConsumerImpl.clusterContainerService = clusterContainerService;
}
- public static ISwitchManager getSwitchManager() {
- return switchManager;
- }
-
- public static void setSwitchManager(ISwitchManager switchManager) {
- FRMConsumerImpl.switchManager = switchManager;
- }
-
public static IContainer getContainer() {
return container;
}
BundleContext bundleContext = FrameworkUtil.getBundle(this.getClass()).getBundleContext();
bundleContext.registerService(CommandProvider.class.getName(), this, null);
}
-
- private boolean getDependentModule() {
- do {
- clusterContainerService = (IClusterContainerServices) ServiceHelper.getGlobalInstance(
- IClusterContainerServices.class, this);
- try {
- Thread.sleep(4);
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- } while (clusterContainerService == null);
-
- do {
-
- container = (IContainer) ServiceHelper.getGlobalInstance(IContainer.class, this);
- try {
- Thread.sleep(5);
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- } while (container == null);
-
- do {
- switchManager = (ISwitchManager) ServiceHelper.getInstance(ISwitchManager.class, container.getName(), this);
- try {
- Thread.sleep(5);
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- } while (null == switchManager);
+
+ private boolean getDependentModule() {
+ do {
+ clusterContainerService = (IClusterContainerServices) ServiceHelper.getGlobalInstance(IClusterContainerServices.class, this);
+ try {
+ Thread.sleep(4);
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ } while(clusterContainerService == null);
+
+ do {
+
+
+ container = (IContainer) ServiceHelper.getGlobalInstance(IContainer.class, this);
+ try {
+ Thread.sleep(5);
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ } while (container == null);
+
+
return true;
- }
+ }
+
+
public static DataProviderService getDataProviderService() {
return dataProviderService;
}
public GroupConsumerImpl getGroupImplRef() {
- return groupImplRef;
+ return groupImplRef;
}
+
public static ProviderContext getProviderSession() {
return p_session;