Package org.openengsb.core.api

Examples of org.openengsb.core.api.OsgiServiceNotAvailableException


        Class<? extends Domain> aClass;
        aClass = (Class<? extends Domain>) service.getServiceClass();
        if (wiringService.isConnectorCurrentlyPresent(aClass)) {
            return wiringService.getDomainEndpoint(aClass, "domain/" + name + "/default");
        }
        throw new OsgiServiceNotAvailableException("no default service found for service: "
                + service.getServiceClass());
    }
View Full Code Here


    @SuppressWarnings("unchecked")
    public <T> T getService(Class<T> clazz, long timeout) throws OsgiServiceNotAvailableException {
        ServiceTracker tracker = new ServiceTracker(bundleContext, clazz.getName(), null);
        Object result = waitForServiceFromTracker(tracker, timeout);
        if (result == null) {
            throw new OsgiServiceNotAvailableException(String.format("no service of type %s available at the time",
                clazz.getName()));
        }
        return (T) result;
    }
View Full Code Here

    public Object getService(Filter filter, long timeout) throws OsgiServiceNotAvailableException {
        ServiceTracker t = new ServiceTracker(bundleContext, filter, null);
        LOGGER.debug("getting service for filter {} from tracker", filter);
        Object result = waitForServiceFromTracker(t, timeout);
        if (result == null) {
            throw new OsgiServiceNotAvailableException(String.format(
                "no service matching filter \"%s\" available at the time", filter.toString()));
        }
        return result;
    }
View Full Code Here

        synchronized (tracker) {
            tracker.open();
            try {
                return tracker.waitForService(timeout);
            } catch (InterruptedException e) {
                throw new OsgiServiceNotAvailableException(e);
            } finally {
                tracker.close();
            }
        }
    }
View Full Code Here

        @Override
        public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
            Object service = getService();
            if (service == null) {
                throw new OsgiServiceNotAvailableException("could not resolve service with tracker: " + info);
            }
            try {
                return method.invoke(service, args);
            } catch (InvocationTargetException e) {
                throw e.getCause();
View Full Code Here

TOP

Related Classes of org.openengsb.core.api.OsgiServiceNotAvailableException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.