| /* |
| * |
| * Copyright (c) 2011 - 2016 - Loetz GmbH & Co KG, 69115 Heidelberg, Germany |
| * |
| * 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 |
| * |
| * Initial contribution: |
| * Loetz GmbH & Co. KG |
| * |
| */ |
| package org.eclipse.osbp.abstractstatemachine; |
| |
| import org.eclipse.osbp.ui.api.pos.IPOSService; |
| import org.osgi.service.component.annotations.Component; |
| import org.osgi.service.component.annotations.Reference; |
| import org.osgi.service.component.annotations.ReferenceCardinality; |
| import org.osgi.service.component.annotations.ReferencePolicy; |
| import org.slf4j.Logger; |
| import org.slf4j.LoggerFactory; |
| |
| @Component |
| public class POSServiceBinder { |
| /** The Constant LOGGER. */ |
| private static final Logger LOGGER = LoggerFactory.getLogger("servicebinder"); |
| |
| public static IPOSService posService; |
| |
| @Reference(cardinality = ReferenceCardinality.OPTIONAL, policy = ReferencePolicy.DYNAMIC) |
| public void bindPOSService(IPOSService posService) { |
| LOGGER.debug(POSServiceBinder.class.getCanonicalName()+" bound"); |
| POSServiceBinder.posService = posService; |
| } |
| |
| public void unbindPOSService(IPOSService posService) { |
| LOGGER.debug(POSServiceBinder.class.getCanonicalName() + " unbound"); |
| POSServiceBinder.posService = null; |
| } |
| |
| public static IPOSService getPosService() { |
| return posService; |
| } |
| } |