Package de.novanic.eventservice.service.connection.strategy.connector

Examples of de.novanic.eventservice.service.connection.strategy.connector.ConnectionStrategyServerConnector


    @Test
    public void testListen() throws Exception {
        final Domain theDomain = DomainFactory.getDomain("test_domain");
        final UserInfo theUserInfo = new UserInfo("test_user");

        ConnectionStrategyServerConnector theLongPollingListener = new LongPollingServerConnector(createConfiguration(0, 2000, 90000));

        ListenRunnable theListenRunnable = new ListenRunnable(theLongPollingListener, theUserInfo);
        Thread theListenThread = new Thread(theListenRunnable);
        theListenThread.start();
View Full Code Here


    @Test
    public void testListen_Min_Waiting() throws Exception {
        final Domain theDomain = DomainFactory.getDomain("test_domain");
        final UserInfo theUserInfo = new UserInfo("test_user");

        ConnectionStrategyServerConnector theLongPollingListener = new LongPollingServerConnector(createConfiguration(500, 2000, 90000));

        ListenRunnable theListenRunnable = new ListenRunnable(theLongPollingListener, theUserInfo);
        Thread theListenThread = new Thread(theListenRunnable);
        theListenThread.start();
View Full Code Here

    @Test
    public void testListen_Min_Waiting_Interrupted() throws Exception {
        final Domain theDomain = DomainFactory.getDomain("test_domain");
        final UserInfo theUserInfo = new UserInfo("test_user");
        ConnectionStrategyServerConnector theLongPollingListener = new LongPollingServerConnector(createConfiguration(1000, 2000, 90000));

        ListenRunnable theListenRunnable = new ListenRunnable(theLongPollingListener, theUserInfo);
        Thread theListenThread = new Thread(theListenRunnable);

        Date theStartTime = new Date();
View Full Code Here

    @Test
    public void testListen_Max_Waiting() throws Exception {
        final UserInfo theUserInfo = new UserInfo("test_user");

        ConnectionStrategyServerConnector theLongPollingListener = new LongPollingServerConnector(createConfiguration(0, 500, 90000));

        ListenRunnable theListenRunnable = new ListenRunnable(theLongPollingListener, theUserInfo);
        Thread theListenThread = new Thread(theListenRunnable);
        theListenThread.start();
        theListenThread.join();
View Full Code Here

        final TestEventServiceConfiguration theConfig = new TestEventServiceConfiguration();
        theConfig.setConnectionStrategyServerConnectorClassName(LongPollingServerConnector.class.getName());

        ConfigurationDependentFactory theConfigurationDependentFactory = ConfigurationDependentFactory.getInstance(theConfig);

        final ConnectionStrategyServerConnector theConnectionStrategyServerConnector = theConfigurationDependentFactory.getConnectionStrategyServerConnector();
        assertNotNull(theConnectionStrategyServerConnector);
        assertTrue(theConnectionStrategyServerConnector instanceof LongPollingServerConnector);
    }
View Full Code Here

     * @param aResponse response (with the stream)
     * @throws ServletException
     * @throws IOException
     */
    protected void doGet(HttpServletRequest aRequest, HttpServletResponse aResponse) throws ServletException, IOException {
        ConnectionStrategyServerConnector theConnectionStrategyServerConnector = myConfigurationDependentFactory.getConnectionStrategyServerConnector();
        if(theConnectionStrategyServerConnector instanceof StreamingServerConnector) {
            final String theClientId = getClientId(aRequest);
            StreamingServerConnector theStreamingServerConnector = (StreamingServerConnector)theConnectionStrategyServerConnector;
            try {
                //The streaming server connector has to be cloned, because it isn't stateless (a prepare method is required).
View Full Code Here

     * for the client side part / connector and {@link de.novanic.eventservice.config.ConfigParameter#CONNECTION_STRATEGY_SERVER_CONNECTOR}.
     * @return list of events
     */
    public List<DomainEvent> listen() {
        final String theClientId = getClientId();
        ConnectionStrategyServerConnector theConnectionStrategyServerConnector = myConfigurationDependentFactory.getConnectionStrategyServerConnector();
        LOG.debug("Listen (client id \"{}\").", theClientId);
        return listen(theConnectionStrategyServerConnector, theClientId);
    }
View Full Code Here

TOP

Related Classes of de.novanic.eventservice.service.connection.strategy.connector.ConnectionStrategyServerConnector

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.