Examples of FeedbackHandler


Examples of org.apache.ace.agent.FeedbackHandler

        m_eventLogger.init(m_agentContext);
        m_eventsHandler.addListener(m_eventLogger);
        m_eventLogger.start(m_agentContext);

        // reset the previously logged data in our mock feedbackchannel. No need to create a new one here
        FeedbackHandler feedbackHandler = m_agentContext.getHandler(FeedbackHandler.class);
        TestFeedbackChannel channel = (TestFeedbackChannel) feedbackHandler.getChannel("auditlog");
        channel.reset();
    }
View Full Code Here

Examples of org.apache.ace.agent.FeedbackHandler

    @Test
    public void testWriteEvent() throws Exception {
        FrameworkEvent event = new FrameworkEvent(32, new Object());
        m_eventLogger.frameworkEvent(event);

        FeedbackHandler feedbackHandler = m_agentContext.getHandler(FeedbackHandler.class);
        TestFeedbackChannel channel = (TestFeedbackChannel) feedbackHandler.getChannel("auditlog");
        assertEquals(channel.getLastTtype(), 1001);

    }
View Full Code Here

Examples of org.apache.ace.agent.FeedbackHandler

        ConfigurationHandler configurationHandler = m_agentContext.getHandler(ConfigurationHandler.class);
        configureAgent(configurationHandler, AgentConstants.CONFIG_LOGGING_EXCLUDE_EVENTS, "1001,1002");

        FrameworkEvent event = new FrameworkEvent(32, new Object());

        FeedbackHandler feedbackHandler = m_agentContext.getHandler(FeedbackHandler.class);
        TestFeedbackChannel channel = (TestFeedbackChannel) feedbackHandler.getChannel("auditlog");
        // make sure the configuration is written to the channel
        assertEquals(channel.getLastTtype(), 2000);

        m_eventLogger.frameworkEvent(event);
View Full Code Here

Examples of org.apache.ace.agent.FeedbackHandler

    /**
     * Tests that there is always a default channel registered when starting the agent.
     */
    @Test
    public void testDefaultFeedbackChannelPresent() throws Exception {
        FeedbackHandler feedbackHandler = m_agentContextImpl.getHandler(FeedbackHandler.class);

        assertFeedbackChannelNames(feedbackHandler, AUDITLOG);
        assertFeedbackChannelsPresent(feedbackHandler, AUDITLOG);

        assertFeedbackChannelsNotPresent(feedbackHandler, NON_EXISTING_CHANNEL);
View Full Code Here

Examples of org.apache.ace.agent.FeedbackHandler

    public void testSingleFeedbackChannelConfig() throws Exception {
        ConfigurationHandler configurationHandler = m_agentContextImpl.getHandler(ConfigurationHandler.class);

        configureAgent(configurationHandler, CONFIG_FEEDBACK_CHANNELS, AUDITLOG);

        FeedbackHandler feedbackHandler = m_agentContextImpl.getHandler(FeedbackHandler.class);

        assertFeedbackChannelNames(feedbackHandler, AUDITLOG);
        assertFeedbackChannelsPresent(feedbackHandler, AUDITLOG);
    }
View Full Code Here

Examples of org.apache.ace.agent.FeedbackHandler

    public void testUpdateConfigAddFeedbackChannel() throws Exception {
        ConfigurationHandler configurationHandler = m_agentContextImpl.getHandler(ConfigurationHandler.class);

        configureAgent(configurationHandler, CONFIG_FEEDBACK_CHANNELS, AUDITLOG);

        FeedbackHandler feedbackHandler = m_agentContextImpl.getHandler(FeedbackHandler.class);

        assertFeedbackChannelNames(feedbackHandler, AUDITLOG);

        assertFeedbackChannelsPresent(feedbackHandler, AUDITLOG);
        assertFeedbackChannelsNotPresent(feedbackHandler, CUSTOMCHANNEL);
View Full Code Here

Examples of org.apache.ace.agent.FeedbackHandler

    public void testUpdateConfigRemoveFeedbackChannel() throws Exception {
        ConfigurationHandler configurationHandler = m_agentContextImpl.getHandler(ConfigurationHandler.class);

        configureAgent(configurationHandler, CONFIG_FEEDBACK_CHANNELS, AUDITLOG_AND_CUSTOMCHANNEL);

        FeedbackHandler feedbackHandler = m_agentContextImpl.getHandler(FeedbackHandler.class);

        assertFeedbackChannelNames(feedbackHandler, AUDITLOG, CUSTOMCHANNEL);
        assertFeedbackChannelsPresent(feedbackHandler, AUDITLOG, CUSTOMCHANNEL);

        configureAgent(configurationHandler, CONFIG_FEEDBACK_CHANNELS, AUDITLOG);
View Full Code Here

Examples of org.apache.ace.agent.FeedbackHandler

         * propagated. In production code, a little more sophisticated error checking should be performed.
         * </p>
         */
        private void sendFeedbackToServer() {
            try {
                FeedbackHandler feedbackHandler = m_agentControl.getFeedbackHandler();
                Set<String> channelNames = feedbackHandler.getChannelNames();
                for (String channelName : channelNames) {
                    FeedbackChannel channel = feedbackHandler.getChannel(channelName);

                    System.out.printf("Synchronizing feedback of %s with server...%n", channelName);

                    channel.sendFeedback();
                }
View Full Code Here

Examples of org.apache.ace.agent.FeedbackHandler

         * propagated. In production code, a little more sophisticated error checking should be performed.
         * </p>
         */
        private void sendFeedbackToServer() {
            try {
                FeedbackHandler feedbackHandler = m_agentContext.getHandler(FeedbackHandler.class);
                Set<String> channelNames = feedbackHandler.getChannelNames();
                for (String channelName : channelNames) {
                    FeedbackChannel channel = feedbackHandler.getChannel(channelName);

                    logInfo("Synchronizing feedback of %s with server...", channelName);

                    channel.sendFeedback();
                }
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.