/** * {@link ContextManager#getContext()} */ protected Context getContext() { synchronized (contextBrokerLock) { if (contextBroker != null) return contextBroker.getContext(); throw new NotAccessibleContextException("contextManager is null"); } }
/** * {@link ContextManager#getServiceEntity()} */ public BundleEntity getBundleEntity() { synchronized (contextBrokerLock) { if (contextBroker != null) return contextBroker.getBundleEntity(); throw new NotAccessibleContextException("contextManager is null"); } }
@Override public synchronized <T extends ContextElement> T peek(URI elementId) { if (contextContainer != null) return (T) contextContainer.peek(elementId, id); throw new NotAccessibleContextException("contextContainer is null"); }
@Override public synchronized boolean contains(URI elementId) { if (contextContainer != null) return contextContainer.contains(elementId, id); throw new NotAccessibleContextException("contextContainer is null"); }
@Override public synchronized boolean release(URI elementId) { if (contextContainer != null) { if (decRequests(elementId)) { contextContainer.release(elementId, id); return true; } return false; } throw new NotAccessibleContextException("contextContainer is null"); }
@Override public synchronized void releaseAll(URI elementId) { if (contextContainer != null) { resetRequests(elementId); contextContainer.release(elementId, id); } else throw new NotAccessibleContextException("contextContainer is null"); }
@Override public synchronized <T extends ContextElement> T request(T element) { if (contextContainer != null) { incRequests(element.getId()); return contextContainer.request(element, id); } throw new NotAccessibleContextException("contextContainer is null"); }