Package org.openengsb.core.api

Examples of org.openengsb.core.api.Domain


            for (ServiceReference<Domain> ref : serviceReferences) {
                ServiceEntry entry = new ServiceEntry();
                for (String key : ref.getPropertyKeys()) {
                    entry.properties.put(key, ref.getProperty(key));
                }
                Domain service = bundleContext.getService(ref);
                try {
                    entry.aliveState = service.getAliveState();
                } catch (Exception e) {
                    LOGGER.error("Couldn't load service entry " + ref, e);
                    entry.aliveState = AliveState.OFFLINE;
                }
                result.add(entry);
View Full Code Here


                        List<String> tmp = new ArrayList<String>();

                        List<ServiceReference<Domain>> listServiceReferences =
                            osgiUtilsService.listServiceReferences(Domain.class);
                        for (ServiceReference<Domain> ref : listServiceReferences) {
                            Domain service = bundleContext.getService(ref);
                            tmp.add(OutputStreamFormater.formatValues(
                                ref.getProperty(org.osgi.framework.Constants.SERVICE_PID).toString(), service
                                    .getAliveState().toString()));
                        }
                        return tmp;
                    }
                });
View Full Code Here

        serviceUtils = new DefaultOsgiUtilsService(bundleContext);
        mockedServiceUtils = mock(DefaultOsgiUtilsService.class);
        mockedServiceUtils = mock(DefaultOsgiUtilsService.class);
        testConnector = mock(LinkingSupport.class);
        LinkingSupport testConnector2 = mock(LinkingSupport.class);
        Domain testConnector3 = mock(Domain.class);
        when(mockedServiceUtils.getService("(service.pid=test+test+test)", 100L)).thenReturn(testConnector);
        when(mockedServiceUtils.getService("(service.pid=test2+test2+test2)", 100L)).thenReturn(testConnector2);
        when(mockedServiceUtils.getService("(service.pid=test3+test3+test3)", 100L)).thenReturn(null);
        when(mockedServiceUtils.getService("(service.pid=test4+test4+test4)", 100L)).thenReturn(testConnector3);
        createServiceManager();
View Full Code Here

        registerDummyConnector(DummyTest.class, "test");
    }

    @SuppressWarnings("unchecked")
    protected <T extends Domain> T registerDummyConnector(Class<T> domainClass, String name) throws Exception {
        Domain mock2 = mock(domainClass);
        registerServiceAtLocation(mock2, name, Domain.class, domainClass);
        domains.put(name, mock2);
        return (T) mock2;
    }
View Full Code Here

    @Before
    public void init() {
        osgiServiceMock = mock(DefaultOsgiUtilsService.class);
        final List<DomainProvider> domainProviders = new ArrayList<DomainProvider>();
        final List<Domain> domainEndpoints = new ArrayList<Domain>();
        Domain domainEndpoint = new NullDomainImpl("id");
        domainEndpoints.add(domainEndpoint);
        DomainProvider domainProviderMock = mock(DomainProvider.class);
        when(domainProviderMock.getDomainInterface()).thenAnswer(new Answer<Class<? extends Domain>>() {
            @Override
            public Class<? extends Domain> answer(InvocationOnMock invocationOnMock) throws Throwable {
View Full Code Here

        return result;
    }

    @Override
    public boolean isConnectorCurrentlyPresent(Class<? extends Domain> domainType) {
        Domain service;
        try {
            service = getServiceUtils().getService(domainType, DEFAULT_TIMEOUT);
        } catch (OsgiServiceNotAvailableException e) {
            return false;
        }
View Full Code Here

TOP

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

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.