Package org.apache.qpid.server.logging

Examples of org.apache.qpid.server.logging.LogActor


            CurrentActor.set(_actor);
        }
        else
        {
            ServerSession channel = (ServerSession) getSession(event.getChannel());
            LogActor channelActor = null;

            if (channel != null)
            {
                channelActor = channel.getLogActor();
            }
View Full Code Here


    }

    protected void sendToDLQOrDiscard(QueueEntry entry)
    {
        final Exchange alternateExchange = entry.getQueue().getAlternateExchange();
        final LogActor logActor = CurrentActor.get();
        final ServerMessage msg = entry.getMessage();
        if (alternateExchange != null)
        {
            final InboundMessage m = new InboundMessageAdapter(entry);

            final List<? extends BaseQueue> destinationQueues = alternateExchange.route(m);

            if (destinationQueues == null || destinationQueues.isEmpty())
            {
                entry.discard();

                logActor.message( ChannelMessages.DISCARDMSG_NOROUTE(msg.getMessageNumber(), alternateExchange.getName()));
            }
            else
            {
                entry.routeToAlternate();

                //output operational logging for each delivery post commit
                for (final BaseQueue destinationQueue : destinationQueues)
                {
                    logActor.message( ChannelMessages.DEADLETTERMSG(msg.getMessageNumber(), destinationQueue.getNameShortString().asString()));
                }
            }
        }
        else
        {
            entry.discard();
            logActor.message(ChannelMessages.DISCARDMSG_NOALTEXCH(msg.getMessageNumber(), entry.getQueue().getName(), msg.getRoutingKey()));
        }
    }
View Full Code Here

    }

    public void testSubmitAndWaitCurrentActorAndSecurityManagerSubjectAreRespected() throws Exception
    {
        _executor.start();
        LogActor actor = new TestLogActor(new NullRootMessageLogger());
        Subject subject = new Subject();
        Subject currentSecurityManagerSubject = SecurityManager.getThreadSubject();
        final AtomicReference<LogActor> taskLogActor = new AtomicReference<LogActor>();
        final AtomicReference<Subject> taskSubject = new AtomicReference<Subject>();
        try
View Full Code Here

            user = splitConnectionId[1];
        }

        // use a separate instance of actor as subject is not set on connect/disconnect
        // we need to pass principal name explicitly into log actor
        LogActor logActor = new ManagementActor(_rootMessageLogger, user);
        if (JMXConnectionNotification.OPENED.equals(type))
        {
            logActor.message(ManagementConsoleMessages.OPEN(user));
        }
        else if (JMXConnectionNotification.CLOSED.equals(type) ||
                 JMXConnectionNotification.FAILED.equals(type))
        {
            logActor.message(ManagementConsoleMessages.CLOSE(user));
        }
    }
View Full Code Here

     * before task execution is the CurrentActor after execution.
     */
    public void testCurrentActorStackBalance() throws Exception
    {
        //create and set a test actor
        LogActor testActor = new TestLogActor(new NullRootMessageLogger());
        CurrentActor.set(testActor);

        //verify it is returned correctly before executing a HouseKeepingTask
        assertEquals("Expected LogActor was not returned", testActor, CurrentActor.get());

View Full Code Here

    }

    public void testThreadNameIsSetForDurationOfTask() throws Exception
    {
        //create and set a test actor
        LogActor testActor = new TestLogActor(new NullRootMessageLogger());
        CurrentActor.set(testActor);

        String originalThreadName = Thread.currentThread().getName();

        String vhostName = "HouseKeepingTaskTestVhost";
View Full Code Here

            throw new NullPointerException("LogSubject has not been set");
        }

        UnitTestMessageLogger logger = new UnitTestMessageLogger(statusUpdatesEnabled);

        LogActor actor = new TestLogActor(logger);

        actor.message(_subject, new LogMessage()
        {
            public String toString()
            {
                return "<Log Message>";
            }
View Full Code Here

            CurrentActor.set(_actor);
        }
        else
        {
            ServerSession channel = (ServerSession) getSession(event.getChannel());
            LogActor channelActor = null;

            if (channel != null)
            {
                channelActor = channel.getLogActor();
            }
View Full Code Here

        }

        ServerConfiguration serverConfig = new ServerConfiguration(_config);
        UnitTestMessageLogger logger = new UnitTestMessageLogger(serverConfig);

        LogActor actor = new TestLogActor(logger);

        actor.message(_subject, new LogMessage()
        {
            public String toString()
            {
                return "<Log Message>";
            }
View Full Code Here

        AMQBody body = frame.getBodyFrame();

        //Look up the Channel's Actor and set that as the current actor
        // If that is not available then we can use the ConnectionActor
        // that is associated with this AMQMPSession.
        LogActor channelActor = null;
        if (_channelMap.get(channelId) != null)
        {
            channelActor = _channelMap.get(channelId).getLogActor();
        }
        CurrentActor.set(channelActor == null ? _actor : channelActor);
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.logging.LogActor

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.