Package org.jasig.portal.concurrency

Examples of org.jasig.portal.concurrency.CallableWithoutResult


                return currentServer.get();
            }
        });

        //get/create the mutex
        execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                clusterLockDao.updateLock(mutexName);
            }
        });
View Full Code Here


                return currentServer.get();
            }
        });

        //get/create the mutex
        execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                clusterLockDao.releaseLock(mutexName);
            }
        });
View Full Code Here

                return currentServer.get();
            }
        });

        //get/create the mutex
        execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                clusterLockDao.getLock(mutexName);
            }
        });

        currentServer.set("ServerB");
        //get/create the mutex
        execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                clusterLockDao.updateLock(mutexName);
            }
        });
View Full Code Here

                return currentServer.get();
            }
        });

        //get/create the mutex
        execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                clusterLockDao.getLock(mutexName);
            }
        });

        currentServer.set("ServerB");

        //get/create the mutex
        execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                clusterLockDao.releaseLock(mutexName);
            }
        });
View Full Code Here

    public void testLoginAggregationLifecycle() throws Exception {
        final IPortletDefinition portletDefinition = mock(IPortletDefinition.class);
        when(portletDefinition.getName()).thenReturn("PortletName");
        when(portletDefinitionDao.getPortletDefinitionByFname("fname")).thenReturn(portletDefinition);
       
        this.execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                final AggregatedPortletMapping portletMapping = aggregatedPortletLookupDao.getMappedPortletForFname("fname");
               
                assertNotNull(portletMapping);
                assertEquals("fname", portletMapping.getFname());
                assertEquals("PortletName", portletMapping.getName());
            }
        });
       
        this.execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                final AggregatedPortletMapping portletMapping = aggregatedPortletLookupDao.getMappedPortletForFname("fname");
               
                assertNotNull(portletMapping);
                assertEquals("fname", portletMapping.getFname());
                assertEquals("PortletName", portletMapping.getName());
            }
        });
       
        this.execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                final AggregatedPortletMapping portletMapping = aggregatedPortletLookupDao.getMappedPortletForFname("fname_old");
               
                assertNotNull(portletMapping);
                assertEquals("fname_old", portletMapping.getFname());
                assertEquals("fname_old", portletMapping.getName());
            }
        });
       
        this.execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                final AggregatedPortletMapping portletMapping = aggregatedPortletLookupDao.getMappedPortletForFname("fname_old");
               
                assertNotNull(portletMapping);
View Full Code Here

        when(portalJdbcOperations.queryForList(
                "SELECT USER_NAME FROM UP_USER WHERE USER_ID=?",
                String.class,
                1)).thenReturn(Collections.singletonList("FragmentName"));
       
        this.execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                final AggregatedTabMapping tabMappings = aggregatedTabLookupDao.getMappedTabForLayoutId("u1l1s1");
               
                assertNotNull(tabMappings);
                assertEquals("FragmentName", tabMappings.getFragmentName());
                assertEquals("TabName", tabMappings.getTabName());
            }
        });
       
        this.execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                final AggregatedTabMapping tabMappings = aggregatedTabLookupDao.getMappedTabForLayoutId("u1l1s2");
               
                assertNotNull(tabMappings);
                assertEquals("FragmentName", tabMappings.getFragmentName());
                assertEquals("u1l1s2", tabMappings.getTabName());
            }
        });
       
        this.execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                final AggregatedTabMapping tabMappings = aggregatedTabLookupDao.getMappedTabForLayoutId(null);
               
                assertNotNull(tabMappings);
                assertEquals(AggregatedTabMapping.MISSING_TAB_FRAGMENT_NAME, tabMappings.getFragmentName());
                assertEquals(AggregatedTabMapping.MISSING_TAB_NAME, tabMappings.getTabName());
            }
        });
       
        this.execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                final AggregatedTabMapping tabMappings = aggregatedTabLookupDao.getMappedTabForLayoutId("s1");
               
                assertNotNull(tabMappings);
                assertEquals(AggregatedTabMapping.PERSONAL_TAB_FRAGMENT_NAME, tabMappings.getFragmentName());
                assertEquals(AggregatedTabMapping.PERSONAL_TAB_NAME, tabMappings.getTabName());
            }
        });
       
        this.execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                final AggregatedTabMapping tabMappings = aggregatedTabLookupDao.getMappedTabForLayoutId("u1l1s1");
               
                assertNotNull(tabMappings);
                assertEquals("FragmentName", tabMappings.getFragmentName());
                assertEquals("TabName", tabMappings.getTabName());
            }
        });
       
        this.execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                final AggregatedTabMapping tabMappings = aggregatedTabLookupDao.getMappedTabForLayoutId("u1l1s2");
               
                assertNotNull(tabMappings);
                assertEquals("FragmentName", tabMappings.getFragmentName());
                assertEquals("u1l1s2", tabMappings.getTabName());
            }
        });
       
        this.execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                final AggregatedTabMapping tabMappings = aggregatedTabLookupDao.getMappedTabForLayoutId(null);
               
                assertNotNull(tabMappings);
                assertEquals(AggregatedTabMapping.MISSING_TAB_FRAGMENT_NAME, tabMappings.getFragmentName());
                assertEquals(AggregatedTabMapping.MISSING_TAB_NAME, tabMappings.getTabName());
            }
        });
       
        this.execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                final AggregatedTabMapping tabMappings = aggregatedTabLookupDao.getMappedTabForLayoutId("s1");
               
                assertNotNull(tabMappings);
View Full Code Here

//
//        Example event session "1234567890_abcdefg";
        final int EVENT_SESSION_LENGTH = 17;
        final int EVENT_SESSION_HYPHEN_LENGTH = 10;

        this.execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                DateTime timeStamp = null;
                for (int i = 0; i <= 100; i++) {
                    String sessionId = UUID.randomUUID().toString().replaceAll("[\\s\\-()]", "").substring(0, EVENT_SESSION_LENGTH - 1);
View Full Code Here

        final IEntityGroup everyoneGroup = mock(IEntityGroup.class);
        when(everyoneGroup.getServiceName()).thenReturn(new CompositeName("local"));
        when(everyoneGroup.getName()).thenReturn("Everyone");
        when(compositeGroupService.findGroup("local.0")).thenReturn(everyoneGroup);
       
        this.execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                final AggregatedGroupMapping groupMapping = aggregatedGroupLookupDao.getGroupMapping("local.0");
               
                assertNotNull(groupMapping);
                assertEquals("local", groupMapping.getGroupService());
                assertEquals("Everyone", groupMapping.getGroupName());
            }
        });
       
        this.execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                final AggregatedGroupMapping groupMapping = aggregatedGroupLookupDao.getGroupMapping("local.0");
               
                assertNotNull(groupMapping);
                assertEquals("local", groupMapping.getGroupService());
                assertEquals("Everyone", groupMapping.getGroupName());
            }
        });
       
        this.execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                final AggregatedGroupMapping groupMapping = aggregatedGroupLookupDao.getGroupMapping("local.2");
               
                assertNotNull(groupMapping);
View Full Code Here

        final DateTime startDate = DateTime.now().minusDays(1);
        final DateTime endDate = DateTime.now().plusDays(1);
       
        final List<PortalEvent> originalEvents = generateEvents();

        execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                for (final PortalEvent event : originalEvents) {
                    portalEventDao.storePortalEvent(event);
                }
View Full Code Here

        final DateTime startDate = DateTime.now().minusDays(1);
        final DateTime endDate = DateTime.now().plusDays(1);
       
        final List<PortalEvent> originalEvents = generateEvents();
       
        execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                final DateTime oldestPortalEventTimestamp = portalEventDao.getOldestPortalEventTimestamp();
                assertNull(oldestPortalEventTimestamp);
               
                final DateTime newestPortalEventTimestamp = portalEventDao.getNewestPortalEventTimestamp();
                assertNull(newestPortalEventTimestamp);
            }
        });
       

        execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                portalEventDao.storePortalEvents(originalEvents);
            }
        });
       
        Collections.sort(originalEvents, new Comparator<PortalEvent>() {
            @Override
            public int compare(PortalEvent o1, PortalEvent o2) {
                return o1.getTimestampAsDate().compareTo(o2.getTimestampAsDate());
            }
        });
       
        execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                final DateTime oldestPortalEventTimestamp = portalEventDao.getOldestPortalEventTimestamp();
                final DateTime newestPortalEventTimestamp = portalEventDao.getNewestPortalEventTimestamp();
               
View Full Code Here

TOP

Related Classes of org.jasig.portal.concurrency.CallableWithoutResult

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.