alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

ActiveMQ example source code file (LogWriter.java)

This example ActiveMQ source code file (LogWriter.java) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - ActiveMQ tags/keywords

io, ioexception, ioexception, logger, logger, logwriter, logwriter, object, object

The ActiveMQ LogWriter.java source code

/**
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.activemq.transport;

import java.io.IOException;

import org.slf4j.Logger;

/**
 * Interface for classes that will be called by the TransportLogger
 * class to actually write to a log file.
 * Every class that implements this interface has do be declared in
 * the resources/META-INF/services/org/apache/activemq/transport/logwriters
 * directory, by creating a file with the name of the writer (for example
 * "default") and including the line
 * class=org.apache.activemq.transport.logwriters.(Name of the LogWriter class)
 * 
 * @author David Martin Clavo david(dot)martin(dot)clavo(at)gmail.com
 * 
 */
public interface LogWriter {

    /**
     * Writes a header message to the log.
     * @param log The log to be written to.
     */
    public void initialMessage(Logger log);
    
    /**
     * Writes a message to a log when a request command is sent.
     * @param log The log to be written to.
     * @param command The command to be logged.
     */
    public void logRequest (Logger log, Object command);
    
    /**
     * Writes a message to a log when a response command is received.
     * @param log The log to be written to.
     * @param command The command to be logged.
     */
    public void logResponse (Logger log, Object response);

    /**
     * Writes a message to a log when an asynchronous equest command is sent.
     * @param log The log to be written to.
     * @param command The command to be logged.
     */
    public void logAsyncRequest (Logger log, Object command);
    
    /**
     * Writes a message to a log when message is sent.
     * @param log The log to be written to.
     * @param command The command to be logged.
     */
    public void logOneWay (Logger log, Object command);
    
    /**
     * Writes a message to a log when message is received.
     * @param log The log to be written to.
     * @param command The command to be logged.
     */
    public void logReceivedCommand (Logger log, Object command);
    
    /**
     * Writes a message to a log when an exception is received.
     * @param log The log to be written to.
     * @param command The command to be logged.
     */
    public void logReceivedException (Logger log, IOException error);
    
}

Other ActiveMQ examples (source code examples)

Here is a short list of links related to this ActiveMQ LogWriter.java source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.