Examples of AssociationDescriptor


Examples of org.rioproject.associations.AssociationDescriptor

        Assert.assertEquals(0, ((Dummy)a.getNextServiceItem().service).getIndex());       
    }

    @Test
    public void testNextAndAdd() {
        Association<Dummy> a = new DefaultAssociation<Dummy>(new AssociationDescriptor());
        for(int i=0; i<10; i++)
            a.addServiceItem(AssociationUtils.makeServiceItem(i));

        Assert.assertEquals("Should have 10 associated services", 10, a.getServiceCount());
        for(int i=0; i<a.getServiceCount(); i++) {
View Full Code Here

Examples of org.rioproject.associations.AssociationDescriptor

        Assert.assertEquals(10, ((Dummy)a.getNextServiceItem().service).getIndex());
    }

    @Test
    public void testNextAndRemove() {
        Association<Dummy> a = new DefaultAssociation<Dummy>(new AssociationDescriptor());
        for(int i=0; i<10; i++)
            a.addServiceItem(AssociationUtils.makeServiceItem(i));

        Assert.assertEquals("Should have 10 associated services", 10, a.getServiceCount());
        for(int i=0; i<a.getServiceCount(); i++) {
View Full Code Here

Examples of org.rioproject.associations.AssociationDescriptor

        Assert.assertEquals(2, ((Dummy)a.getNextServiceItem().service).getIndex());
    }

    @Test
    public void testIterable() {
        Association<Dummy> a = new DefaultAssociation<Dummy>(new AssociationDescriptor());
        for(int i=0; i<10; i++)
            a.addServiceItem(AssociationUtils.makeServiceItem(i));

        Assert.assertEquals("Should have 10 associated services", 10, a.getServiceCount());
        int i=0;
View Full Code Here

Examples of org.rioproject.associations.AssociationDescriptor

        }
    }

    @Test
    public void testEmpty() {
        Association<Dummy> a = new DefaultAssociation<Dummy>(new AssociationDescriptor());
        Assert.assertNull(a.getNextServiceItem());
        Assert.assertNull(a.getService());
        Assert.assertNull(a.getServiceItem());
        Assert.assertNull(a.removeService(new DummyImpl(0)));
        Assert.assertEquals(0, a.getServices().size());
View Full Code Here

Examples of org.rioproject.associations.AssociationDescriptor

        /*
         * Call the static create method providing the service name, service
         * interface class and discovery group name(s). Note the the returned
         * AssociationDescriptor can be modified for additional options as well.
         */
        AssociationDescriptor descriptor = AssociationDescriptor.create("Calculator",
                                                                        Calculator.class,
                                                                        testManager.getGroups());
        /* Create association management and get the Future. */
        org.rioproject.associations.AssociationManagement aMgr = new DefaultAssociationManagement();
        Association<Calculator> association = aMgr.addAssociationDescriptor(descriptor);
View Full Code Here

Examples of org.rioproject.associations.AssociationDescriptor

        boolean createCoreAssociations = true;
        String s = (String)context.getInitParameter("create-core-associations");
        if(s!=null && s.equals("no"))
            createCoreAssociations = false;
        if(createCoreAssociations) {
            AssociationDescriptor monitor =
                createAssociationDescriptor("Monitor", context.getServiceBeanConfig().getGroups());
            Association<ProvisionMonitor> monitorAssociation = associationMgmt.addAssociationDescriptor(monitor);
            monitorFuture = monitorAssociation.getServiceFuture();
        }
    }
View Full Code Here

Examples of org.rioproject.associations.AssociationDescriptor

        /*
         * Create the Association as a REQUIRES, we always require these associations
         * to be resolved. If for some reason we do not resolve these associations,
         * this service will never be advertised.
         */
        AssociationDescriptor ad = new AssociationDescriptor(AssociationType.REQUIRES, name);
        ad.setInterfaceNames(ProvisionMonitor.class.getName());
        //ad.setPropertyName("service");
        ad.setGroups(groups);
        ad.setMatchOnName(false);
        return ad;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.