[ 
https://issues.apache.org/jira/browse/ARTEMIS-856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16555839#comment-16555839
 ] 

ASF GitHub Bot commented on ARTEMIS-856:
----------------------------------------

Github user franz1981 commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/2175#discussion_r205158077
  
    --- Diff: 
artemis-commons/src/main/java/org/apache/activemq/artemis/utils/AtomicBooleanFieldUpdater.java
 ---
    @@ -0,0 +1,154 @@
    +/*
    + * 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.artemis.utils;
    +
    +import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
    +import sun.reflect.CallerSensitive;
    +
    +public class AtomicBooleanFieldUpdater<T> {
    +
    +   /**
    +    * Creates and returns an updater for objects with the given field.
    +    * The Class argument is needed to check that reflective types and
    +    * generic types match.
    +    *
    +    * @param tclass the class of the objects holding the field
    +    * @param fieldName the name of the field to be updated
    +    * @param <U> the type of instances of tclass
    +    * @return the updater
    +    * @throws IllegalArgumentException if the field is not a
    +    * volatile long type
    +    * @throws RuntimeException with a nested reflection-based
    +    * exception if the class does not hold field or is the wrong type,
    +    * or the field is inaccessible to the caller according to Java language
    +    * access control
    +    */
    +   @CallerSensitive
    +   public static <U> AtomicBooleanFieldUpdater<U> newUpdater(Class<U> 
tclass, String fieldName) {
    --- End diff --
    
    I know that is a sad that JDK isn't providing this class with a native 
implementation, but I would use directly `AtomicIntegerFiledUpdater` or 
`AtomicReferenceFieldUpdater` with `Boolean` values instead.
    The reason is that there is an implicit behaviour of any 
`SomethingFiledUpdater` that can't be enforced here: the declaration of a 
`volatile Something`.
    Instead, the real purpose of this class is to treat integer values like 
boolean ones so I suppose that using a plain statitc util class to convert 
boolean<->integer will make it simple while avoiding to provide a more complex 
concurrent util class.


> Support advanced destination options
> ------------------------------------
>
>                 Key: ARTEMIS-856
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-856
>             Project: ActiveMQ Artemis
>          Issue Type: New Feature
>          Components: Broker
>            Reporter: Matt Pavlovich
>            Priority: Major
>
> Add support enhancing destination consumer features (ActiveMQ 5.x parity):
> consumersBeforeDispatchStarts
>  timeBeforeDispatchStarts
> [http://activemq.apache.org/per-destination-policies.html]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to