Examples of ServiceElement


Examples of org.rioproject.opstring.ServiceElement

    @Test
    public void testEnsureGroups() throws Exception {
        startLookup("foo");
        Assert.assertFalse(hasGroup(registrar, "gack"));
        ServiceElement service = createSE("gack");
        Assert.assertTrue(waitForDiscovery(listener));
        Assert.assertTrue(listener.discovered.get());
        DL newDiscoListener = new DL();
        new LookupDiscoveryManager(new String[]{"gack"}, null, newDiscoListener);
        deploymentVerifier.ensureGroups(service);
View Full Code Here

Examples of org.rioproject.opstring.ServiceElement

    public void testEnsureMultiGroups() throws Exception {
        startLookup("foo");
        Assert.assertTrue(waitForDiscovery(listener));
        Assert.assertFalse(hasGroup(registrar, "gack"));
        Assert.assertFalse(hasGroup(registrar, "blutarsky"));
        ServiceElement service = createSE("gack", "blutarsky");
        Assert.assertTrue(listener.discovered.get());
        DL newDiscoListener = new DL();
        new LookupDiscoveryManager(new String[]{"gack"}, null, newDiscoListener);
        deploymentVerifier.ensureGroups(service);
        Assert.assertTrue(waitForDiscovery(newDiscoListener));
View Full Code Here

Examples of org.rioproject.opstring.ServiceElement

        Assert.assertTrue(hasGroup(registrar, "blutarsky"));
    }

    @Test(expected = IOException.class)
    public void testAllGroupsFail() throws Exception {
        ServiceElement service = new ServiceElement();
        ServiceBeanConfig serviceBeanConfig = new ServiceBeanConfig();
        serviceBeanConfig.setGroups("all");
        service.setServiceBeanConfig(serviceBeanConfig);
        deploymentVerifier.ensureGroups(service);
    }
View Full Code Here

Examples of org.rioproject.opstring.ServiceElement

    public ComputeResourceUtilization getComputeResourceUtilization() {
        return computeResource.getComputeResourceUtilization();
    }

    public void serviceInstantiated(final ServiceRecord record) {
        ServiceElement service = record.getServiceElement();
        logger.info("Instantiated {}, {}", ServiceLogUtil.logName(service), ServiceLogUtil.discoveryInfo(service));
        try {
            listener.serviceInstantiated(record);
        } catch (RemoteException e) {
            logger.warn("Notifying Cybernode that the service is active", e);
View Full Code Here

Examples of org.rioproject.opstring.ServiceElement

        service.setServiceBeanConfig(serviceBeanConfig);
        deploymentVerifier.ensureGroups(service);
    }

    private ServiceElement createSE(String... groups) {
        ServiceElement service = new ServiceElement();
        ServiceBeanConfig serviceBeanConfig = new ServiceBeanConfig();
        serviceBeanConfig.setGroups(groups);
        service.setServiceBeanConfig(serviceBeanConfig);
        return service;
    }
View Full Code Here

Examples of org.rioproject.opstring.ServiceElement

    /**
     * @see org.rioproject.deploy.ServiceStatementManager#record
     */
    public void record(ServiceStatement statement) {
        synchronized (statementMap) {
            ServiceElement key = statement.getServiceElement();
            boolean active = statement.hasActiveServiceRecords();
            if (active) {
                statementMap.put(key, statement);

            } else {
View Full Code Here

Examples of org.rioproject.opstring.ServiceElement

        //Assert.assertTrue(notSupported.size()==2);
        Assert.assertFalse(instantiatorResource.canProvision(request));
    }

    ServiceElement createServiceElement() {
        ServiceElement serviceElement = TestUtil.makeServiceElement("foo", "test", 1);
        serviceElement.setServiceLevelAgreements(createServiceLevelAgreements(true, true));
        return serviceElement;
    }
View Full Code Here

Examples of org.rioproject.opstring.ServiceElement

    public static ServiceElement makeServiceElement(String name, String opStringName) {
        return makeServiceElement(name, opStringName, 1);
    }

    public static ServiceElement makeServiceElement(String name, String opStringName, int planned) {
        ServiceElement elem = new ServiceElement();
        ClassBundle exports = new ClassBundle(Object.class.getName());
        elem.setExportBundles(exports);
        ClassBundle main = new ClassBundle("");
        elem.setComponentBundle(main);
        ServiceBeanConfig sbc = new ServiceBeanConfig();
        sbc.setName(name);
        sbc.setOperationalStringName(opStringName);
        elem.setServiceBeanConfig(sbc);
        elem.setPlanned(planned);
        return elem;
    }
View Full Code Here

Examples of org.rioproject.opstring.ServiceElement

*/
public class ServiceChannelTest {
    @Test
    public void testSubscribe() {
        ServiceChannel serviceChannel = ServiceChannel.getInstance();
        ServiceElement serviceElement = TestUtil.makeServiceElement("bar", "foo");
        Listener l1 = new Listener();
        serviceChannel.subscribe(l1, serviceElement, ServiceChannelEvent.Type.PROVISIONED);
        Listener l2 = new Listener();
        serviceChannel.subscribe(l2, serviceElement, ServiceChannelEvent.Type.FAILED);
        Listener l3 = new Listener();
View Full Code Here

Examples of org.rioproject.opstring.ServiceElement

* @author Dennis Reedy
*/
public class IdleServiceManagerTest {
    @Test
    public void testIdleServiceManager() throws InterruptedException {
        ServiceElement serviceElement = TestUtil.makeServiceElement("bar", "foo", 2);
        IdleServiceManager idleServiceManager = new IdleServiceManager(3000l, serviceElement);
        TestServiceActivityProvider sap1 = new TestServiceActivityProvider();
        TestServiceActivityProvider sap2 = new TestServiceActivityProvider();
        idleServiceManager.addService(sap1);
        Listener l = new Listener();
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.