Package org.openengsb.core.api

Examples of org.openengsb.core.api.DomainProvider


    }

    private Object registerDomainProvider(Bundle bundle, String name) {
        Class<? extends Domain> domainInterface = loadDomainInterfaceFromBundle(bundle);
        Class<? extends DomainEvents> domainEventsInterface = loadDomainEventsInterfaceFromBundle(bundle);
        DomainProvider provider =
            new DefaultDomainProvider(name, bundle, domainInterface, domainEventsInterface);
        Dictionary<String, Object> props = new Hashtable<String, Object>();
        props.put("domain", name);
        LOGGER.debug("registering DomainProvider for Bundle {} with properties {}", bundle, props);
        return bundle.getBundleContext().registerService(DomainProvider.class, provider, props);
View Full Code Here


    }

    private DomainProvider getDomainProvider(String domain) {
        Filter domainFilter =
            FilterUtils.makeFilter(DomainProvider.class, String.format("(%s=%s)", Constants.DOMAIN_KEY, domain));
        DomainProvider domainProvider = serviceUtils.getOsgiServiceProxy(domainFilter, DomainProvider.class);
        return domainProvider;
    }
View Full Code Here

        OnetimePasswordAuthenticator authenticator2 = new OnetimePasswordAuthenticator();
        authenticator2.setUserManager(userManager);
        registerServiceAtLocation(authenticator2, "authenticator/onetime", AuthenticationDomain.class);
        onetimeAuthenticator = authenticator2;

        DomainProvider provider = createDomainProviderMock(AuthenticationDomain.class, "authentication");
        CompositeConnectorProvider compositeConnectorProvider = new CompositeConnectorProvider();
        compositeConnectorProvider.setBundleContext(bundleContext);
        ConnectorInstanceFactory factory = compositeConnectorProvider.createFactory(provider);
        authManager = (AuthenticationDomain) factory.createNewInstance("authProvider");
View Full Code Here

        ServiceTracker<DomainProvider, Object> tracker =
            new ServiceTracker<>(getBundleContext(), FrameworkUtil.createFilter(filter), null);

        tracker.open();

        DomainProvider service = (DomainProvider) tracker.waitForService(10000);
        assertThat(service, not(nullValue()));
        assertThat(service.getId(), is("example"));
        assertThat(service.getDomainInterface().getName(), is("org.openengsb.domain.example.ExampleDomain"));
        assertThat(service.getDomainEventInterface().getName(), is("org.openengsb.domain.example.ExampleDomainEvents"));
    }
View Full Code Here

                new ConnectorDescription("a", "a", new HashMap<String, String>(), new HashMap<String, Object>()));
    }

    @Test(expected = IllegalStateException.class)
    public void testNoDomainProviderAvailableForType_shouldThrowIllegalArgumentException() throws Exception {
        DomainProvider domainProviderMock = mock(DomainProvider.class);
        when(domainProviderMock.getDomainInterface()).thenAnswer(new Answer<Class<? extends Domain>>() {
            @Override
            public Class<? extends Domain> answer(InvocationOnMock invocation) throws Throwable {
                return NullDomainImpl.class;
            }
        });
View Full Code Here

        HashMap<String, String> attributes = new HashMap<String, String>();
        attributes.put("compositeStrategy", "accessControlStrategy");
        attributes.put("queryString", "(location.foo=authorization/*)");

        DomainProvider provider = createDomainProviderMock(AuthorizationDomain.class, "accessControl");
        CompositeConnectorProvider compositeConnectorProvider = new CompositeConnectorProvider();
        compositeConnectorProvider.setBundleContext(bundleContext);
        ConnectorInstanceFactory factory = compositeConnectorProvider.createFactory(provider);
        accessControl = (AuthorizationDomain) factory.createNewInstance("authProvider");

View Full Code Here

        HashMap<String, String> attributes = new HashMap<String, String>();
        attributes.put("compositeStrategy", "accessControlStrategy");
        attributes.put("queryString", "(location.foo=authorization/*)");

        DomainProvider provider = createDomainProviderMock(AuthorizationDomain.class, "accessControl");
        CompositeConnectorProvider compositeConnectorProvider = new CompositeConnectorProvider();
        compositeConnectorProvider.setBundleContext(bundleContext);
        ConnectorInstanceFactory factory = compositeConnectorProvider.createFactory(provider);
        accessControl = (AuthorizationDomain) factory.createNewInstance("authProvider");

View Full Code Here

TOP

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

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.