// Path: src/main/java/com/lmax/tool/disruptor/DropListener.java
// public interface DropListener
// {
//     void onDrop();
// }
// 
// Path: src/main/java/com/lmax/tool/disruptor/Invoker.java
// public interface Invoker
// {
//     void invokeWithArgumentHolder(final Object implementation, final Object argumentHolder);
// }
// 
// Path: src/main/java/com/lmax/tool/disruptor/MessagePublicationListener.java
// public interface MessagePublicationListener
// {
//     /**
//      * Called before message is published to the ringbuffer
//      */
//     void onPrePublish();
// 
//     /**
//      * Called after message is published to the ringbuffer. Will not be called if using DROP overflow strategy
//      * and message is dropped.
//      */
//     void onPostPublish();
// }
// 
// Path: src/main/java/com/lmax/tool/disruptor/OverflowStrategy.java
// public enum OverflowStrategy
// {
//     /**
//      * Block the publishing Thread
//      */
//     BLOCK,
//     /**
//      * Discard the message and continue
//      */
//     DROP
// }
// 
// Path: src/main/java/com/lmax/tool/disruptor/ProxyMethodInvocation.java
// public final class ProxyMethodInvocation
// {
//     private Invoker invoker;
//     private Resetable argumentHolder;
// 
//     public Invoker getInvoker()
//     {
//         return invoker;
//     }
// 
//     public void setInvoker(final Invoker invoker)
//     {
//         this.invoker = invoker;
//     }
// 
//     public void setArgumentHolder(final Resetable argumentHolder)
//     {
//         this.argumentHolder = argumentHolder;
//     }
// 
//     public Object getArgumentHolder()
//     {
//         return argumentHolder;
//     }
// 
//     public void reset()
//     {
//         argumentHolder.reset();
//     }
// }


import com.lmax.disruptor.RingBuffer;
import com.lmax.tool.disruptor.DropListener;
import com.lmax.tool.disruptor.Invoker;
import com.lmax.tool.disruptor.MessagePublicationListener;
import com.lmax.tool.disruptor.OverflowStrategy;
import com.lmax.tool.disruptor.ProxyMethodInvocation;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.util.Map;
/*
 * Copyright 2015-2016 LMAX Ltd.
 *
 *    Licensed 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 com.lmax.tool.disruptor.reflect;



final class ReflectiveRingBufferInvocationHandler implements InvocationHandler
{
    private static final String TO_STRING_METHOD_NAME = "toString";

    private final RingBuffer<ProxyMethodInvocation> ringBuffer;
    private final Map<Method, Invoker> methodToInvokerMap;
    private final OverflowStrategy overflowStrategy;
// Path: src/main/java/com/lmax/tool/disruptor/DropListener.java
// public interface DropListener
// {
//     void onDrop();
// }
// 
// Path: src/main/java/com/lmax/tool/disruptor/Invoker.java
// public interface Invoker
// {
//     void invokeWithArgumentHolder(final Object implementation, final Object argumentHolder);
// }
// 
// Path: src/main/java/com/lmax/tool/disruptor/MessagePublicationListener.java
// public interface MessagePublicationListener
// {
//     /**
//      * Called before message is published to the ringbuffer
//      */
//     void onPrePublish();
// 
//     /**
//      * Called after message is published to the ringbuffer. Will not be called if using DROP overflow strategy
//      * and message is dropped.
//      */
//     void onPostPublish();
// }
// 
// Path: src/main/java/com/lmax/tool/disruptor/OverflowStrategy.java
// public enum OverflowStrategy
// {
//     /**
//      * Block the publishing Thread
//      */
//     BLOCK,
//     /**
//      * Discard the message and continue
//      */
//     DROP
// }
// 
// Path: src/main/java/com/lmax/tool/disruptor/ProxyMethodInvocation.java
// public final class ProxyMethodInvocation
// {
//     private Invoker invoker;
//     private Resetable argumentHolder;
// 
//     public Invoker getInvoker()
//     {
//         return invoker;
//     }
// 
//     public void setInvoker(final Invoker invoker)
//     {
//         this.invoker = invoker;
//     }
// 
//     public void setArgumentHolder(final Resetable argumentHolder)
//     {
//         this.argumentHolder = argumentHolder;
//     }
// 
//     public Object getArgumentHolder()
//     {
//         return argumentHolder;
//     }
// 
//     public void reset()
//     {
//         argumentHolder.reset();
//     }
// }


// Path: src/main/java/com/lmax/tool/disruptor/reflect/ReflectiveRingBufferInvocationHandler.java
import com.lmax.disruptor.RingBuffer;
import com.lmax.tool.disruptor.DropListener;
import com.lmax.tool.disruptor.Invoker;
import com.lmax.tool.disruptor.MessagePublicationListener;
import com.lmax.tool.disruptor.OverflowStrategy;
import com.lmax.tool.disruptor.ProxyMethodInvocation;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.util.Map;

/*
 * Copyright 2015-2016 LMAX Ltd.
 *
 *    Licensed 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 com.lmax.tool.disruptor.reflect;



final class ReflectiveRingBufferInvocationHandler implements InvocationHandler
{
    private static final String TO_STRING_METHOD_NAME = "toString";

    private final RingBuffer<ProxyMethodInvocation> ringBuffer;
    private final Map<Method, Invoker> methodToInvokerMap;
    private final OverflowStrategy overflowStrategy;
    private final DropListener dropListener;